Written and maintained by CASRAI Editorial Board
Published
On this page
Learning LaTeX is the process of adopting a programmatic, plain-text typesetting system to prepare structured academic manuscripts, mathematical formulas, and scholarly bibliographies with automated typographic consistency. Researchers write structured markup in .tex files, which a TeX engine such as pdfTeX, XeTeX, or LuaTeX compiles directly into publication-ready PDF documents. Unlike visual word processors where formatting is manually applied to individual paragraphs, LaTeX separates content from presentation, enforcing global typographic rules, precise mathematical alignment, automated cross-referencing, and standardized citation styling across research publications.
What LaTeX is used for in research
In academic research, LaTeX serves as the standard publishing pipeline across mathematics, computer science, physics, economics, and engineering disciplines. Scholars rely on LaTeX to produce journal articles, conference papers, technical reports, and doctoral dissertations requiring strict typographic precision. Because LaTeX documents are authored in plain text, they integrate with Git version control, enabling research teams to track revisions, review pull requests, and resolve co-authoring conflicts without binary file corruption.
The primary capabilities of LaTeX in research communication include:
- Automated Document Hierarchy: LaTeX enforces semantic design through classes like
article,report, andbook, alongside publisher classes likeIEEEtranandacmart. Researchers specify structural units usingsection{}andsubsection{}, while the compiler automatically manages numbering, running headers, margin geometry, and tables of contents. Authors configuring structural classes can review the guide to structuring a LaTeX document. - Mathematical Typography: Built on Donald Knuth’s TeX engine and extended by the American Mathematical Society (AMS), LaTeX provides the standard for scientific formulas. Through packages like
amsmathandamssymb, researchers format multiline equations, matrices, and symbols with automated spacing and delimiter scaling. Detailed formatting patterns are available in the guide to AMS-LaTeX math environments. - Dynamic Cross-Referencing: Research papers incorporate dozens of equations, figures, tables, and sections. LaTeX automates numbering through two commands:
label{key}assigns a semantic identifier, andref{key}oreqref{key}prints the resolved target number, updating references automatically across the manuscript. - Bibliographic Citation Management: Using BibTeX or Biber engines, LaTeX decouples citation entries from narrative text. References are organized in
.bibtext files. Usingcite{key}, the compiler formats citations and reference lists according to publisher style rules.
Modern empirical workflows also link statistical computation directly to LaTeX. Analysts generate dynamic tables and vector plots in R, Python, and Julia, exporting outputs directly as LaTeX tabular code or vector graphics that embed into manuscripts.
How to install or access LaTeX
Researchers access LaTeX through two primary deployment models: cloud-hosted browser platforms requiring zero local configuration, or installed local distributions executing natively on workstations. Official TeX distributions bundle compiler engines (pdfTeX, XeTeX, LuaTeX), standard macro packages, fonts, and package managers required to build PDF documents.
Researchers select from the following verified access routes based on institutional policies and computational requirements:
- Cloud Platforms (Overleaf): For collaborative authoring, cloud platforms like Overleaf provide a pre-configured browser environment running on TeX Live. Overleaf offers dual-pane editing, real-time error parsing, Git synchronization, and multi-user co-authoring without local installation. Research groups can coordinate manuscript authoring using the workflow documented in collaborative LaTeX writing with Overleaf.
- TeX Live (Linux, Windows, macOS): Maintained by the TeX Users Group (TUG), TeX Live is the international cross-platform reference distribution. On Linux, TeX Live is installed through distribution package managers (e.g.,
apt-get install texlive-fullon Ubuntu/Debian) or via TUG’s upstreaminstall-tlscript. TeX Live provides thetlmgrpackage manager to update packages and query CTAN repositories. The full distribution requires approximately 8 gigabytes of disk storage. - MacTeX (macOS): For macOS workstations, TUG packages TeX Live into a native installer designated MacTeX. MacTeX bundles the complete TeX Live suite alongside macOS utilities such as TeXShop, BibDesk, and the TeX Live Utility application.
- MiKTeX (Windows, macOS, Linux): Created by Christian Schenk, MiKTeX is an open-source distribution featuring on-the-fly package installation. Rather than downloading an 8-gigabyte archive upfront, MiKTeX installs a core engine (~250 megabytes) and automatically downloads missing packages from CTAN mirrors during compilation. It includes the MiKTeX Console for managing updates.
- Local Front-End Editors: Local distributions require an external editor for drafting
.texfiles. Common choices include TeXStudio, TeXworks, and Visual Studio Code with the LaTeX Workshop extension, providing syntax highlighting, macro autocompletion, integrated PDF viewers, and SyncTeX navigation.
When selecting an installation pathway, researchers must weigh collaboration convenience against data governance. Projects involving export-controlled data or confidential clinical datasets often mandate local, air-gapped TeX installations to satisfy data privacy compliance.
How to compile a research paper in LaTeX step by step
Preparing a scholarly manuscript in LaTeX follows a systematic progression from source file configuration to multi-pass compilation. Follow these six numbered steps to construct and build a research paper.
- Configure Document Class and Preamble: In a project directory, create a root source file named
main.tex. Declare the document class and load essential packages:documentclass[11pt,a4paper]{article} usepackage[utf8]{inputenc} usepackage[T1]{fontenc} usepackage{amsmath,amssymb} usepackage{graphicx,booktabs,microtype,hyperref}The preamble defines global formatting parameters. Packages like
graphicxmanage figure inclusion,booktabsprovides professional horizontal table rules, andhyperrefadds clickable hyperlinks throughout the generated PDF. - Declare Document Metadata and Abstract: Below the preamble, specify title and author metadata, then open the document body environment:
title{Empirical Evaluation of Latency in Distributed Networks} author{Jane Doe, Ph.D.thanks{Department of Computer Science} and John Smith, M.Sc.} date{today} begin{document} maketitle begin{abstract} This paper investigates throughput optimization in distributed networks under variable load conditions. end{abstract}The
maketitlecommand generates the formal title block and author affiliations according to the active class style. - Structure Manuscript Sections: Organize narrative content into logical hierarchical sections, separating paragraphs with a blank line:
section{Introduction} Distributed computational systems require robust synchronization protocols. Recent evaluations reveal throughput degradation under heavy contention. subsection{Experimental Setup} Our testbed consists of sixteen interconnected cluster nodes running synchronized clock daemons. - Incorporate Numbered Equations and Floats: Insert mathematical models and structured data tables using numbered environments:
begin{equation}label{eq:throughput} T(n) = sum_{i=1}^{n} frac{alpha_i cdot C}{Delta t_i} end{equation} As defined in Equation~eqref{eq:throughput}, $T(n)$ denotes total network throughput across $n$ nodes. begin{table}[htbp] centering caption{Benchmark Results Across Evaluated Clusters} label{tab:benchmarks} begin{tabular}{lrrr} toprule Cluster ID & Nodes & Latency (ms) & Throughput (MB/s) \ midrule Alpha & 4 & 12.4 & 450.2 \ Beta & 8 & 18.1 & 820.7 \ bottomrule end{tabular} end{table}Floating environments calculate optimal page placement automatically, avoiding awkward whitespace.
- Attach Bibliographic Database and Inline Citations: Create a bibliography database named
references.bibin the project directory with structured BibTeX records:@article{knuth1984literate, title={Literate Programming}, author={Knuth, Donald E.}, journal={The Computer Journal}, volume={27}, number={2}, pages={97--111}, year={1984} }Cite the entry in your narrative with
cite{knuth1984literate}, and declare the bibliography style and database before closing the document:bibliographystyle{plain} bibliography{references} end{document} - Execute the Multi-Pass Compilation Sequence: In your terminal or editor command prompt, run the four-stage compilation pipeline:
pdflatex main.tex bibtex main pdflatex main.tex pdflatex main.texThe initial
pdflatexpass logs citation keys and labels intomain.aux. Thebibtexpass extracts entries fromreferences.biband generates formatted bibliography code inmain.bbl. The secondpdflatexpass merges references into the text, and the final pass updates all cross-reference numbers and table of contents entries, yielding a fully resolvedmain.pdf. When working with OpenType system fonts and direct Unicode input, researchers often replace the compiler engine with LuaLaTeX compilation pipelines.
How to read the output
A LaTeX compilation pass generates auxiliary data files alongside terminal and log messages. Interpreting these artifacts correctly allows researchers to confirm document integrity, ensure citation resolution, and diagnose compiler warnings. The compiler writes intermediate calculations into auxiliary files before rendering the final PDF.
A typical compilation cycle creates the following files in the project directory:
- Target Document (
.pdf): The final compiled output containing vector text, embedded font glyphs, vector figures, and clickable cross-reference links. - Execution Log (
.log): A complete text record detailing engine versions, loaded packages (.sty) and classes (.cls), font metrics, line-numbered warning messages, and exact error locations. - Auxiliary File (
.aux): An intermediate plain-text state file written on every pass. It records mappings between semantic keys and numerical values for sections, equations, tables, figures, and requested citation keys. - TOC and List Files (
.toc,.lof,.lot): Plain-text files storing section headings, figure captions, table titles, and page numbers for rendering navigation lists. - Bibliography Files (
.bbland.blg): The.bblfile contains formatted bibliography entries compiled by BibTeX or Biber. The.blgfile records the bibliography engine run log, noting parsed database records or syntax faults in.bibfiles. - SyncTeX Index (
.synctex.gz): A compressed map created when SyncTeX is enabled, linking source code line numbers to geometric coordinates in the compiled PDF for bidirectional editor navigation.
When reviewing compiler diagnostics on the console or in .log files, researchers must distinguish between three message tiers:
- Fatal Errors: Marked by an exclamation point (e.g.,
! Undefined control sequence). Fatal errors halt compilation at the indicated source line, prompting for user action or aborting scripts with a non-zero exit code. - Compiler Warnings: Prefixed with
LaTeX Warning:. Warnings indicate non-fatal issues where PDF generation succeeds, but structural discrepancies remain (such as undefined citations or altered label numbers requiring another pass). - Box Notifications: Designated as
Overfull hboxorUnderfull hbox. An overfull horizontal box indicates that text extends beyond the column margin, while an underfull box indicates widened inter-word spacing.
As detailed in the data table below, different typesetting engines manage auxiliary generation and output rendering through specialized binary pipelines, reflecting differences in native font handling and scriptability.
Troubleshooting LaTeX
While compiler error messages can seem cryptic, most compilation issues stem from recurring syntax errors, unescaped characters, missing packages, or desynchronized auxiliary files. Following a structured protocol resolves them quickly.
Here are six common LaTeX failure modes, their mechanical causes, and verified solutions:
- 1. Missing Delimiter (
! Missing $ inserted):- Cause: A reserved math command or character (such as
_,^,alpha, orfrac) was encountered in text mode, or an inline math delimiter was left unclosed before a paragraph break. - Fix: Wrap mathematical expressions in math delimiters (
$x_i$or(x_i)). If the character represents literal text, escape it with a backslash:data_table.
- Cause: A reserved math command or character (such as
- 2. Undefined Command (
! Undefined control sequence):- Cause: The compiler encountered an unrecognized macro, caused by a typographical error or omitting the required package in the preamble (e.g., using
toprulewithoutusepackage{booktabs}). - Fix: Check the line number in the
.logfile, verify macro spelling against official documentation, and declare missingusepackage{}statements in the preamble.
- Cause: The compiler encountered an unrecognized macro, caused by a typographical error or omitting the required package in the preamble (e.g., using
- 3. Missing Package File (
! LaTeX Error: File 'name.sty' not found):- Cause: The preamble requests a package whose style file is not installed in the local TeX distribution tree.
- Fix: In TeX Live, install the package via terminal using
tlmgr install name. In MiKTeX, open MiKTeX Console to install the package or enable automatic on-the-fly downloads. In Overleaf, verify the package name spelling.
- 4. Structural List Error (
! LaTeX Error: Something's wrong--perhaps a missing item):- Cause: Content was placed inside a list environment (
itemize,enumerate) before declaring anitem, or a list environment was left empty or incorrectly closed. - Fix: Ensure every list entry begins with an
itemcommand and check that opening and closing environment tags are properly paired.
- Cause: Content was placed inside a list environment (
- 5. Margin Protrusion (
Overfull hbox (X pt too wide)):- Cause: A long word, URL, or wide equation cannot be broken within column margins without violating spacing rules, causing text to spill into the margin.
- Fix: Add discretionary hyphenation points using
-, enclose long URLs inurl{}usinghyperref, or loadusepackage{microtype}to enable character protrusion.
- 6. Unresolved Citations or References (
[?]or(??)in PDF):- Cause: The auxiliary files are desynchronized or missing due to incomplete multi-pass compilation.
- Fix: Run the full build sequence:
pdflatex,bibtex(orbiber), then twopdflatexpasses. If references remain unresolved, delete intermediate auxiliary files (.aux,.bbl,.blg) and recompile cleanly.
Free alternatives to LaTeX
While LaTeX remains the standard in mathematical, computational, and physical sciences, researchers have several viable free and open-source alternatives. Modern tools offer streamlined markup, faster compilation, and integrated computational notebooks. Research teams must evaluate each alternative against collaborative needs, equation complexity, and publisher submission standards.
The following table provides an objective comparison of free alternatives to LaTeX, evaluating their core architectures, equation formatting, learning curves, and academic publishing support:
| Alternative Tool | Core Architecture | Mathematical Formatting | Learning Curve | Academic Publishing Adoption |
|---|---|---|---|---|
| Typst | Rust-based compiler with instant incremental rendering and code-like scripting syntax | Native math syntax with modern notation and instant preview rendering | Gentle to moderate; clean markup without TeX macro expansion quirks | Growing in computer science preprints; expanding journal templates |
| Markdown with Pandoc | Lightweight plain-text markup converted into multiple outputs via Haskell AST engine | MathJax or TeX math delimiters compiled to PDF via background TeX or typst engines | Very gentle; minimal syntax overhead for rapid drafting | Broad adoption for notes; requires filters for complex journal styles |
| Quarto | Scientific publishing system orchestrating computational code (R, Python, Julia) and Pandoc | Full LaTeX math syntax support with integrated cross-referencing and figure numbering | Moderate; combines Markdown syntax with computational notebook execution | High across data science and economics; exports native journal LaTeX |
| LyX | Visual WYSIWYM (What You See Is What You Mean) GUI built on top of native TeX engines | Interactive graphical equation editor backed directly by LaTeX math engine | Gentle; familiar word-processor interface backed by structural document rules | Moderate; exports .tex files, though source editing is sometimes needed |
| LibreOffice Writer | Standalone desktop WYSIWYG word processor using open-standard OpenDocument formats | Built-in Math formula editor; supports MathML and external citation plugins like Zotero | Very gentle; conventional commercial office suite interface | Common in humanities; less adopted in heavy mathematics |
For data-intensive empirical projects, tools like Quarto and Markdown with Pandoc generate statistical tables and plots directly from code. However, when submitting manuscripts in mathematics and computer science, native LaTeX remains standard due to publisher class requirements and automated TeX Live pipelines.
Frequently asked questions
How long does it take to learn LaTeX?
A beginner can learn fundamental LaTeX operations—including basic document setup, sectioning, text formatting, and simple mathematical equations—in approximately 30 minutes to two hours using interactive tutorials or cloud platforms. Developing fluency in advanced manuscript preparation, such as custom preambles, complex tables, BibTeX database curation, and macro debugging, typically takes two to four weeks of regular writing during an active research project.
What is the best way to start learning LaTeX?
The most effective strategy is to draft a real document immediately rather than memorizing macro lists. Begin by creating an account on a cloud platform like Overleaf or working through lessons on LearnLaTeX.org, avoiding local software setup hurdles. Select a standard template (such as a lab report or article draft) and practice converting an existing document into LaTeX, focusing sequentially on sections, equations, tables, and bibliographic citations.
Do I need to install anything to use LaTeX?
No, local installation is not required to use LaTeX. Researchers can write, collaborate on, and compile complete academic manuscripts within a web browser using cloud-hosted environments like Overleaf, which manage pre-configured TeX Live distributions on cloud servers. However, installing a local distribution like TeX Live, MacTeX, or MiKTeX remains beneficial for offline drafting, air-gapped data workflows, and compiling large documents without cloud limits.
What are the best free resources to learn LaTeX?
The top free resources for learning LaTeX include LearnLaTeX.org (an interactive tutorial built by LaTeX Project team members), the Overleaf Documentation Center (featuring a 30-minute introductory guide and detailed package tutorials), the LaTeX Wikibook (a comprehensive reference manual), the TeX Users Group (TUG) beginner documentation, and the TeX-LaTeX Stack Exchange forum for compiler error solutions.
Why should I learn LaTeX instead of using Microsoft Word or Google Docs?
Researchers choose LaTeX over visual word processors for its superior mathematical typography, stability when compiling large documents, automated citation and cross-reference management, and strict separation of content from styling. Furthermore, because LaTeX files are plain text, they integrate seamlessly with Git version control, support automated table generation from statistical scripts, and fulfill mandatory submission standards for leading mathematical and computational journals.
Sources
- The LaTeX Project: Get LaTeX – Mac OS, Windows, Linux, checked 2026-11-19
- The LaTeX Project: LaTeX Documentation, checked 2026-11-19
- TeX Users Group: TeX Live – TeX Users Group, checked 2026-11-19
- TeX Users Group: Getting started with TeX, LaTeX, and friends – TeX Users Group, checked 2026-11-19
- MiKTeX Project: About MiKTeX, checked 2026-11-19
- LearnLaTeX.org: Learn LaTeX online for free in beginner friendly lessons | learnlatex.org, checked 2026-11-19
- Overleaf: Learn LaTeX in 30 minutes – Overleaf, Online LaTeX Editor, checked 2026-11-19
- New Mexico Tech Library: LaTeX Resources – Learning LaTeX – Instruction and Information for the Basics of LaTeX, checked 2026-11-19
Data: Comparison of Academic Typesetting Engines and Platforms
Comparative specifications of primary TeX typesetting engines and execution platforms for academic research, detailing Unicode font handling, bibliography backends, microtypography support, and compilation workflows compiled from official TeX distribution documentation.
Period covered: 2026. Coverage: Global.
| Platform or Engine | Primary Execution Model | Native Unicode and Font Spec | Primary Bibliography Backend | Microtypography Support | Primary Output Format |
|---|---|---|---|---|---|
| pdfTeX | Local command-line executable (pdftex/pdflatex) | Limited 8-bit font encodings requiring specialized font packages (T1) | BibTeX processing ASCII and 8-bit bibliographic database records | Full character protrusion and font expansion supported | Direct PDF or legacy DVI |
| XeTeX | Local command-line executable (xelatex) | Full native OpenType and TrueType system font loading via fontspec | BibTeX or Biber supporting UTF-8 encoded bibliographic records | Character protrusion supported; font expansion limited | Direct PDF via intermediate XDV stream |
| LuaTeX | Local command-line executable (lualatex) | Full native OpenType and TrueType font loading with embedded Lua scriptability | Biber backend supporting full biblatex Unicode bibliographic management | Full character protrusion and font expansion supported | Direct PDF |
| MiKTeX | Local desktop distribution with dynamic on-the-fly package installation | Engine-dependent; bundles complete pdfTeX, XeTeX, and LuaTeX binary suites | BibTeX and Biber engines bundled in default installation | Engine-dependent; supports microtype across compliant engines | Direct PDF |
| Overleaf | Cloud-hosted browser platform backed by containerized TeX Live distributions | Engine-selectable across pdfLaTeX, XeLaTeX, and LuaLaTeX project settings | Automated background execution of BibTeX and Biber engines | Engine-dependent; matches underlying TeX Live compiler capabilities | Direct PDF |
Sources
- Get LaTeX - Mac OS, Windows, Linux (accessed 2026-11-19)
- TeX Live - TeX Users Group (accessed 2026-11-19)
- About MiKTeX (accessed 2026-11-19)
- Learn LaTeX in 30 minutes - Overleaf, Online LaTeX Editor (accessed 2026-11-19)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







