1

How to align uline and uuline same width of line using ulem package? I attached screenshot for your reference.

enter image description here

1 Answer 1

1

That is because \uline uses a precisely controlled "rule" for the underline, but \uuline lays down the double rule in chunks because it is written the way \uwave is (using \markoverwith). The chunks are clearly a requirement for \uwave (the squiggle characters have to align, and they only come in whole characters), whereas \uuline uses chunks more for convenience.

How critical is it that they line up? The definition of \uuline could use a smaller "chunk" to give more precise matching of size. It could be made to match exactly using two rules, but that would require rewriting more internal macros.

A \uuline with smaller chunks can be defined like this:

\makeatletter
\protected\def\uuline{\leavevmode \bgroup
 \UL@setULdepth
 \ifx\UL@on\UL@onin \advance\ULdepth2.8\p@\fi
 \let\ULleaders\cleaders % added
 % use \UL@pixel widths below
 \markoverwith{\lower\ULdepth\hbox{\kern-0.5\UL@pixel
    \vbox{\hrule width3\UL@pixel\kern1\p@\hrule}\kern-0.5\UL@pixel}}%
 \ULon}

That may well be good enough.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .