Una cosa rápida
Registramos el uso anónimo — visitas a páginas, uso de funciones, eventos de compilación — para entender qué funciona y qué no. Sin publicidad, sin datos personales, sin compartir con terceros.
\errors{latex}
50 errores comunes explicados — qué los causa, cómo corregirlos y ejemplos de código funcionales. Guárdelo para cuando LaTeX inevitablemente lo sorprenda.
! Undefined control sequence.
LaTeX encountered a command (starting with \) that it doesn't recognise. This is one of the most common errors — it usually means a typo in a command name or a missing \usepackage.
Check the command spelling carefully. If the command comes from a package, add \usepackage{packagename} to your preamble. Use the LaTeX companion or the package documentation to confirm the correct command name.
\documentclass{article}
\begin{document}
\textboldd{This is bold text}
\end{document}\documentclass{article}
\begin{document}
\textbf{This is bold text}
\end{document}! LaTeX Error: Environment XXX undefined.
You tried to use \begin{envname} but LaTeX has no definition for that environment. Usually caused by a missing package or a typo in the environment name.
Add the required \usepackage to the preamble. The amsmath package provides align, aligned, gather, multline, and most math environments. The enumitem package extends list environments.
\documentclass{article}
% Missing \usepackage{amsmath}
\begin{document}
\begin{align}
E &= mc^2 \\
F &= ma
\end{align}
\end{document}\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
E &= mc^2 \\
F &= ma
\end{align}
\end{document}Compilación inteligente de FormaTeX: FormaTeX smart compile detects AMS math environments and automatically adds \usepackage{amsmath} to the preamble before compiling.
! LaTeX Error: Command \XXX already defined.
You used \newcommand to define a command that already exists. LaTeX refuses to silently overwrite existing commands, which prevents hard-to-debug redefinition bugs.
Use \renewcommand instead of \newcommand if you intentionally want to override an existing command. If the conflict is between two packages, load them in a different order or use the \let technique to save and restore the original.
\documentclass{article}
\usepackage{amsmath}
% \text is already defined by amsmath
\newcommand{\text}[1]{\textit{#1}}
\begin{document}
Hello
\end{document}\documentclass{article}
\usepackage{amsmath}
% Use \renewcommand to override safely
\renewcommand{\text}[1]{\textit{#1}}
\begin{document}
Hello
\end{document}! LaTeX Error: Unknown option 'XXX' for package 'YYY'.
You passed an option to \usepackage that the package doesn't recognise. Options are package-specific — not all packages accept the same set.
Check the package documentation (run texdoc packagename in a terminal) to see the list of valid options. Some options like a4paper belong to \documentclass, not \usepackage.
\documentclass{article}
\usepackage[a4paper]{amsmath} % a4paper is not an amsmath option
\begin{document}
Hello
\end{document}\documentclass[a4paper]{article} % a4paper goes on documentclass
\usepackage{amsmath}
\begin{document}
Hello
\end{document}! LaTeX Error: Option clash for package XXX.
The same package is being loaded twice with different options, which LaTeX does not allow. This often happens when one package internally loads another with different settings than you specified.
Load the package with your desired options as early as possible — before any package that might load it automatically. If a dependency causes the conflict, load it first with your options, then load the dependent package.
\documentclass{article}
\usepackage{hyperref} % hyperref loads xcolor internally
\usepackage[dvipsnames]{xcolor} % Option clash!
\begin{document}
Hello
\end{document}\documentclass{article}
\usepackage[dvipsnames]{xcolor} % Load xcolor first with your options
\usepackage{hyperref} % hyperref reuses xcolor without conflict
\begin{document}
Hello
\end{document}Compilación inteligente de FormaTeX: FormaTeX smart compile detects common option clash patterns and reorders package loading automatically.
! LaTeX Error: Something's wrong--perhaps a missing \item.
Text or content was placed directly inside an itemize, enumerate, or description environment without an \item command. Every piece of content inside a list must be introduced by \item.
Ensure every top-level item inside itemize, enumerate, or description is preceded by \item. If you need sub-lists, nest environments properly — each level still needs \item for each entry.
\documentclass{article}
\begin{document}
\begin{itemize}
This text has no item marker.
\item Second item
\end{itemize}
\end{document}\documentclass{article}
\begin{document}
\begin{itemize}
\item First item
\item Second item
\end{itemize}
\end{document}Runaway argument?
LaTeX started reading a mandatory argument (inside {}) but reached a paragraph break or end-of-file before finding the closing }. This typically means a brace was opened but never closed.
Find the unclosed { and add the matching }. Check the line indicated in the error. Blank lines inside command arguments are not allowed — if you need to break, end the command first.
\documentclass{article}
\begin{document}
\textbf{This text is bold
and continues on a new paragraph}
\end{document}\documentclass{article}
\begin{document}
\textbf{This text is bold.}
And continues on a new paragraph.
\end{document}! TeX capacity exceeded, sorry [main memory size=N].
LaTeX ran out of internal memory while processing your document. This can happen with very large documents, deeply nested structures, or infinite loops caused by recursive macro definitions.
If you have a recursive macro, fix the definition to terminate properly. For large documents, split them using \include{} and compile chapters separately. If caused by a package, try updating it or filing a bug report.
\documentclass{article}
\newcommand{\myloop}{\myloop} % Infinite recursion!
\begin{document}
\myloop
\end{document}\documentclass{article}
% Define commands that terminate
\newcommand{\mytext}{This is finite text.}
\begin{document}
\mytext
\end{document}! Argument of \XXX has an extra }.
\verb and verbatim environments are 'fragile' — they cannot be used inside arguments to other commands. Using \verb inside \section{}, \caption{}, footnotes, or similar commands causes a cryptic brace mismatch error.
Replace \verb with \texttt{} for monospace text inside command arguments. If you need true verbatim in a caption, use the caption package with the \protect\verb workaround, or use \lstinline from the listings package.
\documentclass{article}
\begin{document}
\section{Using \verb|\textbf{}| in LaTeX} % Error!
\end{document}\documentclass{article}
\begin{document}
\section{Using \texttt{\textbackslash textbf\{\}} in LaTeX}
\end{document}! LaTeX Error: Environment align undefined.
The align environment (and related environments like gather, multline, align*) are provided by the amsmath package. Without loading it, LaTeX has no definition for these environments.
Add \usepackage{amsmath} to your preamble. If you use any AMS math environments or commands (\text{}, \intertext{}, \tfrac{}, etc.), amsmath is required.
\documentclass{article}
% Missing \usepackage{amsmath}
\begin{document}
\begin{align}
a &= b + c \\
d &= e - f
\end{align}
\end{document}\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
a &= b + c \\
d &= e - f
\end{align}
\end{document}Compilación inteligente de FormaTeX: FormaTeX smart compile automatically detects align, gather, multline, and other AMS environments and injects \usepackage{amsmath} into the preamble before compiling.
! LaTeX Error: Command \XXX is fragile.
Some LaTeX commands are 'fragile' and cannot be used directly in 'moving arguments' — arguments that LaTeX writes to auxiliary files (like .toc, .lof, .lot) for table of contents or captions. Examples include \footnote, \verb, and some formatting commands.
Add \protect before the fragile command to shield it: \section{My title \protect\footnote{Note}}. Alternatively, use \texorpdfstring{}{} from hyperref to provide different text for PDF bookmarks and the document.
\documentclass{article}
\begin{document}
\section{Introduction\footnote{A note}} % Fragile!
\end{document}\documentclass{article}
\begin{document}
\section{Introduction\protect\footnote{A note}}
\end{document}! Missing \endcsname inserted.
\csname...\endcsname is used to construct command names dynamically. This error means \endcsname is missing or the content between \csname and \endcsname contains invalid characters (like spaces or non-letter tokens).
Ensure every \csname has a matching \endcsname. The name between them must contain only letters. If you need numeric or special characters in command names, escape or encode them first.
\documentclass{article}
\begin{document}
% csname with space — invalid
\csname my command\endcsname
\end{document}\documentclass{article}
\begin{document}
% csname with letters only
\csname mycommand\endcsname
\end{document}! LaTeX Error: Missing \begin{document}.
LaTeX found content (text, commands, or environments) before the \begin{document} marker. Everything before \begin{document} is the preamble — it should only contain class declarations, package loading, and global settings.
Move all content that should appear in the PDF to after \begin{document}. The preamble should only contain \documentclass, \usepackage calls, and command definitions.
\documentclass{article}
\usepackage{amsmath}
This text is in the preamble! % Error
\begin{document}
More content here.
\end{document}\documentclass{article}
\usepackage{amsmath}
\begin{document}
This text is correct.
More content here.
\end{document}! LaTeX Error: \begin{XXX} on input line N ended by \end{YYY}.
A \begin{envname} was closed with a different \end{envname}. LaTeX environments must be nested properly — the most recently opened environment must be closed first.
Check that every \begin{foo} has a matching \end{foo}. Environments must close in the reverse order they were opened — if you open itemize inside enumerate, close itemize before enumerate.
\documentclass{article}
\begin{document}
\begin{itemize}
\item First
\begin{enumerate}
\item Nested
\end{itemize} % Wrong! Should be \end{enumerate}
\end{enumerate} % Wrong! Should be \end{itemize}
\end{document}\documentclass{article}
\begin{document}
\begin{itemize}
\item First
\begin{enumerate}
\item Nested
\end{enumerate} % Close the inner environment first
\end{itemize} % Then close the outer
\end{document}! LaTeX Error: Can only be used in preamble.
A command that can only appear in the preamble (before \begin{document}) was used inside the document body. Common offenders are \documentclass, \usepackage, and \pagestyle.
Move the offending command to the preamble, before \begin{document}. If you need to change page style mid-document, use \thispagestyle{} instead of \pagestyle{}.
\documentclass{article}
\begin{document}
\usepackage{graphicx} % Too late! Must be in preamble
\includegraphics{image.png}
\end{document}\documentclass{article}
\usepackage{graphicx} % Correct: in preamble
\begin{document}
\includegraphics{image.png}
\end{document}! Extra }, or forgotten $.
LaTeX found a closing brace } or $ with no matching opening counterpart. This breaks the internal grouping mechanism that LaTeX uses to scope commands and environments.
Check brace pairing carefully. Every { must have a matching }. Use an editor with brace matching, or add braces systematically and count them. In math mode, every $ must have a closing $.
\documentclass{article}
\begin{document}
\textbf{Hello}} % Extra closing brace
\end{document}\documentclass{article}
\begin{document}
\textbf{Hello} % Balanced braces
\end{document}! Paragraph ended before \XXX was complete.
A blank line (paragraph break) appeared inside a command argument that doesn't allow paragraph breaks. Most standard LaTeX commands that take short arguments cannot span paragraph boundaries.
Remove the blank line from inside the command argument, or close the command before the blank line. For multi-paragraph content, use environments like minipage or a custom command that accepts long arguments (\long\def).
\documentclass{article}
\begin{document}
\textbf{This is bold text.
But this paragraph is inside the argument!}
\end{document}\documentclass{article}
\begin{document}
\textbf{This is bold text.}
But this paragraph is outside the command.
\end{document}! Too many }'s.
LaTeX encountered a } that has no matching {. This happens when the brace nesting is off, usually because a brace was closed twice or an extra brace was inserted.
Carefully trace brace nesting from the start of the file. Each { must pair with exactly one }. Editors with brace highlighting (VS Code, Emacs, TeXStudio) make this much easier to spot.
\documentclass{article}
\begin{document}
{\bfseries Bold text}} % Extra }
\end{document}\documentclass{article}
\begin{document}
{\bfseries Bold text} % Balanced
\end{document}! LaTeX Error: Two \documentclass or \documentstyle commands.
A LaTeX document can only have one \documentclass declaration. If LaTeX encounters a second one, it reports this error. This usually happens when two files are accidentally merged or a template is incorrectly concatenated.
Remove the duplicate \documentclass. Each LaTeX document must have exactly one class declaration, and all other content should be after \begin{document}. Input files should not contain \documentclass.
\documentclass{article}
\documentclass{report} % Second class — error!
\begin{document}
Hello
\end{document}\documentclass{article}
\begin{document}
Hello
\end{document}LaTeX Warning: Label 'XXX' multiply defined.
Two \label{} commands in your document use the same identifier. LaTeX will use the value from the second definition, which may cause wrong cross-references. This is a warning, not an error, but the output will likely be incorrect.
Give each \label{} a unique name. Use a naming scheme like fig:plot1, tab:results, sec:intro to avoid collisions. Run LaTeX twice after renaming to clear the stale .aux file reference.
\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
% ...
\section{Background}\label{sec:intro} % Duplicate!
\end{document}\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
% ...
\section{Background}\label{sec:background} % Unique label
\end{document}! LaTeX Error: \caption outside float.
The \caption{} command was used outside of a floating environment (figure or table). Captions are part of float management and can only appear inside figure, table, or similar float environments.
Wrap the content and \caption in a figure or table environment. Always use \begin{figure}...\end{figure} around images you want to caption, and \begin{table}...\end{table} for tables.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{plot.png}
\caption{My plot} % Error: no surrounding figure
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\centering
\includegraphics{plot.png}
\caption{My plot}
\label{fig:plot}
\end{figure}
\end{document}! Missing $ inserted.
A math command or symbol (like _, ^, \alpha, \frac) was used outside of math mode. LaTeX only interprets these as math when they appear between $ delimiters or inside a math environment.
Wrap math content in inline math mode with $...$ or \(...\), or use a display math environment like \begin{equation}...\end{equation}. For subscripts in text use \textsubscript{} and for superscripts use \textsuperscript{}.
\documentclass{article}
\begin{document}
The value is x_1 + y^2 = z.
Let \alpha be a constant.
\end{document}\documentclass{article}
\begin{document}
The value is $x_1 + y^2 = z$.
Let $\alpha$ be a constant.
\end{document}! Double subscript.
Two consecutive subscript operators _ were applied to the same base without grouping. LaTeX doesn't allow ambiguous stacked subscripts.
Use braces {} to group subscripts. For nested subscripts like x with index i,j write x_{ij} or x_{i_j}. For a subscript that itself has a subscript, wrap the inner expression in braces.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ x_i_j = 0 \]
\end{document}\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ x_{i_j} = 0 \]
\end{document}! Extra alignment tab has been changed to \cr.
A row in a tabular, array, or align environment contains more & column separators than the column specification allows. LaTeX forces a row break at the extra &.
Count the & characters in each row and ensure they match the number of columns minus one. For a 3-column table you need exactly 2 & per row. Update the column specification if you added a new column.
\documentclass{article}
\begin{document}
\begin{tabular}{ll} % 2 columns = 1 ampersand per row
Name & Age & City \\ % 3 columns worth of data!
Alice & 30 & Paris \\
\end{tabular}
\end{document}\documentclass{article}
\begin{document}
\begin{tabular}{lll} % 3 columns = 2 ampersands per row
Name & Age & City \\
Alice & 30 & Paris \\
\end{tabular}
\end{document}! LaTeX Error: Bad math environment delimiter.
A display math delimiter (\[ or \]) was used in an invalid context — such as closing a display math block that was never opened, or opening display math inside inline math.
Ensure every \[ is paired with exactly one \]. Do not nest display math inside other math environments. Use \( and \) for inline math, \[ and \] for unnumbered display math, or \begin{equation} for numbered equations.
\documentclass{article}
\begin{document}
\] x = 5 \[ % Delimiters in wrong order
\end{document}\documentclass{article}
\begin{document}
\[ x = 5 \] % Correct order
\end{document}! Double superscript.
Two consecutive superscript operators ^ were applied to the same base without grouping. Just like double subscript, LaTeX refuses ambiguous stacked superscripts.
Group the superscript content with braces. For x to the power of a+b, write x^{a+b}. For x to the power of a to the power of b, write x^{a^b}.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ e^x^2 \]
\end{document}\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ e^{x^2} \]
\end{document}! LaTeX Error: \boldsymbol undefined.
\boldsymbol is used to produce bold symbols in math mode, but it requires either the bm package (preferred) or amsmath. Without loading one of these, the command is undefined.
Add \usepackage{bm} to your preamble. Use \bm{\symbol} instead of \boldsymbol{\symbol} — bm is the modern, recommended package. For simple Latin bold in math, \mathbf{x} works without any package.
\documentclass{article}
% Missing \usepackage{bm}
\begin{document}
\[ \boldsymbol{\alpha} + \boldsymbol{x} = 0 \]
\end{document}\documentclass{article}
\usepackage{bm}
\begin{document}
\[ \bm{\alpha} + \bm{x} = 0 \]
\end{document}! LaTeX Error: Environment proof undefined.
The proof, theorem, lemma, corollary, and definition environments are provided by the amsthm package. Without loading it, LaTeX has no definition for these environments.
Add \usepackage{amsthm} to your preamble. You also need to declare theorem-style environments with \newtheorem before using them. The proof environment is predefined by amsthm.
\documentclass{article}
% Missing \usepackage{amsthm}
\begin{document}
\begin{proof}
This is the proof.
\end{proof}
\end{document}\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
Statement of the theorem.
\end{theorem}
\begin{proof}
This is the proof.
\end{proof}
\end{document}Compilación inteligente de FormaTeX: FormaTeX smart compile detects proof, theorem, lemma, corollary, and definition environments and automatically adds \usepackage{amsthm} to the preamble.
! Extra \right.
\left and \right must always appear as a matched pair in the same math group. A \right without a preceding \left, or a \left without a closing \right, causes this error.
Ensure every \left delimiter has a matching \right delimiter in the same math group. Use \left. (with a period) as an invisible delimiter when you need an asymmetric pair.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ f(x) = \right) x^2 \] % \right without \left
\end{document}\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ f(x) = \left( x^2 \right) \]
\end{document}! Missing number, treated as zero.
LaTeX expected a number (for a dimension, counter, or numeric argument) but found something unexpected. This often happens when a \hspace, \vspace, or \rule command is given a non-numeric argument.
Provide a valid numeric dimension (e.g. \hspace{1em} or \vspace{12pt}). Dimensions require a unit — never write \hspace{1} without specifying pt, em, cm, etc.
\documentclass{article}
\begin{document}
\hspace{1} % Missing unit — error!
\end{document}\documentclass{article}
\begin{document}
\hspace{1em} % Correct: number + unit
\end{document}! Missing } inserted.
A display math environment or brace group was opened but not closed before the end of the document or the next environment. LaTeX inserts the missing } automatically but the surrounding structure is wrong.
Check every \[ has a matching \] and every \begin{equation} has a matching \end{equation}. Use an editor with bracket matching to identify the unclosed delimiter.
\documentclass{article}
\begin{document}
\[ x = 5
% Missing \]
More text.
\end{document}\documentclass{article}
\begin{document}
\[ x = 5 \]
More text.
\end{document}Overfull \hbox (Xpt too wide) in paragraph at lines N--M.
A line of text is wider than the text area, causing text to stick out into the margin. This is a warning, not an error — compilation continues — but it usually produces visually poor output with text outside the page margins.
For long URLs, use the url or hyperref package with automatic line-breaking. For text, add \sloppy to allow looser line-breaking, or manually insert \- to hint where hyphenation is allowed. For images, ensure they fit within \textwidth.
\documentclass{article}
\begin{document}
See the documentation at https://www.example.com/very/long/url/that/does/not/break/automatically/in/latex.
\end{document}\documentclass{article}
\usepackage{hyperref} % enables automatic URL line-breaking
\begin{document}
See the documentation at \url{https://www.example.com/very/long/url/that/does/not/break/automatically/in/latex}.
\end{document}! LaTeX Error: There's no line here to end.
The \\ (forced line break) command was used in a context where it doesn't make sense — such as immediately after \section{}, at the start of a paragraph, or inside \centering without preceding content.
Remove the \\ from sectioning commands. To add vertical space after a section heading, use \vspace{length}. To force a paragraph break, use \par or leave a blank line instead.
\documentclass{article}
\begin{document}
\section{Introduction}\\ % Misplaced line break
The introduction begins here.
\end{document}\documentclass{article}
\begin{document}
\section{Introduction}
% No \\ needed — paragraph break is implicit
The introduction begins here.
\end{document}Underfull \hbox (badness 10000) in paragraph at lines N--M.
LaTeX couldn't fill a line to the full text width without creating too much visible whitespace between words. This produces lines with large word gaps. Badness 10000 means the spacing is maximally bad.
Rewrite the paragraph slightly to give LaTeX more flexibility. You can also add \emergencystretch=3em to the preamble to allow extra stretch. For short captions or labels, \raggedright avoids the badness at the cost of a ragged right margin.
\documentclass{article}
\begin{document}
\begin{minipage}{3cm}
A.
\end{minipage}
\end{document}\documentclass{article}
\begin{document}
\begin{minipage}{3cm}
\raggedright
A short label.
\end{minipage}
\end{document}! LaTeX Error: Not in outer par mode.
Figure, table, and other floating environments can only be used in 'outer paragraph mode' — the normal flow of text. They cannot appear inside boxes (\mbox, \fbox), minipages, or other constrained environments.
Move the float outside the constraining environment. If you need an image inside a minipage, use \includegraphics{} directly without the figure wrapper. Use \captionof{figure}{} from the capt-of package for a caption outside a float.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{minipage}{0.5\textwidth}
\begin{figure}[h] % Error: float inside minipage
\includegraphics{image.png}
\end{figure}
\end{minipage}
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{minipage}{0.5\textwidth}
\includegraphics[width=\linewidth]{image.png}
\end{minipage}
\end{document}! Illegal unit of measure (pt inserted).
A dimension argument was given a number without a valid unit, or with an unrecognised unit. LaTeX assumes pt and continues, but the result is likely wrong.
Always specify a unit when giving dimensions. Valid TeX units include pt, bp, mm, cm, in, em, ex, pc, dd, cc, sp. Relative units like \textwidth and \linewidth also work as dimensions.
\documentclass{article}
\begin{document}
\rule{100px}{2px} % px is not a valid LaTeX unit
\end{document}\documentclass{article}
\begin{document}
\rule{100pt}{2pt} % Use LaTeX units: pt, mm, cm, em, etc.
\end{document}! LaTeX Error: Too many unprocessed floats.
LaTeX has an internal limit on how many floating objects (figures, tables) can wait to be placed. If too many floats accumulate without a page break, LaTeX runs out of internal registers and stops.
Insert \clearpage at regular intervals to force LaTeX to place all pending floats and start a new page. Use the placeins package with \FloatBarrier for softer barriers. Change float placement from [h] to [htbp] for more flexibility.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
% Many consecutive figures with no text between them...
\begin{figure}[h]\includegraphics{a.png}\end{figure}
\begin{figure}[h]\includegraphics{b.png}\end{figure}
% ... many more ...
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htbp]\includegraphics{a.png}\end{figure}
\begin{figure}[htbp]\includegraphics{b.png}\end{figure}
\clearpage % Force placement of all pending floats
\end{document}! LaTeX Error: Counter too large.
A counter (typically a footnote number or enumerate item number) exceeded the maximum value that can be represented in the current format. Roman numerals and alphabetic lists have practical limits.
For long alphabetically-numbered lists, switch to numeric numbering using the enumitem package. For footnote overflow, use \setcounter{footnote}{0} periodically, or switch to endnotes with the endnotes package.
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\alph*)]
% ... 27 or more items ...
\end{enumerate}
\end{document}\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\arabic*.]
% Numeric — no practical upper limit
\end{enumerate}
\end{document}! LaTeX Error: Float too large for page by Xpt.
A figure or table is taller than the page's float area, so LaTeX cannot place it anywhere. This usually happens with very large images or tables placed inside a float environment.
Scale the image down: \includegraphics[width=\textwidth]{img}. For very tall content, use a full-page figure with \begin{figure}[p]. For long tables, use the longtable package instead of table.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\includegraphics{huge-image.png} % No size constraint
\end{figure}
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htbp]
\centering
\includegraphics[width=0.9\textwidth]{huge-image.png}
\caption{Scaled to fit.}
\end{figure}
\end{document}! LaTeX Error: File 'XXX' not found.
LaTeX tried to read a file (via \input{}, \include{}, \includegraphics{}, or similar) but couldn't locate it. LaTeX searches the current directory and its TeX installation paths.
Use the full relative path from the .tex file location. For images, ensure the file extension matches exactly. When using \includegraphics, place images in the same folder as the .tex file or specify the path explicitly.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{logo} % File 'logo' not found
\input{chapters/intro} % Wrong path
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{images/logo.png} % Correct path + extension
\input{chapters/intro.tex} % Correct path
\end{document}! LaTeX Error: Unknown graphics extension: .XXX.
You tried to include an image with a file format that the current LaTeX engine doesn't support. Different engines support different image formats.
For pdflatex: use .pdf, .png, or .jpg images. For XeLaTeX/LuaLaTeX: same plus .eps via epstopdf. Convert unsupported formats beforehand. You can also omit the extension and let LaTeX pick the best format automatically.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
% pdflatex doesn't support .eps
\includegraphics{figure.eps}
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
% Use PDF, PNG, or JPG with pdflatex
\includegraphics{figure.pdf}
% Or let LaTeX choose:
% \includegraphics{figure}
\end{document}Compilación inteligente de FormaTeX: FormaTeX smart compile detects EPS images and automatically switches to an engine with epstopdf support, or converts the image format before compiling.
! Package inputenc Error: Unicode char U+XXXX not set up for use with LaTeX.
Your document contains a Unicode character (accented letter, emoji, special symbol, etc.) that pdfLaTeX can't handle. pdfLaTeX uses 8-bit encodings and requires special packages to support Unicode input.
The simplest fix is to switch to XeLaTeX or LuaLaTeX with \usepackage{fontspec} — they support Unicode natively. Alternatively, add \usepackage[utf8]{inputenc} to pdfLaTeX for basic Latin Unicode support.
\documentclass{article}
% pdflatex — no Unicode support configured
\begin{document}
Café, naïve, résumé, 日本語
\end{document}\documentclass{article}
% Option 1: XeLaTeX / LuaLaTeX (full Unicode)
\usepackage{fontspec}
% Option 2: pdfLaTeX with UTF-8 (limited Unicode)
% \usepackage[utf8]{inputenc}
% \usepackage[T1]{fontenc}
\begin{document}
Café, naïve, résumé
\end{document}Compilación inteligente de FormaTeX: FormaTeX smart compile detects non-ASCII characters in the source and automatically switches from pdfLaTeX to XeLaTeX with fontspec enabled.
! LaTeX Error: Cannot determine size of graphic (no BoundingBox).
LaTeX could not determine the dimensions of an included graphic because the file lacks a BoundingBox comment. This happens when EPS files are included in pdfLaTeX mode, or when an image file is corrupted.
Convert EPS files to PDF using epstopdf (run epstopdf figure.eps to get figure.pdf). For pdflatex, use .pdf, .png, or .jpg files. Load the epstopdf package to automate this conversion on-the-fly.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
% pdflatex cannot use EPS without conversion
\includegraphics{figure.eps}
\end{document}\documentclass{article}
\usepackage{graphicx}
\usepackage{epstopdf} % auto-converts EPS to PDF
\begin{document}
\includegraphics{figure.eps} % epstopdf converts it on-the-fly
% Or manually convert first:
% \includegraphics{figure.pdf}
\end{document}Compilación inteligente de FormaTeX: FormaTeX smart compile detects EPS files included with pdfLaTeX and automatically converts them using epstopdf before compiling.
LaTeX Warning: Citation 'XXX' on page N undefined.
A \cite{key} command references a bibliography key that doesn't exist in the current .bib file, or BibTeX/Biber has not been run. This produces [?] in the output instead of the citation number.
Run the full compilation sequence: pdflatex → bibtex → pdflatex → pdflatex. Check that the key in \cite{key} exactly matches the key in your .bib file. Verify the \bibliography{} path points to the correct .bib file.
\documentclass{article}
\begin{document}
See~\cite{smith2024} for details.
\bibliography{refs}
\bibliographystyle{plain}
\end{document}% refs.bib must contain:
% @article{smith2024,
% author = {Smith, John},
% title = {My Paper},
% year = {2024},
% }
\documentclass{article}
\begin{document}
See~\cite{smith2024} for details.
\bibliography{refs}
\bibliographystyle{plain}
\end{document}LaTeX Warning: Reference 'XXX' on page N undefined.
A \ref{key} or \pageref{key} command references a label that doesn't exist yet, or LaTeX needs to be run twice to resolve cross-references. The output shows ?? instead of the reference number.
Compile the document twice: the first pass writes labels to the .aux file, and the second pass reads them. If ?? still appears, check that the \label{key} exists and matches the \ref{key} exactly (case-sensitive).
\documentclass{article}
\begin{document}
\section{Introduction}
% Forgot \label here
See Section~\ref{sec:intro} for more.
\end{document}\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
See Section~\ref{sec:intro} for more.
\end{document}LaTeX Font Warning: Font shape 'OT1/XXX/m/n' undefined.
LaTeX requested a specific font shape (a combination of encoding, family, series, and shape) that isn't available in the current TeX installation. LaTeX substitutes the closest available font, which may change the document's appearance.
Install the missing font package via your TeX distribution (tlmgr install packagename for TeX Live). If using XeLaTeX/LuaLaTeX with fontspec, check that the system font name matches exactly.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Nonexistent Font Name} % Font not on system
\begin{document}
Hello
\end{document}\documentclass{article}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman} % Standard TeX font, always available
\begin{document}
Hello
\end{document}! LaTeX Error: File 'XXX.sty' not found.
LaTeX cannot find the style file for a package you tried to load with \usepackage{}. The package is either not installed in your TeX distribution, has a different name, or is a custom package not in the current directory.
Install the missing package: run tlmgr install packagename (TeX Live) or use MiKTeX's package manager. Check the exact package name on CTAN. For custom packages, place the .sty file in the same directory as your .tex file.
\documentclass{article}
\usepackage{nonexistentpackage} % Not installed
\begin{document}
Hello
\end{document}\documentclass{article}
% Install via: tlmgr install booktabs
\usepackage{booktabs}
\begin{document}
Hello
\end{document}Compilación inteligente de FormaTeX: FormaTeX smart compile automatically installs missing CTAN packages from the full TeX Live distribution before compiling your document.
! Package tikz Error: I did not find the library 'XXX'.
A TikZ library referenced with \usetikzlibrary{} doesn't exist or is spelled incorrectly. TikZ functionality is split into libraries that must be loaded explicitly.
Check the TikZ/PGF manual for the correct library name. Common libraries: arrows.meta, decorations.pathmorphing, calc, positioning, shapes, fit, external. pgfplots graphs require \usepackage{pgfplots} separately.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrow} % Wrong: should be 'arrows' or 'arrows.meta'
\begin{document}
\begin{tikzpicture}
% ...
\end{tikzpicture}
\end{document}\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
\begin{document}
\begin{tikzpicture}
\node (a) {A};
\node[right of=a] (b) {B};
\draw[-{Stealth}] (a) -- (b);
\end{tikzpicture}
\end{document}LaTeX Warning: There were undefined references.
The document has bibliography references that were never resolved. This usually means the BibTeX or Biber processor was not run as part of the compilation sequence, so the reference data was never collected.
For traditional BibTeX: run pdflatex → bibtex main → pdflatex → pdflatex. For biblatex with Biber: run pdflatex → biber main → pdflatex → pdflatex. Delete .aux files if you get persistent undefined reference warnings after the full sequence.
% Only ran: pdflatex main.tex
% Missing: bibtex main -> pdflatex -> pdflatex% Full BibTeX sequence:
% 1. pdflatex main.tex
% 2. bibtex main
% 3. pdflatex main.tex
% 4. pdflatex main.tex
% Full biblatex+biber sequence:
% 1. pdflatex main.tex
% 2. biber main
% 3. pdflatex main.tex
% 4. pdflatex main.texPackage hyperref Warning: Hyper reference '...' on page N undefined.
The hyperref package found a \hyperref[key]{text} or \autoref{key} reference to an anchor that doesn't exist in the document. The link will point nowhere in the PDF.
Ensure every \hyperref[key]{} or \autoref{key} has a matching \label{key} in the document. Compile twice to resolve cross-references. Check that no \includeonly{} is excluding the file with the label.
\documentclass{article}
\usepackage{hyperref}
\begin{document}
See \autoref{fig:result} for the result.
% But there is no \label{fig:result} anywhere!
\end{document}\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{figure}[h]
\centering
% ... figure content ...
\caption{Results}\label{fig:result}
\end{figure}
See \autoref{fig:result} for the result.
\end{document}