Discussion:
Math code in section title and hyperref
(too old to reply)
Tinenee
2007-12-05 15:33:15 UTC
Permalink
Hello,

I have a problem when wanting to have a greek character in the title
of a section AND using the hyperref package.
The thing I would like to have is the title of my section with a greek
letter:
\section($\eta$ factor)
and the hyperlinks in the toc with the parts, chapters,... in the pdf
file.

I have been trying to put the math code in brackets \section({$\eta$}
factor) but it does not works also.
Anyway, having a different name for the toc \section[Eta factor]($\eta
$ factor) seems to work, but it is not really what I wish!
May it be because it can not be any greek letter in the pdf bookmark?
Enrico Gregorio
2007-12-05 16:51:53 UTC
Permalink
Post by Tinenee
Hello,
I have a problem when wanting to have a greek character in the title
of a section AND using the hyperref package.
The thing I would like to have is the title of my section with a greek
\section($\eta$ factor)
and the hyperlinks in the toc with the parts, chapters,... in the pdf
file.
I have been trying to put the math code in brackets \section({$\eta$}
factor) but it does not works also.
Anyway, having a different name for the toc \section[Eta factor]($\eta
$ factor) seems to work, but it is not really what I wish!
May it be because it can not be any greek letter in the pdf bookmark?
\section{\texorpdfstring{$\eta$}{Eta} factor}

Are you really using parentheses to delimit the argument
to \section? :-)

Ciao
Enrico
Maarten Bergvelt
2007-12-05 17:02:48 UTC
Permalink
Post by Tinenee
I have a problem when wanting to have a greek character in the title
of a section AND using the hyperref package.
The thing I would like to have is the title of my section with a greek
\section($\eta$ factor)
and the hyperlinks in the toc with the parts, chapters,... in the pdf
file.
I have been trying to put the math code in brackets \section({$\eta$}
factor) but it does not works also.
Anyway, having a different name for the toc \section[Eta factor]($\eta
$ factor) seems to work, but it is not really what I wish!
May it be because it can not be any greek letter in the pdf bookmark?
If I do

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{$\eta$ section}
What?
\newpage
\section{$\epsilon$ section}
\end{document}

I have no problem, so maybe you should explain what you are doing, and
what the problem is.

Minimal example?
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
Ask questions?
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=askquestion
--
Maarten Bergvelt
Enrico Gregorio
2007-12-05 17:52:36 UTC
Permalink
Post by Maarten Bergvelt
If I do
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{$\eta$ section}
What?
\newpage
\section{$\epsilon$ section}
\end{document}
I have no problem, so maybe you should explain what you are doing, and
what the problem is.
At least you get some warnings like

Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `math shift' on input line 5.

Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\eta' on input line 5.

Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `math shift' on input line 5.

and probably the OP was referring to them. And to the fact that the
bookmarks are missing the "eta".

Ciao
Enrico
Maarten Bergvelt
2007-12-05 19:27:04 UTC
Permalink
Post by Enrico Gregorio
Post by Maarten Bergvelt
If I do
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{$\eta$ section}
What?
\newpage
\section{$\epsilon$ section}
\end{document}
I have no problem, so maybe you should explain what you are doing, and
what the problem is.
At least you get some warnings like
Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `math shift' on input line 5.
Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\eta' on input line 5.
Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `math shift' on input line 5.
and probably the OP was referring to them. And to the fact that the
bookmarks are missing the "eta".
I see. I was not looking for warnings.

Well, it would have been nice if the OP told us about it, right?

Thanks for clarifying.
--
Maarten Bergvelt
Tinenee
2007-12-05 20:07:47 UTC
Permalink
Thanks a lot for your answers. Anyway it's right I omited the
warnings.

Enrico's and Heiko's solutions are working well.

\usepackage[unicode]{hyperref}
\section{\texorpdfstring{$\eta$}{\texteta} factor}

Tinenee
Post by Maarten Bergvelt
Post by Enrico Gregorio
Post by Maarten Bergvelt
If I do
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{$\eta$ section}
What?
\newpage
\section{$\epsilon$ section}
\end{document}
I have no problem, so maybe you should explain what you are doing, and
what the problem is.
At least you get some warnings like
Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `math shift' on input line 5.
Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\eta' on input line 5.
Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `math shift' on input line 5.
and probably the OP was referring to them. And to the fact that the
bookmarks are missing the "eta".
I see. I was not looking for warnings.
Well, it would have been nice if the OP told us about it, right?
Thanks for clarifying.
--
Maarten Bergvelt
Heiko Oberdiek
2007-12-05 17:43:01 UTC
Permalink
Post by Tinenee
I have a problem when wanting to have a greek character in the title
of a section AND using the hyperref package.
The thing I would like to have is the title of my section with a greek
\section($\eta$ factor)
and the hyperlinks in the toc with the parts, chapters,... in the pdf
file.
\usepackage[unicode]{hyperref}
\section{\texorpdfstring{$\eta$}{\texteta} factor}

Yours sincerely
Heiko <***@uni-freiburg.de>
Loading...