Written and maintained by CASRAI Editorial Board
Last updated
In LaTeX, the end-of-proof symbol (the QED symbol) is added automatically when you write a proof inside the proof environment from the amsthm package. To change it, redefine \qedsymbol; to place it correctly after a displayed equation or list, put \qedhere inside that last element. This guide gives a decision table for what to type depending on how your proof ends, and the failure cases the AMS documentation lists.
What it is used for in research
Mathematics and theoretical papers mark the end of a proof with a short symbol so a reader can see where the argument stops and the text resumes. The amsthm documentation describes its proof environment as automatically adding a QED symbol at the end. For the wider conventions of structuring theorems and proofs in a paper, see mathematics paper writing conventions for theorem and proof structure.
Install or access
The package is amsthm, maintained by the American Mathematical Society and listed on CTAN (version 2.20.6, dated 2020-05-29, under the LaTeX Project Public License 1.3c; checked 2026-10-29). The AMS documentation PDF that describes it is version 2.20.3 from September 2017, so the manual and the package carry different version numbers. AMS document classes already incorporate amsthm, so with an AMS class you do not load it separately. With another class, add this to the preamble:
\usepackage{amsthm}
Documentation: CTAN amsthm page and the AMS LaTeX page.
Step-by-step: add and control the symbol
- Load
amsthmin the preamble (unnecessary under an AMS class). - Write the proof inside
\begin{proof} ... \end{proof}. The QED symbol is appended automatically. - To use a different symbol, redefine it with
\renewcommand. Overleaf’s example uses\renewcommand{\qedsymbol}{$\blacksquare$}to replace the default white square with a black one, and another example sets it to the letters QED (that example also loads amssymb). - If the proof ends with a displayed equation, put
\qedhereinside the equation, just before it closes. - If the proof ends with a list, put
\qedhereas the last thing before\end{enumerate}or\end{itemize}. - For a long proof written as a section or subsection rather than a
proofenvironment, use\qedafter ordinary text.
An example for step 4:
\begin{proof}
...
\begin{equation}
a^2+b^2=c^2 \qedhere
\end{equation}
\end{proof}
Decision table: how does your proof end?
| The proof ends with | What to type |
|---|---|
| Ordinary text | Nothing; the proof environment adds the symbol |
An amsmath display, or \[ ... \] |
\qedhere inside the equation |
An equation where \qedhere gives an error |
\mbox{\qedhere} |
| A list | \qedhere as the last thing before \end{enumerate} or \end{itemize} |
eqnarray or $$ ... $$ |
Not supported by \qedhere; switch to an amsmath display |
| A section-style proof, outside the environment | \qed after ordinary text |
Source: AMS, Using the amsthm Package, version 2.20.3 (September 2017), checked 2026-10-29. With amsmath version 2 or later, \qedhere places the symbol flush right; with earlier versions it sits a quad away.
Output and how to read it
The symbol appears at the right end of the last line of the proof. If it lands on its own line, the proof most likely ends in a display or list (use \qedhere) or has a stray blank line (see below). To remove it from one proof, put \renewcommand{\qedsymbol}{} just before \end{proof}; to remove it from all proofs, put that line in the preamble.
Troubleshooting
- A blank line before
\end{proof}(or before an explicit\qed) disables the placement mechanism and can even set the symbol at the top of a new page. Delete the blank line. \qedhereerrors inside an equation: try\mbox{\qedhere}.\qedhereineqnarrayor$$: the manual says it does not work there; amsmath displays and\[ ... \]were crafted for it.- Symbol needed outside a proof: use
\qed, not\qedhere. - Documented display problems: in an unstarred multi-line display the final line is not numbered; inside
splitthe number or label is suppressed; in an alignment with no ampersand the box does not go flush right.
Free alternatives and related packages
| Package | Notes |
|---|---|
| amsthm | Defines proof, \qedsymbol, \qed, \qedhere; used by AMS classes (AMS manual); LPPL 1.3c (CTAN) |
| ntheorem | Provides an automatic way of signalling the end of a proof (TeX FAQ) |
| QED package (Paul Taylor) | Described as the apparently original automatic solution (TeX FAQ) |
| thmtools | Named in the AMS manual: a QED symbol can be applied to any theorem element, not just proofs |
For the editor side of this workflow, see Overleaf alternatives for collaborative LaTeX. For other symbols in manuscripts, see formatting symbols in the corresponding-author line in LaTeX and SI units in scientific writing.
FAQ
How do I change the end of proof symbol in LaTeX?
Redefine \qedsymbol with \renewcommand, for example \renewcommand{\qedsymbol}{$\blacksquare$}. Put it in the preamble to change every proof.
Why is my QED symbol on its own line?
Usually the proof ends in a displayed equation or a list, or there is a blank line before \end{proof}. Use \qedhere inside the last display or list, and remove the blank line.
What is the difference between \qed and \qedhere?
\qedhere puts the symbol at a chosen spot inside the final display or list of a proof environment. \qed is for use outside the proof environment, such as a long proof set as a section, and works properly only after ordinary text.
Sources
- American Mathematical Society, Using the amsthm Package, version 2.20.3, September 2017: https://mirrors.ctan.org/macros/latex/required/amscls/doc/amsthdoc.pdf (checked 2026-10-29).
- CTAN, amsthm package page: https://ctan.org/pkg/amsthm (checked 2026-10-29).
- TeX FAQ, “Proof environment”: https://texfaq.org/FAQ-proof (checked 2026-10-29).
- Overleaf, “Theorems and proofs”: https://www.overleaf.com/learn/latex/Theorems_and_proofs (checked 2026-10-29).








