How to Write a Research Paper in LaTeX: Complete Guide, Templates & Snippets
Stop fighting broken Word margins, jumping figures, and manual citation numbers. This complete guide gives you copy-pasteable LaTeX templates, math and table snippets, bibliography workflows, and debugging fixes so you can focus on your research.
In LaTeX, you write plain text with structural commands (\section{}, \cite{}, \begin{equation}) and compile it into a typeset PDF. Start with a clean starter template, store references in a separate references.bib file, use booktabs for tables, and let cleveref handle figure and equation numbering automatically.
1. Why Write Your Research Paper in LaTeX?
If you have ever tried to move a figure two centimeters in Microsoft Word or Google Docs only to watch an entire 15-page paper explode into blank pages and misaligned captions, you already understand why academia runs on LaTeX.
LaTeX is a document preparation system built around a simple idea: separate content from formatting. Instead of dragging boxes around, you describe what each piece of text is (a title, an abstract, a section heading, a theorem, a citation), and the compiler lays out the typography, spacing, equation numbering, and bibliography according to journal-grade rules.
- Automatic numbering everywhere: Add a new equation in Section 2 or a new figure in Section 4, and every
\refand\citeacross the entire paper updates itself. - Unmatched math typesetting: Fractions, integrals, matrices, and multi-line derivations look crisp and consistent without clicking through equation menus.
- One-click style switching: Most conferences and journals (IEEE, ACM, Springer, Elsevier, NeurIPS, APA) publish official
.clstemplates. Dropping your content into a journal's template reformats the whole paper in seconds. - Plain-text reliability: Your
.texfiles are lightweight text files that never corrupt, work cleanly with Git, and make comparing revisions effortless.
2. Setting Up Your Environment: Overleaf vs. Local VS Code
Before writing a single line of LaTeX, you need two things: a TeX distribution (the compiler that turns .tex into .pdf) and an editor. You can either run both in the cloud or install them on your computer.
Option A: Overleaf (Fastest for Beginners & Co-Authors)
Overleaf is a browser-based LaTeX editor. You create a project, paste your template, and click Recompile—with no installation required. It comes preloaded with thousands of packages and lets co-authors edit the same paper simultaneously with comment threads and track changes.
Best for: Class term papers, group research projects, and anyone writing their first LaTeX paper.
Option B: Local Setup with VS Code (Fastest for Large Theses & Offline Work)
If you travel without reliable Wi-Fi, write a 100-page thesis that hits Overleaf's free compile-time limits, or want full Git integration, install LaTeX locally:
- Install a TeX distribution: Download TeX Live (Windows/Linux), MiKTeX (Windows, installs packages on demand), or MacTeX (macOS).
- Install VS Code + LaTeX Workshop: Open Visual Studio Code and install the LaTeX Workshop extension by James Yu. It gives you autocomplete, side-by-side PDF preview, SyncTeX (click PDF to jump to code), and automatic compilation on save via
latexmk. - Alternative dedicated editors: TeXstudio and TeXmaker are free, standalone desktop editors with built-in symbol palettes if you prefer not to use VS Code.
3. Recommended Research Paper Folder Structure
Keeping everything in a single giant main.tex file works for a 4-page lab report, but becomes painful by page 12. Organize your project folder like this from day one:
my-research-paper/
├── main.tex <-- Preamble, title, abstract, and \input{} calls
├── references.bib <-- All BibTeX / BibLaTeX citations
├── sections/
│ ├── 01-introduction.tex
│ ├── 02-related-work.tex
│ ├── 03-methodology.tex
│ ├── 04-results.tex
│ └── 05-conclusion.tex
├── figures/
│ ├── architecture.pdf <-- Vector diagrams (PDF/SVG)
│ └── plot-results.png <-- High-res raster charts (300+ DPI)
└── tables/
└── summary-stats.tex <-- Large tables kept out of main text
To pull a section file into main.tex, use \input{sections/01-introduction} (note that \input does not force a page break, whereas \include does—so always use \input for research paper sections).
4. Choosing the Right Document Class
The very first line of every LaTeX document is \documentclass[options]{class}. Picking the right class saves hours of manual formatting later.
| Document Class | Typical Use Case | Key Example Line |
|---|---|---|
article |
General university papers, lab reports, preprints, and custom layouts. | \documentclass[11pt,letterpaper]{article} |
IEEEtran |
Engineering, computer science, and IEEE conference/journal two-column papers. | \documentclass[conference]{IEEEtran} |
acmart |
ACM computing conferences (SIGCHI, SIGGRAPH, etc.). | \documentclass[sigconf]{acmart} |
apa7 |
Psychology, social sciences, and APA 7th edition student/manuscript papers. | \documentclass[stu]{apa7} |
elsarticle |
Elsevier journals across medicine, physics, and economics. | \documentclass[preprint,12pt]{elsarticle} |
Rule of thumb: If your professor or target venue provides a template ZIP, always use their exact .cls file rather than rebuilding margins by hand.
5. Complete Copy-Paste Research Paper Starter Template
Explore the Overleaf template library for pre‑made conference and journal layouts. You can start a new project from any template, then replace the content with your own.
To create a custom title page, add the following LaTeX commands before \begin{document}:
\maketitle
% Optional custom title page
\begin{titlepage}
\centering
{\LARGE Your Title Here}\vspace{2cm}
{\large Author Name}\\[1ex]
{\small Institution}\vfill
{\today}
\end{titlepage}
If you need a clean, modern, publication-ready academic template that compiles immediately in Overleaf or TeX Live, copy this into main.tex and create an empty references.bib file alongside it.
\documentclass[11pt,letterpaper]{article}
% --- Encoding, Fonts & Typography ---
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype} % Subtle kerning and justification polish
% --- Page Layout & Line Spacing ---
\usepackage[margin=1in]{geometry}
\usepackage{setspace}
\onehalfspacing % Use \doublespacing if your rubric requires it
% --- Math & Science ---
\usepackage{amsmath,amssymb,amsthm}
\usepackage{siunitx} % Clean numbers and units: \qty{95.4}{\percent}
% --- Figures & Tables ---
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{booktabs} % Professional horizontal rules for tables
% --- Citations & Links ---
\usepackage[backend=biber,style=apa]{biblatex} % Or style=ieee / numeric
\addbibresource{references.bib}
\usepackage[hidelinks]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref} % Load cleveref AFTER hyperref
% --- Theorem Environments ---
\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}{Definition}[section]
% --- Title & Author Metadata ---
\title{\textbf{A Clear, Descriptive Title for Your Research Paper}}
\author{
First Author\thanks{Department of Computer Science, University Name. Email: \texttt{[email protected]}} \and
Second Author\thanks{Department of Statistics, University Name.}
}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}
State your research problem, methodology, key quantitative findings, and main conclusion in 150--250 words. Keep acronyms minimal and avoid citing references inside the abstract whenever possible.
\end{abstract}
\noindent\textbf{Keywords:} academic writing, LaTeX, research methodology, reproducible science
\section{Introduction}
\label{sec:intro}
Introduce the broader problem, explain the gap in existing literature~\cite{smith2024example}, and state your thesis or research questions clearly.
\section{Related Work}
\label{sec:related}
Synthesize prior studies by theme rather than listing summaries one by one.
\section{Methodology}
\label{sec:method}
Describe your experimental setup, dataset, or theoretical framework in enough detail for another researcher to replicate.
\section{Results and Discussion}
\label{sec:results}
Present your findings objectively, referencing \cref{fig:example} and \cref{tab:metrics}, then interpret what they mean.
\section{Conclusion}
\label{sec:conclusion}
Summarize your contributions, note limitations honestly, and suggest concrete directions for future work.
\printbibliography
\end{document}
Notice the load order at the bottom of the preamble: hyperref should almost always be loaded near the end, and cleveref must be loaded after hyperref. Getting that order backwards is one of the most common causes of mysterious compiler warnings.
6. Essential LaTeX Packages Cheat Sheet
You do not need 40 packages in every paper. Stick to the reliable core below and add specialized packages only when a section actually needs them.
| Package | What It Does | Why Use It |
|---|---|---|
geometry |
Controls page margins and paper size. | Clean one-liner like [margin=1in] instead of manual offset math. |
amsmath, amssymb |
Adds align, matrices, and math symbols. |
Essential for multi-line aligned equations and Blackboard bold (\mathbb{R}). |
graphicx |
Enables \includegraphics for images/PDFs. |
Supports scaling by \linewidth so images never overflow margins. |
booktabs |
Provides \toprule, \midrule, \bottomrule. |
Produces clean academic tables without ugly vertical grid lines. |
biblatex / natbib |
Formats citations and bibliographies. | Switches between IEEE, APA, Chicago, or Nature styles in one option. |
hyperref |
Makes TOC, URLs, and citations clickable. | Standard expectation for modern PDF submissions. |
cleveref |
Smart cross-referencing via \cref{}. |
Automatically writes "Figure 2" or "Equations (1) and (2)" for you. |
siunitx |
Formats numbers, uncertainties, and SI units. | Aligns decimal columns in tables and prevents broken unit spacing. |
microtype |
Subtle character protrusion and font expansion. | Visibly reduces awkward word spacing and hyphenation in narrow columns. |
listings |
Syntax-highlighted code blocks. | Great for computer science, engineering, and reproducibility appendices. |
7. Structuring Sections, Lists, Footnotes & Cross-References
LaTeX gives you a strict hierarchy of headings. Using them consistently generates a clean PDF outline (bookmarks) and keeps your paper easy to scan:
\section{Methodology} % Top-level numbered heading (1)
\subsection{Data Collection} % Sub-heading (1.1)
\subsubsection{Inclusion Criteria} % Sub-sub-heading (1.1.1)
\paragraph{Ethical Approval.} % Bold run-in paragraph lead-in
If you want an unnumbered section (such as Acknowledgements before the bibliography), add an asterisk: \section*{Acknowledgements}.
Clean Bullet & Numbered Lists
Use itemize for bullets and enumerate for numbered steps. If you add \usepackage{enumitem}, you can tighten spacing with [noitemsep,topsep=4pt]:
\begin{enumerate}
\item Pre-process raw sensor logs to remove null readings.
\item Normalize feature vectors to zero mean and unit variance.
\item Evaluate five-fold cross-validation accuracy.
\end{enumerate}
Smart Cross-References with \label and \cref
Never hardcode numbers like "see Table 3" or "as shown in Section 2." Tag every important element with a descriptive prefix—sec:, fig:, tab:, eq:—and reference it with \cref{}:
As summarized in \cref{tab:metrics} and derived in \cref{eq:loss},
our model reduces error by \qty{14.2}{\percent} compared with the
baseline described in \cref{sec:related}.
Tip: Put a non-breaking space (~) before manual \ref{} or \cite{} calls (for example, Figure~\ref{fig:arch} or prior work~\cite{doe2025}) so LaTeX never leaves a lone number dangling at the start of a new line.
8. Writing Equations, Matrices, Theorems & Algorithms
Use single dollar signs ($E = mc^2$) for short inline math inside a sentence, and numbered environments like equation or align for standalone formulas you want to reference later.
Single Numbered Equation & Multi-Line Derivation
% Single numbered equation
\begin{equation}
\label{eq:loss}
\mathcal{L}(\theta) = -\frac{1}{N} \sum_{i=1}^{N} \left[ y_i \log(\hat{y}_i) + (1 - y_i)\log(1 - \hat{y}_i) \right]
\end{equation}
% Multi-line aligned derivation (use & to mark alignment points)
\begin{align}
f(x) &= (x + a)^2 \nonumber \\
&= x^2 + 2ax + a^2 \label{eq:expanded}
\end{align}
Notice \nonumber suppresses the equation number on the first line while keeping a clean number on the final result. If you do not want numbers on any line, use align*.
Matrices and Piecewise Functions
% 2x2 Matrix and piecewise cases
\[
A = \begin{bmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{bmatrix},
\qquad
\text{ReLU}(x) = \begin{cases}
x, & \text{if } x > 0 \\
0, & \text{otherwise}
\end{cases}
\]
Theorems, Lemmas & Proofs
With amsthm loaded and \newtheorem{theorem}{Theorem}[section] in your preamble, writing formal proofs takes just a few lines:
\begin{theorem}[Convergence Bound]
\label{thm:convergence}
For any step size $\eta \in (0, 1/L)$, gradient descent satisfies $f(x_k) - f(x^*) \le \frac{\|x_0 - x^*\|^2}{2\eta k}$.
\end{theorem}
\begin{proof}
By $L$-smoothness of $f$, each update decreases the objective by at least $\frac{\eta}{2}\|\nabla f(x_k)\|^2$. Summing from $k=0$ to $K-1$ yields the bound.
\end{proof}
9. Inserting Figures, Subfigures & Publication-Grade Tables
Visual clarity makes or breaks peer review. Whenever possible, export charts and diagrams from Python/R/Illustrator as vector PDFs rather than low-resolution screenshots so they stay razor-sharp at any zoom level.
Single Centered Figure
\begin{figure}[htbp]
\centering
\includegraphics[width=0.85\linewidth]{assets/architecture.pdf}
\caption{Overview of the data processing pipeline from raw input to classification.}
\label{fig:example}
\end{figure}
Figure: Architecture overview.
Important: Always place \label{...} after \caption{...}. If you put \label before \caption, LaTeX will attach the reference to the enclosing section number instead of the figure number.
Side-by-Side Subfigures (with subcaption)
\begin{figure}[htbp]
\centering
\begin{subfigure}[b]{0.48\linewidth}
\centering
\includegraphics[width=\linewidth]{assets/train-loss.pdf}
\caption{Training loss over 50 epochs.}
\label{fig:train-loss}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\linewidth}
\centering
\includegraphics[width=\linewidth]{figures/val-acc.pdf}
\caption{Validation accuracy across folds.}
\label{fig:val-acc}
\end{subfigure}
\caption{Model training dynamics. \subref{fig:train-loss} Loss stabilizes by epoch 35; \subref{fig:val-acc} accuracy peaks at \qty{94.1}{\percent}.}
\label{fig:dynamics}
\end{figure}
Publication-Grade Tables with booktabs
Avoid vertical lines (|l|c|r|) and \hline boxes—almost every major journal style guide discourages them. Use booktabs with \toprule, \midrule, and \bottomrule, and note that table captions belong above the table (whereas figure captions belong below the image):
\begin{table}[htbp]
\centering
\caption{Comparison of model accuracy and inference latency on the test split.}
\label{tab:metrics}
\begin{tabular}{@{}lccc@{}}
\toprule
Method & Accuracy (\%) & F1 Score & Latency (ms) \\
\midrule
Logistic Regression & 84.2 & 0.83 & 1.2 \\
Random Forest & 89.7 & 0.89 & 4.8 \\
\textbf{Proposed} & \textbf{94.1} & \textbf{0.94} & \textbf{2.1} \\
\bottomrule
\end{tabular}
\end{table}
Rendered example of the finished booktabs table:
For two-column templates (such as IEEEtran or acmart), use \begin{figure*}...\end{figure*} and \begin{table*}...\end{table*} to span a wide chart or table across both columns.
10. Citations & Bibliography Management (.bib, BibLaTeX & Natbib)
Never type a reference list by hand. Store every source in a plain-text references.bib file—you can export ready-made .bib entries directly from Google Scholar, Zotero, Mendeley, or Semantic Scholar.
Sample references.bib File
@article{smith2024example,
author = {Smith, Jordan and Patel, Priya},
title = {Structured Note-Taking and Exam Retention in Undergraduate Courses},
journal = {Journal of Higher Education Studies},
year = {2024},
volume = {18},
number = {3},
pages = {112--128},
doi = {10.1000/jhes.2024.01803}
}
@inproceedings{doe2025conference,
author = {Doe, Alex and Chen, Wei},
title = {Automated Syllabus Parsing for Student Planners},
booktitle = {Proceedings of the International Conference on Educational Technology},
year = {2025},
pages = {45--54}
}
@online{latexproject2026,
author = {{The LaTeX Project}},
title = {LaTeX Documentation and Manuals},
year = {2026},
url = {https://www.latex-project.org/help/documentation/},
urldate = {2026-11-29}
}
Notice two small tricks that save headaches: wrap corporate authors like {{The LaTeX Project}} in double braces so LaTeX doesn't invert them into "Project, T. L.", and protect proper nouns/acronyms in titles with braces (e.g., {LaTeX} or {COVID-19}) so lowercase styles don't flatten capitalization.
The same source can be displayed differently depending on the citation style selected:
Citing in Text: BibLaTeX vs. Natbib
- With
biblatex(used in our starter template): Use\parencite{key}for parenthetical citations like (Smith & Patel, 2024),\textcite{key}for narrative citations like Smith and Patel (2024), or\cite{key}for numeric styles like [1]. - With
natbib(common in older journal templates): Use\citep{key}for parenthetical and\citet{key}for narrative citations.
11. Common LaTeX Errors & How to Fix Them Fast
LaTeX error messages can look cryptic at first, but 90% of student paper errors come down to the same six culprits:
| Symptom / Error | Likely Cause | Fast Fix |
|---|---|---|
Undefined control sequence |
Typo in a command name or missing \usepackage{...}. |
Check spelling and verify the package providing that command is loaded. |
Citations show as [?] or bold keys |
BibTeX/Biber hasn't run, or the citation key has a typo. | Run the full sequence: pdflatex → biber → pdflatex (×2). |
Missing $ inserted |
Used math symbols (_, ^, \alpha) in normal text. |
Escape underscores as \_ or wrap math symbols in $...$. |
File ended while scanning use of ... |
Unclosed curly brace { or missing \end{...}. |
Check recent edits for a missing } or unclosed math $. |
Overfull \hbox (XXpt too wide) |
A long URL, table, or equation pokes into the margin. | Use \url{...}, resize tables, or break equations with align. |
| Special characters break compilation | Unescaped %, &, #, or $ in prose. |
Escape them with a backslash: \%, \&, \#, \$. |
Compilation Order for Bibliography and References
When using the BibLaTeX and Biber setup from the starter template, compile with pdflatex, run biber, then run pdflatex twice more so citations and cross-references resolve:
12. Final Pre-Submission Checklist
Before uploading your compiled PDF to Canvas, a conference portal, or a journal submission system, run through these final checks:
- Zero unresolved references: Search the PDF for
??and[?]to catch broken\crefor\citekeys. - Anonymization (if double-blind): Remove author names, affiliations, funding acknowledgements, and identifying GitHub URLs if required by the venue.
- Page & word limits: Check whether references and appendices count toward the page limit. You can quickly verify your plain-text word count using GatheredMind's free Word Counter.
- Vector graphics & embedded fonts: Zoom to 400% on every figure to confirm text inside plots is legible and not pixelated.
- Clean auxiliary files: Keep
.tex,.bib, andfigures/organized if submitting source files, and leave out temporary build files like.aux,.log, and.bblunless requested.
Keep Your Research Milestones on Track
Writing a great paper is half typesetting and half project management—tracking advisor feedback, literature readings, IRB deadlines, and draft milestones. GatheredMind keeps your courses, tasks, deadlines, and study notes together in one calm workspace so nothing slips during finals or submission week.
Frequently Asked Questions
Should beginners use Overleaf or install LaTeX locally?
Start with Overleaf if you want zero setup, instant package availability, and live co-authoring. Move to a local installation (TeX Live or MacTeX with VS Code and LaTeX Workshop) if you need offline compilation, faster builds on large theses, or Git version control.
What is the difference between BibTeX and BibLaTeX?
BibTeX is the older standard still required by many IEEE, ACM, and journal .cls templates. BibLaTeX (with the Biber backend) is the modern system used in new templates for better Unicode handling and effortless style switching.
Why do my figures jump to a different page?
LaTeX floats figures and tables to prevent awkward half-empty pages. Use [htbp], keep figures reasonably sized (around 0.85\linewidth), and always refer to them by label (\cref{fig:example}) rather than "above" or "below."
How do I fix [?] appearing instead of my citations?
LaTeX requires multiple passes to resolve citations. Compile with pdflatex, run biber (or bibtex), then run pdflatex twice more—or let Overleaf or latexmk -pdf handle the sequence automatically.