2

With document class amsart, urls are not properly colored when spanning more than one line in figure captions and table captions. I want them colored. The xurl package is not relevant to the bug, but a solution should not contradict xurl.

\documentclass{amsart}

\usepackage{xurl}
\usepackage[colorlinks]{hyperref}

\begin{document}

    \begin{table}
        \caption{
            The last line is not properly colored
            \url{https://tex.stackexchange.com/questions/999999/The-last-line-is-not-properly-colored.}
        }
    \end{table}
    
    \begin{figure}
        \caption{
            The last line is not properly colored
            \url{https://tex.stackexchange.com/questions/999999/The-last-line-is-not-properly-colored.}
        }
    \end{figure}

\end{document}

1

Try package caption, because it solves quite a few package incompatibilities.

\documentclass{amsart}

\usepackage{xurl}
\usepackage[colorlinks]{hyperref}
\usepackage{caption}
2
  • Just to clarify: Is this how you would order these packages? caption after hyperref?
    – Symbol 1
    Dec 28 '20 at 15:43
  • The caption package needs to know, which other relevant packages are used. Therefore, I have loaded it after package hyperref. It it is loaded before hyperref, the caption package defers its code to \begin{document} . Dec 28 '20 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.