StartLaTeX faqLaTeX for Beginners F.A.Q.LaTeX topicsLaTeX courseSearch

LaTeX offers various ways to enhance text formatting, including double underlining for emphasis. This feature is particularly useful when highlighting important terms or figures, adding visual prominence to specific elements within a document.

To double underline text or numbers (within the math environment) in LaTeX, you can nest the \underline command.

## Example

Suppose we want to emphasize the term "profit" in a mathematical equation. We can achieve this using the following code:

Revenue - Costs = \underline{\underline{Profit}}

This will result in the term "profit" being double underlined in the equation. Similarly, if we have numerical values to emphasize, such as in the equation $800 - 500 = \underline{\underline{300}}$, we can use the same nested \underline command to double underline the number "300".

## Using the ulem Package

Alternatively, if the ulem package is used in your LaTeX document, achieving double underlining becomes even simpler. With the ulem package, you can shorten the code as follows:

Revenue - Costs = \uuline{Profit}

This reduces the code needed to create double underlines, providing a more concise and efficient way to enhance text formatting in LaTeX documents.

## Example

In LaTeX, you can underline text to give it emphasis. The ulem package extends LaTeX's underlining capabilities, allowing for more versatile and customizable underlining options. Below is an example illustrating how to use the ulem package to underline text in a LaTeX document.

Suppose we want to emphasize the term "Profit" in an equation representing revenue and costs. We can achieve this using the LaTeX \underline command.

\documentclass{article}
\usepackage{ulem}

\begin{document}
Revenue - Costs = \underline{\underline{Profit}}
\end{document}


Alternatively, with the ulem package, we can use the \uuline command, which provides a more concise way to achieve double underlining:

\documentclass{article}
\usepackage{ulem}

\begin{document}
Revenue - Costs = \uuline{Profit}
\end{document}


Both commands produce the same result: underlining the term "Profit" in the equation "Revenue - Costs". The ulem package offers flexibility and convenience in underlining text, making it a valuable tool for document formatting in LaTeX.