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
Common Pitfalls
Quick Reference
Related Formatting Guides
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.
