Sometimes I want to underline some text, and it extends past the end of a line. Why does \underline{}
not automatically wrap my text for me ?
Also, how can I underline text so that it will still wrap ?
line-breakingsoultext-decorations
Sometimes I want to underline some text, and it extends past the end of a line. Why does \underline{}
not automatically wrap my text for me ?
Also, how can I underline text so that it will still wrap ?
Best Answer
In text mode, the
\underline
command will enclose its argument in a horizontal box, which doesn't allow linebreaks. Use the\ul
command of thesoul
package instead.EDIT: As for why
\underline
works the way it does, see this entry in the UK TeX FAQ for starters. It would seem that Leslie Lamport (the author of LaTeX) implemented just a "quick fix", and that only later package authors came up with more satisfactory solutions for underlining. See sections 2 and 7 of thesoul
documentation to get an idea of how complicated things are.