Underline Text in LaTeX
Use \underline{} to underline text in LaTeX.
Quick Answer
latex
This is \underline{underlined text} in LaTeX.The \underline Command
\underline{} is the built-in LaTeX command for underlining. It works in both text mode and math mode with no additional packages.
latex
\documentclass{article}
\begin{document}
This is text \underline{and parts of it} are underlined.
\end{document}Note: The built-in
\underline does not break across line endings. If your underlined text is long, it will overflow instead of wrapping. Use the ulem package for line-breaking underlines.Writing your thesis in LaTeX?
MonsterWriter's LaTeX Workspace gives you real-time PDF preview with no compile limits — at a fraction of Overleaf's price. Works just like Overleaf, costs 11× less.
Try MonsterWriter freeLine-Breaking Underlines with ulem
The ulem package provides underlines that wrap across lines, plus dashed and dotted variants.
latex
\usepackage{ulem} % in preamble
\uline{This underlined text will break across lines automatically.}
\dashuline{Dashed underline}
\dotuline{Dotted underline}Important: ulem redefines \emph to underline instead of italicise. Add \usepackage[normalem]{ulem} to prevent this.
Underline in Math Mode
latex
\begin{equation}
\underline{x + y} = z
\end{equation}Combining Underline with Bold or Italic
latex
\textbf{\underline{Bold and underlined}}
\textit{\underline{Italic and underlined}}Related Topics
More LaTeX Topics
Bold TextItalic TextStrikethroughFont SizeText ColorText AlignmentHyperlinksSectionsTable of ContentsNew PageNew LineMarginsLine SpacingPage NumbersHeaders & FootersMinipageTablesFigures & ImagesListsEquationsFractionsSquare RootSubscript & SuperscriptSummationIntegralMatrixGreek LettersArrowsTilde (~)Delta (δ, Δ)Hash (#)BibliographyCross-ReferencesFootnotes