Use ChatGPT for LaTeX and check the compiled document

Ask ChatGPT for a minimal complete .tex document, name your compiler and required packages, and compile the result in your own LaTeX environment. Check the PDF as well as the log. A document can compile while still displaying ?? in place of a reference or numbering the wrong object.

For an existing project, supply the relevant preamble and the smallest section that reproduces the problem. Keep your required document class and submission format explicit. OpenAI's prompting guidance supports providing context, output requirements and boundaries; asking for LaTeX source is more useful than receiving an equation screenshot you cannot edit.

Start with a document you can compile

This authored example needs no external image and uses only the standard article class. Save the source as review.tex:

\documentclass{article}
\begin{document}

\section{Room arrangement}
\label{sec:room}

Figure~\ref{fig:layout} shows the proposed arrangement.
Section~\ref{sec:review} records the remaining check.

\begin{figure}[ht]
  \centering
  \fbox{\rule{0pt}{20mm}\rule{40mm}{0pt}}
  \caption{Illustrative room layout}
  \label{fig:layout}
\end{figure}

\section{Review}
\label{sec:review}
Keep the rear aisle clear in the final layout.

\end{document}

With a local pdfLaTeX installation, run pdflatex review.tex again after the first successful pass if the log asks for another run. In Overleaf, use its compile controls and inspect the log if a reference remains unresolved. This is a standard LaTeX source workflow; copying the source into ChatGPT does not run your compiler.

For the supplied source, the expected final prose says “Figure 1” and “Section 2.” The outlined box is an intentional placeholder, not a missing image file or a real room plan. Replace it with your own approved drawing only when the reference structure works.

Treat a missing reference as an exact-name problem first

Change only \ref{fig:layout} to \ref{fig:layuot}. Now the marker no longer matches any label. Running the compiler repeatedly cannot correct that spelling. Overleaf's undefined-reference explanation describes this diagnostic and the missing corresponding label.

Compare every character in the reference and label, including prefixes. Then check that the intended label is unique. Reusing fig:layout on a section and a figure introduces a different problem: one name now refers to competing objects. The multiply-defined-label diagnostic explains that collision.

Avoid replacing \ref{fig:layout} with a typed 1 just to clean up the PDF. Inserting an earlier figure should update the reference automatically; a hard-coded number would become stale.

Put the label after the caption

For a numbered figure, keep \label after \caption so the label captures the figure's updated counter. A label placed before the caption can pick up a preceding counter instead. Overleaf's figure-reference documentation covers label placement and the repeated compilation used to resolve cross-references.

That is why a plausible-looking number still needs review. Check that the sentence refers to the intended figure, rather than accepting any numeric output as success. After moving or adding numbered objects, compile until the reference-change warnings have cleared and inspect the resulting PDF again.

Request source, explanation and checks together

Help me create or repair this LaTeX document.
Task and reader: [ENTER]
Document class, compiler and relevant packages: [ENTER]
Required output/submission format: [ENTER]
Existing preamble and smallest relevant source: [PASTE]
Exact log warnings and what the PDF displays: [PASTE]

Return a minimal complete .tex example preserving my required class.
Keep editable equations and numbered objects as LaTeX source.
Use unique descriptive labels and references rather than hard-coded
figure or section numbers. Put figure labels after their captions.
Do not invent citations, measurements, package availability or a
successful compile. Explain every necessary change and tell me what
to check in the log and final PDF. Flag missing source information.

If the first compilation stops on a missing package, resolve that actual error before diagnosing a later figure number. If you are checking external paper citations, the citation verification workflow addresses source existence and metadata; internal \ref markers do not verify an external source.

Keep the accepted .tex source and its dependencies together. Open the final PDF after the last compilation and follow each reference in the surrounding sentence before submitting that PDF in the required format.

Keep reading