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:
font-sizes.tex
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio

Using Font Sizes

using-sizes.tex

Font Families

LaTeX has three main font families:
font-families.tex

Setting Default Font Family

default-family.tex

Font Shapes and Series

Font Shapes

font-shapes.tex

Font Series (Weight)

font-weight.tex

Color Text

color-text.tex

Color Models

color-models.tex

Text Alignment

alignment.tex

Special Text Effects

Underline Variations

underline-variations.tex

Text Decorations

decorations.tex

Text Boxes and Frames

text-boxes.tex

Advanced Formatting

Rotating Text

rotating-text.tex

Scaling Text

scaling-text.tex

Custom Commands for Consistent Formatting

custom-commands.tex

Multilingual Text

multilingual.tex

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


Next: Learn about Paragraph spacing to control the layout and flow of your documents.