90

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.)

Martin Scharrer
  • 262,582
Martin
  • 4,565

3 Answers3

80

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.

Martin Scharrer
  • 262,582
  • 1
    When you use \uline the line will be pretty far away from the text but when you use \underline{..} everything will just look fine (this is my personal feeling about it). Comparison between both (Image 7KB) – BlueWizard May 14 '15 at 09:27
  • @JonasDralle: I guess that \uline draws the line at the maximum distance independent of the content while \underline directly uses the bounding box of the content. Test it again with content which has a depth, like the word gym. Note that \underline is AFAIK designed for math and will not break around lines. So it might be fine for single words but not for longer texts. – Martin Scharrer May 18 '15 at 21:04
  • 2
    @JonasDralle Use a word which has letters such as g. See Comparsion between both (Image, 10kb). \uline is always at the same height, whereas \underline on different heights. – koppor Jan 11 '17 at 19:17
54

Easy enough: \underline{...}

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

Martin
  • 4,565
  • 15
    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
18

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

https://texfaq.org/FAQ-underline

David Carlisle
  • 757,742
Ulrike Fischer
  • 327,261