TransWikia.com

Multi-line URLs are not properly colored in floating captions

TeX - LaTeX Asked on April 28, 2021

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}

One Answer

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

documentclass{amsart}

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

Correct answer by Heiko Oberdiek on April 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP