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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply