How to Write Underlined Text in LaTeX

In LaTeX, you can write underlined text using the \underline command.

The following examples show how to write underlined text in LaTeX.

How to Write Underlined Text in Text

We can use the \underline command to write underlined text in LaTeX document for text.

Suppose we want to write underlined text in the text.

We can use the following LaTeX code to do so:

\documentclass{article}
\begin{document}

This is an example of using the \underline{underlined} text with the \texttt{\textbackslash underline} command.

\end{document}

Output: 👇️

Underline Text

In this example, we use the \underline command to display the underlined text in the document.

How to Write Underlined Text in Mathematical Expressions

For mathematical expressions, we can use the \underline command to ensure proper formatting.

Suppose we would like to write mathematical expressions that contain underlined text.

We can use the following LaTeX code to do so:

\documentclass{article}
\begin{document}

An inline mathematical expression: \( \underline{a + b} \).

A displayed mathematical expression:
\[
\underline{a + b}
\]

\end{document}

Output: 👇️

Underline Text in Math Expression

In this example, we use the \underline command to denote underlined text in both inline and displayed mathematical expressions.

Conclusion

We can use the \underline command for both text and mathematical expressions.