Text FormattingUnderlining autorefs

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
jsone
Posts: 1
Joined: Thu Mar 24, 2016 9:04 am

Underlining autorefs

Post by jsone »

I would like to underline all links in a document that are created with \autoref. I have tried redefining the command, which works fine for the standard \underline command. To improve on spacing, I tried to use \smash, but that breaks clickability.

My question is: how can I get \autoref to work with ulem or soul? Both attempts result in an Extra }... error. I have tried \texorpdfstring, without any lack.

Code: Select all

\let\Oldautoref\autoref
\renewcommand{\autoref}[1]{\texorpdfstring{\uline{\Oldautoref{#1}}}{\Oldautoref{#1}}
Could someone please assist me in redefining \autoref's internals?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply