Written and maintained by CASRAI Editorial Board
Last updated
Reader task: a researcher who needs to set up a LaTeX document for a manuscript and understand what each part of the file does. A LaTeX document is a plain-text .tex file with a preamble (class, packages, title data) followed by a body between begin{document} and end{document}, which you compile to produce the typeset output.
How do I write a document in LaTeX?
Write a .tex file that declares a document class, optionally loads packages, then places your text between begin{document} and end{document}. The LaTeX Project describes LaTeX as a document preparation system for high-quality typesetting; Overleaf’s documentation gives the same minimal structure (sources below, read 2026-11-07). Compiling the file, for example with the Recompile button in Overleaf, produces the output.
The minimal file
documentclass{article}
begin{document}
Hello, world.
end{document}
documentclass declares the class; the text of the document sits between the begin and end lines.
Structure of a LaTeX manuscript file
- Class.
documentclass[12pt, letterpaper]{article}. Options go in square brackets. Overleaf’s documentation names the classes article, book, report and letter. - Packages.
usepackage{graphicx},usepackage{amsmath},usepackage{geometry}and so on, one line per package, with optional settings in square brackets. Everything beforebegin{document}is the preamble. - Title data.
title,authoranddatein the preamble.thanksadds a footnote to the author line anddate{today}inserts the compile date. - Body. After
begin{document}, callmaketitleto print the title block, add anabstractenvironment if the class and journal expect one, then the sections. - Sections.
section,subsection,subsubsection,paragraphandsubparagraph;partandchapterexist only in book and report. A star (for examplesection*{...}) removes numbering.tableofcontentsprints a contents list. - Bibliography. See our guide to the thebibliography environment in LaTeX and the walk-through for adding citations and a bibliography in Overleaf.
An annotated manuscript skeleton
documentclass[12pt, letterpaper]{article} % class + options
usepackage{graphicx} % figures
usepackage{amsmath} % equations
usepackage{geometry} % page margins
title{Working title}
author{First Author thanks{Funded by ...}}
date{today}
begin{document}
maketitle
begin{abstract}
...
end{abstract}
section{Introduction}
input{sections/methods} % pulled in without a page break
include{sections/results} % starts on a new page
end{document}
The file names after input and include are illustrative. For figures, see including graphics in LaTeX and LaTeX figures.
Splitting a manuscript across files: input, include and includeonly
Overleaf’s guide to managing large projects (read 2026-11-07) describes three commands.
| Command | Behaviour |
|---|---|
input{file} |
Inserts the file as if typed in place. The file must not contain a preamble; no page break is added; calls can be nested. |
include{file} |
Starts a new page before the material. Cannot be nested. Give the name without the .tex extension. Each included file gets its own .aux file. |
includeonly{file1,file2} |
Placed in the preamble; only the listed files are processed. The list is comma-separated with no spaces. Page numbers and cross-references still work through the .aux files of omitted files. |
Common mistakes
- Loading a package that is not installed. A missing package file makes LaTeX stop with an error (Overleaf documentation).
- Using
chapterorpartin the article class. They are available only in book and report. - Adding
.texinsideinclude{...}. Omit the extension. - Nesting
include. It cannot be nested; useinputfor nested files. - Putting a preamble in a file pulled in by
input. The file must not contain one. - Spaces in the
includeonlylist. Use a comma-separated list with no spaces.
Checklist
- Class and options match the journal or template you are submitting to.
- Every package in
usepackageis available in your installation or project. title,author,dateset;maketitlecalled afterbegin{document}.- Section commands suit the class you chose.
- Included files named without extension; no preamble in input files.
- Compiles cleanly from a fresh build before you submit.
For collaborative editing options see LaTeX and Overleaf collaborative writing, and what Overleaf is.
FAQ
How do you pronounce LaTeX software?
The LaTeX Project’s about page gives “Lah-tech” or “Lay-tech”, to rhyme with “blech” or “Bertolt Brecht” (read 2026-11-07).
Is LaTeX difficult to learn?
Editorial view, not a measured claim: the minimal file above is short, and most difficulty comes from errors such as missing packages or misplaced commands, listed in the common mistakes section. Learning is incremental, since you can start from the minimal file and add commands as needed.
Does anyone still use LaTeX?
The tools and documentation cited here, including the LaTeX Project and Overleaf’s current guides, are actively maintained. We do not cite a usage statistic. For how it compares with word processors for manuscripts, see the comparison Google Docs vs Overleaf vs Word for manuscripts.
Sources
- The LaTeX Project, About LaTeX: latex-project.org/about, read 2026-11-07.
- Overleaf, Creating a document in LaTeX: overleaf.com/learn, read 2026-11-07.
- Overleaf, Management in a large project: overleaf.com/learn, read 2026-11-07.







