Skip to main content
v2026.11,986 entries · CC-BY 4.0

Learning LaTeX for Research: Tools, Workflow, and Syntax

A step-by-step guide to learning LaTeX for researchers, covering local and cloud setup, document structure, compilation pipelines, and error debugging.

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, and book, alongside publisher classes like IEEEtran and acmart. Researchers specify structural units using section{} and subsection{}, 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 amsmath and amssymb, 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, and ref{key} or eqref{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 .bib text files. Using cite{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-full on Ubuntu/Debian) or via TUG’s upstream install-tl script. TeX Live provides the tlmgr package 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 .tex files. 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.

  1. 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 graphicx manage figure inclusion, booktabs provides professional horizontal table rules, and hyperref adds clickable hyperlinks throughout the generated PDF.

  2. 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 maketitle command generates the formal title block and author affiliations according to the active class style.

  3. 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.
  4. 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.

  5. Attach Bibliographic Database and Inline Citations: Create a bibliography database named references.bib in 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}
  6. 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.tex

    The initial pdflatex pass logs citation keys and labels into main.aux. The bibtex pass extracts entries from references.bib and generates formatted bibliography code in main.bbl. The second pdflatex pass merges references into the text, and the final pass updates all cross-reference numbers and table of contents entries, yielding a fully resolved main.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 (.bbl and .blg): The .bbl file contains formatted bibliography entries compiled by BibTeX or Biber. The .blg file records the bibliography engine run log, noting parsed database records or syntax faults in .bib files.
  • 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:

  1. 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.
  2. 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).
  3. Box Notifications: Designated as Overfull hbox or Underfull 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, or frac) 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.
  • 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 toprule without usepackage{booktabs}).
    • Fix: Check the line number in the .log file, verify macro spelling against official documentation, and declare missing usepackage{} statements in the preamble.
  • 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 an item, or a list environment was left empty or incorrectly closed.
    • Fix: Ensure every list entry begins with an item command and check that opening and closing environment tags are properly paired.
  • 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 in url{} using hyperref, or load usepackage{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 (or biber), then two pdflatex passes. 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

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.

Comparison of Academic Typesetting Engines and Platforms
Platform or EnginePrimary Execution ModelNative Unicode and Font SpecPrimary Bibliography BackendMicrotypography SupportPrimary Output Format
pdfTeXLocal command-line executable (pdftex/pdflatex)Limited 8-bit font encodings requiring specialized font packages (T1)BibTeX processing ASCII and 8-bit bibliographic database recordsFull character protrusion and font expansion supportedDirect PDF or legacy DVI
XeTeXLocal command-line executable (xelatex)Full native OpenType and TrueType system font loading via fontspecBibTeX or Biber supporting UTF-8 encoded bibliographic recordsCharacter protrusion supported; font expansion limitedDirect PDF via intermediate XDV stream
LuaTeXLocal command-line executable (lualatex)Full native OpenType and TrueType font loading with embedded Lua scriptabilityBiber backend supporting full biblatex Unicode bibliographic managementFull character protrusion and font expansion supportedDirect PDF
MiKTeXLocal desktop distribution with dynamic on-the-fly package installationEngine-dependent; bundles complete pdfTeX, XeTeX, and LuaTeX binary suitesBibTeX and Biber engines bundled in default installationEngine-dependent; supports microtype across compliant enginesDirect PDF
OverleafCloud-hosted browser platform backed by containerized TeX Live distributionsEngine-selectable across pdfLaTeX, XeLaTeX, and LuaLaTeX project settingsAutomated background execution of BibTeX and Biber enginesEngine-dependent; matches underlying TeX Live compiler capabilitiesDirect PDF

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about Learning LaTeX for Research: Tools, Workflow, and Syntax

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →