Different types of underline in LaTeX

In this tutorial, I will show you how to get different types of underlining under text in LaTeX.

In LaTeX there is a default command \underline{} to get underlining under a text.

\documentclass{article}
\begin{document} 

\underline{Underlined text}

\textbf{\underline{Bold underlined text}}

\textit{\underline{Italized underlined text}}

\textsc{\underline{Small to caps underlined text}}

\end{document}

Output:

underlined text.

 

Underline which allows linebreaks

The \unerline{} command does not allow linebreak in the document. If you want your text to be underlined and line breaks are also possible, you can use the \ul command provided by the soul package. The \ul{} command allows linebreak in the document.

\documentclass{article}
\usepackage{soul}
\begin{document} 

This is a random sentence.\underline{This Underlined sentence will not have a line break}

This is a random sentence.\ul{This Underlined sentence will have a line break ability}

\end{document}

Output:

underlined text with line break.

Double Underline in LaTeX

To get double underline you can use the \underline command twice or you can use the \uuline{} command provided by the ulem package.

\documentclass{article}
\usepackage{ulem}
\begin{document} 

\underline{\underline{Double Underlined sentence}}

\uuline{Double underlined sentence}

\end{document}

Output:

double underlined sentence.

Wavy Underline in LaTeX

The ulem package also provides the \uwave{} command to get a wavy underline under a text.

\documentclass{article}
\usepackage{ulem}
\begin{document} 

\uwave{Wavy underlined sentence}

\end{document}

Output:

wavy underlined text.

Dashed and dotted underline in LaTeX

The ulem package provides \dashuline{} command to get dashed underline and \dotuline{} to get dotted underline under a text in a LaTeX document.

\documentclass{article}
\usepackage{ulem}
\begin{document} 

\dashuline{Dashed underlined sentence}

\dotuline{Dotted underlined sentence}

\end{document}

Output:

dashed and dotted underline.

Leave a Reply

Your email address will not be published. Required fields are marked *