latex3 / hyperref

Hypertext support for LaTeX
165 stars 35 forks source link

Wrong line breaks in table of contents for amsart #300

Closed fmariofilho closed 1 year ago

fmariofilho commented 1 year ago

When using the amsart class together with hyperref, lines in the table of contents for sections with long names are not properly broken. This happens only when compiling with latex. Strangely, pdflatex produces the correct output.

This is a particularly bad bug because arXiv compiles with latex, and so papers submitted to the arXiv may have this problem.

Here is a minimal working code for the bug:

\documentclass{amsart}

\usepackage[colorlinks]{hyperref}

\begin{document}

\tableofcontents

\section{This is a normal section}

\section{This is a section with a very long name to see if the line break will
  be made correctly when using latex}

\end{document}
u-fischer commented 1 year ago

With dvips the link in the toc can't break over lines. If you want to use dvips, use either the linktoc option to link only the page number \usepackage[colorlinks,linktoc=page]{hyperref} or try the hypdvips package.

Personally I would simply tell arxiv to use pdftex: https://info.arxiv.org/help/submit_tex.html#pdflatex