LaTeX Basics

10. Document Setup

Geometry, fonts, and global typesetting controls.

6 min read Share

Modern LaTeX allows for fine-grained control over your document layout and typography.

Level 1: Page Geometry

The geometry package is the preferred way to set margins and paper size.

LaTeX
\usepackage[
  a4paper,
  left=2cm,
  right=2cm,
  top=3cm,
  bottom=3cm
]{geometry}

Level 2: Typography & Fonts

Set up modern font encoding and load specialized fonts.

LaTeX
\usepackage[T1]{fontenc} % Better font encoding
\usepackage{courier}      % Set monospaced font
\usepackage{helvet}       % Set sans-serif font
\renewcommand{\familydefault}{\sfdefault} % Make entire doc Sans-Serif

Level 3: Global Formatting

Control paragraph indentation, line spacing, and table of contents depth.

Line Spacing
LaTeX
\usepackage{setspace}
\onehalfspacing
Paragraphs
LaTeX
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}
Standard Academic Defaults
TeXposit projects default to 11pt article class with standard LaTeX margins. If you are writing a thesis, consider switching to `report` or `book` class for chapters.