4

I don't know why the math in section is not show in bookmark?

\documentclass{amsart}
\usepackage{bookmark}
\usepackage{hyperref}
\hypersetup{ 
  pdfencoding=auto
}

\begin{document}
 \section[\texorpdfstring{$\varepsilon$ in section}{epsilon in section}]{$\varepsilon$ in section}
\end{document}

It seems that my code should work, c.f. Math in table of contents, bookmarks and heading, but I don't know why it is not?


In fact, I find it work for article but not work for amsart.

user19832
  • 1,585

2 Answers2

7

With amsart, the argument used for making the bookmark is the mandatory one and not the optional argument.

\documentclass{amsart}
\usepackage{hyperref}
\usepackage{bookmark}
\hypersetup{
  pdfencoding=auto
}

\begin{document}
 \section{\texorpdfstring{$\varepsilon$}{epsilon} in section}
\end{document}

The optional argument is used only for the headings, while hyperref and bookmark use what's going to go in the table of contents.

enter image description here

egreg
  • 1,121,712
4

With lualatex or xetex and the packages fontspec and unicode-math things look like this:

output

\documentclass{amsart}
\usepackage{fontspec}


\usepackage{unicode-math}       % Use unicode input in math 
\setmathfont{Latin Modern Math} % You have to set a Math Font, Latin Modern is the Standard

\usepackage[unicode]{hyperref}
\usepackage{booktabs}


\begin{document}
\section{Epsilon-Test: $ε$ and $ϵ$}
\end{document}

You may want to add these options to follow the ISO-Standards of typesetting math (which i consider more consistent than the Standard LaTeX behaviour):

\usepackage[
    math-style=ISO,      % Upper Case Greek is in italics
    bold-style=ISO,      % Bold math is in italics
    partial=upright,     % nabla and partial upright
    nabla=upright,
  ]{unicode-math}
MaxNoe
  • 6,136
  • Ok this maybe another solution, by the way, can the code be simplified? I mean, if I don't want change the math font, what can I do? – user19832 Nov 11 '14 at 13:26
  • Leave out the Options? Then you have standard LaTeX ouput, which however is not according to the ISO standards for typesetting math. Why should a variable $X$ be italics but not a matrix $\mathbf{X}$? Doesn't make to much sense, does it? – MaxNoe Nov 11 '14 at 13:28
  • I edited my answer. – MaxNoe Nov 11 '14 at 22:21
  • Ehm ... \bm ... ehm. And btw, ISO is for engineers, moreover contains so much idiocy that it's better not to follow it at all. – yo' Nov 11 '14 at 22:36
  • Well just to name a few: Integrals 'dx' has to be with upright 'd' (nonsense). Physical constants have to be typeset italic because "their value can change". And speaking of fonts, why should all maths be italic? There are pretty upright math fonts in the world that can be used as well. And after all, \bm does what you ask for, so you can simply forget that \mathbf exists and that's it. – yo' Nov 11 '14 at 22:46