Text Formatting in LaTeX
Learn how to format text in LaTeX, including bold, italics, underlining, and font sizing.
Formatting text in LaTeX is done using specific commands rather than visual buttons. This ensures consistency across your entire document.
Basic Emphasis
The three most common text formatting commands are bold, italics, and underlining.
\textbf{This text is bold.}
\textit{This text is italicized.}
\underline{This text is underlined.}You can also nest these commands to combine formatting:
\textbf{\textit{This text is bold and italicized.}}Emphasize Command (\emph)
While \textit explicitly forces italics, LaTeX provides a smarter command called \emph.
If you use \emph inside normal text, it italicizes it. However, if you use \emph inside already italicized text, it will convert it back to normal roman text to ensure it stands out.
\textit{This is a quote with an \emph{important} word inside.}Font Sizes
LaTeX handles font sizing dynamically based on your document class's base font size (usually 10pt, 11pt, or 12pt). Instead of choosing a specific point size (like "14pt"), you use semantic sizing commands.
These commands are declarations, meaning they affect all text following them until the current group (enclosed in {}) ends.
{\tiny Smallest text}
{\scriptsize Very small text}
{\footnotesize Footnote size}
{\small Small text}
{\normalsize Default text size}
{\large Large text}
{\Large Larger text}
{\LARGE Even larger text}
{\huge Huge text}
{\Huge Maximum size text}Always wrap your size commands in curly braces (e.g., {\Large My Title}). If you forget the braces, the rest of your entire document will render in the larger font size!
Text Alignment
By default, LaTeX fully justifies text (aligned to both the left and right margins). To change alignment, use the following environments:
Center Alignment:
\begin{center}
This text is perfectly centered.
\end{center}Left Alignment (Ragged Right):
\begin{flushleft}
This text aligns to the left margin.
\end{flushleft}Right Alignment (Ragged Left):
\begin{flushright}
This text aligns to the right margin.
\end{flushright}