Skip to main content
Beyond the basics of bold and italic, LaTeX offers extensive text formatting capabilities. This guide covers font sizes, families, shapes, colors, and advanced formatting options.
Quick tip: LaTeX separates content from presentation. Define your formatting once and apply it consistently throughout your document.Related topics: Font selection | Paragraph formatting | Mathematics formatting | Document classes

Font Sizes

LaTeX provides ten standard font size commands:

Using Font Sizes

Font Families

LaTeX has three main font families:

Setting Default Font Family

Font Shapes and Series

Font Shapes

Font Series (Weight)

Color Text

Color Models

Text Alignment

Special Text Effects

Underline Variations

Text Decorations

Text Boxes and Frames

Advanced Formatting

Rotating Text

Scaling Text

Custom Commands for Consistent Formatting

Multilingual Text

How to Write Ordinals Like 1st, 2nd and 3rd

Type the suffix as normal text — 21st March — for ordinary prose. LaTeX needs no special command, and plain text is what most style guides expect. For a raised suffix, \textsuperscript{} does the job: 2\textsuperscript{nd} renders the “nd” above the baseline. Do not use maths mode ($2^{nd}$) for this; it sets the suffix in a maths italic font, which is wrong for text and spaces badly. If your document uses many ordinals, define a command once so the style stays consistent: \newcommand{\ordinal}[2]{#1\textsuperscript{#2}} then write \ordinal{2}{nd}. Note that superscripted ordinals are a typographic convention rather than a rule — most modern style guides prefer plain “2nd”.

Best Practices

Formatting guidelines:
  1. Semantic markup: Use \emph{} for emphasis, not just \textit{}
  2. Consistency: Define custom commands for repeated formatting
  3. Avoid hardcoding: Use relative sizes (em, ex) not absolute (pt)
  4. Color sparingly: Too many colors reduce professionalism
  5. Test output: Check how formatting appears in final PDF

Common Pitfalls

Avoid these mistakes:
  1. Over-formatting: Don’t use too many different styles
  2. Manual spacing: Let LaTeX handle spacing automatically
  3. Absolute sizes: Use relative sizes for better scaling
  4. Direct formatting: Define styles once, reuse throughout
  5. Poor contrast: Ensure colored text is readable

Quick Reference


Headers & Footers

Customize page headers and footers

Page Numbering

Control page number styles and placement

Multiple Columns

Create multi-column layouts

Lengths & Units

Master LaTeX measurement units

Counters & Numbering

Customize automatic numbering

Code Listings

Format source code with syntax highlighting
Next: Learn about Paragraph spacing to control the layout and flow of your documents.