AI-assisted writing

How to Write a LaTeX Research Paper with AI — Without Inventing Citations

Give AI your evidence and ask it to help typeset the paper. Don't ask it to supply the evidence.

This guide takes you from research notes to a LaTeX draft you can compile, check and revise. It works with a browser-based editor or a local TeX installation, and the example uses fictional numbers so you can see exactly what is and isn't supported.

Download the example .tex · Download the .bib file

1. Start with an evidence brief

Use your target venue’s template if it provides one. Compile the untouched template first. Then keep a short source file or notebook with your question, methods, measured results, limitations and verified references. For every important result, include a pointer to the table, notebook or calculation that produced it.

Worked example: Suppose two procedures completed 8 of 10 and 9 of 10 runs, respectively. These are made-up counts for the tutorial. A draft may say that the second procedure completed one more run in this example. It may not invent a significance test, say the second procedure is reliably better, or assume that the runs were paired.

Ask the model to build an outline before writing prose:

Using only the notes below, outline a short paper. Under each proposed result, identify the supporting note or calculation. Mark missing information as [AUTHOR CHECK]. Do not add sources, data, methods, statistical tests or claims.

Don't upload participant data, confidential drafts or other material you don't have permission to share. Paste a redacted excerpt or work locally when needed.

2. Turn one section into LaTeX

Start with one paragraph, equation or table. Ask for a narrow edit so you can spot changes to numbers, units, denominators, notation and qualifiers. For the example counts, the following code defines the completion fraction without making a claim about statistical significance:

\begin{equation}
  \widehat{p} = \frac{n_{\mathrm{completed}}}{n_{\mathrm{attempted}}}.
  \label{eq:completion}
\end{equation}

Convert this Results paragraph into LaTeX. Keep all numbers, denominators and limitations unchanged. Use the existing packages and labels. Return only the changed block. If a statement goes beyond the evidence, mark it with a LaTeX comment instead of rewriting it as a stronger claim.

Compare the result against your notes, not just the previous draft. A polished sentence can quietly change “completed more runs in this example” into “improved reliability.” Reject that change unless your study supports it.

3. Verify each reference before it goes into the bibliography

Look up each proposed reference at the publisher or repository. Check the title, authors, year and identifier against that record, and open the source to check that it supports the specific sentence. A real DOI can still point to the wrong paper; a real paper can still be cited for a claim it does not make.

Build your .bib file from verified records. Give the model a list of approved keys and the claims they support. If none fits, tell it to flag the claim instead of creating a citation. In the example, \cite{overleaf-bibtex} refers to the Overleaf BibTeX guide for formatting, not to evidence for the fictional results.

Use only these citation keys. Insert a citation only if my source notes explicitly support the surrounding claim. If they don't, add a “citation needed” comment. Do not generate new BibTeX entries or infer missing metadata.

4. Compile the example and fix the first error

Put both downloads in the same folder. In Overleaf, upload both files to one project, select latex-paper-example.tex as the main document, and recompile. With a local TeX installation, run these commands from the folder containing the files:

pdflatex -halt-on-error latex-paper-example.tex
bibtex latex-paper-example
pdflatex -halt-on-error latex-paper-example.tex
pdflatex -halt-on-error latex-paper-example.tex

The first LaTeX pass writes citation information; BibTeX builds the bibliography; the final passes resolve references. If citation markers still show as question marks, check the key spelling and rerun the sequence. See Overleaf’s explanation of BibTeX compilation.

For a build error, start with the first error and the nearby source lines, not the whole log. An undefined control sequence may be a typo or a command from a package that wasn't loaded; a missing math delimiter can come from using math syntax in ordinary text. Ask for the smallest correction and compile again before applying any additional suggestions.

Explain this first LaTeX error and show the smallest source change that fixes it. Do not change the scientific text, add a package unless needed, or suggest enabling shell escape.

5. Check the science and the submission files separately

  • Science: Trace every key claim to a source, a derivation or a reproducible result. Check denominators, units, uncertainty and limitations against the underlying work.
  • PDF: Read the compiled output, including figure captions and the reference list. Look for missing figures, unresolved citations, broken references and changes in mathematical meaning.
  • Submission: Keep the source, bibliography and figures together. Use only accurate affiliation wording, and check the target venue’s rules for AI disclosure and any required statement.

Compilation tells you the document is typeset. It does not tell you whether the analysis, citations or conclusions are correct.

Related guides