Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Given a simple paragraph, how do I underline a word in that paragraph?

(Note: I post this here because it wasn't really obvious using google or this site and my TexNicCenter is somehow missing this highlighting option.)

share|improve this question
6  
One reason why it might be missing is that AFAIK underlining is traditionally not used in professional typesetting. Instead italic or bold fonts are used for highlighting. Another alternative would be colored text. In my early LaTeX days I got told to break with this "MS Word habit". Feel free to use it, I just thought it is worth mentioning. –  Martin Scharrer Mar 14 '11 at 14:07
    
@M.Scharrer : I want to use it to highlight a part of a textTT formatted source string. Bold/emphasis typeface for textTT doesn't work very well (esp. on-screen). –  Martin Mar 14 '11 at 14:37
2  
The @ syntax uses the first three characters after it, so @M.Scharrer doesn't work. Because out both usernames start the same you need to use at least @MartinS (the space can be dropped). –  Martin Scharrer Mar 14 '11 at 14:57
    

3 Answers 3

up vote 37 down vote accepted

Use \usepackage[normalem]{ulem} and then \uline{...}. It allows line breaks in the underlined text. Other forms of underlining (double, waves) or emphasis (crossed out, ...) are also supported. See the image in Url with fragments in bold for examples.

share|improve this answer
1  
Excellent Info. Thanks! (Note that for simplicity's sake, I'm gonna mark the answer mentioning only \underline –  Martin Mar 14 '11 at 14:38
3  
@Martin: I would call \underline rather "partially inoperate" than just "simple" and urge you to accept either Martin Scharrer's or Ulrike's answer. (Besides, you won't get +2 rep for accepting your own answer. ;-)) –  lockstep Mar 14 '11 at 14:54

Easy enough: \underline{...}

Note that this is the simplest form. See the answer by Martin Scharrer for some advanced info.

share|improve this answer
9  
The problem with \underline is that it doesn't supports line breaks i.e. hyphenation in its content, e.g. like \mbox or better \fbox. For smaller words this might be ok, but not for longer ones or multiple words. –  Martin Scharrer Mar 14 '11 at 14:00

Beside \underline you can also use the packages soul and ulem.

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=underline

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.