+5 votes
231 views
in Office by (242k points)
reopened
LaTeX: insert underscore - that's how it works

1 Answer

+3 votes
by (1.6m points)
 
Best answer

How to put an underscore in text mode
How to underline a whole word

An underscore in the LaTeX document is a reserved special character. We'll show you how you can insert an underscore anyway..

image image

Like other special characters, an underscore is reserved for LaTeX commands. With an underscore you can set an index in math mode, for example "$ x_ {1} $" is converted to "x 1 ". How you can create an underscore or underline an entire word in normal running text is explained in the following article.

How to put an underscore in text mode

If you want to insert an underscore in text mode, you must \ mark it with an introductory backslash . Simply write in text mode \_ and LaTeX creates an underscore in the outgoing document for you.

How to underline a whole word

You can \underline{Text} underline a whole word in LaTeX with the command . Replace "Text" with the desired word or with several words.

Finally, a minimal example summarizes both cases:

image

...