I need to typeset a sentence such that just the words are underlined, and not the space between the words.
Using the \underline
will include the spaces between the words. I could do it with something like
\underline{The} \underline{quick} \underline{brown} \underline{fox} \underline{jumped} \underline{over} \underline{the} \underline{lazy} \underline{dog}
but it is too tedious and a painful thing to do.
Also, the above line produces what is intended, but the spacing of the underline from the words is uneven. It would be really helpful if this is addressed in the answer as well. The above line produces this:
Is there a package or something easier to achieve this?
Best Answer
Let's make
soul
work less:Basically, the argument is split at spaces; every fragment is fed to
\ul
and a space is added. The last one is removed by\unskip
.