Dears,
does anybody have an idea how I can put math symbols in section headings?
I get an error message when I try this:
\section{$k$-means clustering}
error:
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
It produces a heading though, I would just want to do it without the error!
Cheers
Newbi
Math & Science ⇒ math symbols in headings with hyperref
-
- Posts: 11
- Joined: Wed Sep 15, 2010 2:44 pm
math symbols in headings with hyperref
Last edited by totalnewbi on Sun Oct 03, 2010 8:49 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.
-
- Posts: 11
- Joined: Wed Sep 15, 2010 2:44 pm
Re: math symbols in headings with hyperref
Sorry for not looking thoroughly before ..... here is the solution:
\section{\texorpdfstring{$k$-means }{k-means}}
\section{\texorpdfstring{$k$-means }{k-means}}
Re: math symbols in headings with hyperref
Hello,
I am very new to this board.
I am struggling with quite a few latex problems, although I have in fact been using this program for many years.
I found this question using the search function. I am getting a lot of these "token not allowed" warnings at this point. I know how to fix it from the above, but that in my opinion takes a lot of effort if you have tons of these titles with $-signs in them.
I also don't quite understand what difference it makes if you do this or not (there is not really an error, only a warning, and the output looks exactly the same?)
Many thanks!
I am very new to this board.
I am struggling with quite a few latex problems, although I have in fact been using this program for many years.
I found this question using the search function. I am getting a lot of these "token not allowed" warnings at this point. I know how to fix it from the above, but that in my opinion takes a lot of effort if you have tons of these titles with $-signs in them.
I also don't quite understand what difference it makes if you do this or not (there is not really an error, only a warning, and the output looks exactly the same?)
Many thanks!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
math symbols in headings with hyperref
.fredbel6 wrote:[…] I am getting a lot of these "token not allowed" warnings at this point. I know how to fix it from the above, but that in my opinion takes a lot of effort if you have tons of these titles with $-signs in them. […]
I see no other solution than to replace them manually. For future projects you know what to do.
Take a look at the bookmarks in the resulting PDF output and you will understand.fredbel6 wrote:[…] I also don't quite understand what difference it makes if you do this or not (there is not really an error, only a warning, and the output looks exactly the same?) […]
According to Section 1.5 of the Board Rules (to be read before posting) you should not hijack topics that are marked as solved. Please keep that in mind for the future.
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10