Square in LaTeX (\square)
- LaTeX command
\square- Package
- Add to your preamble:
\usepackage{amssymb} - Mode
- Math mode only
- Copy the Unicode character
- □
U+25A1
Where it is used
Open square symbol, used for the d'Alembertian, modal necessity and end-of-proof marks.
Physicists write \square for the d'Alembert wave operator, \square = \partial_t^2/c^2 - \nabla^2, modal logic uses \square p for necessarily p (often as \Box), and the hollow square serves as the QED tombstone at the end of proofs. In amsthm proofs the tombstone is placed automatically via \qedsymbol, so you rarely type it yourself. \square is an ordinary symbol; \blacksquare gives the filled version. Many logic texts write \Box for necessity; the two glyphs look nearly identical. When used as an operator before a field, no extra spacing is needed.
Also listed under: Lohika at Proofs, Geometry
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amssymb}
\begin{document}
Square: $\square$
\[ \square \phi = \frac{1}{c^2} \partial_t^2 \phi - \nabla^2 \phi \]
\end{document}Related symbols
All Advanced Operators →Frequently asked questions
- How do I write Square in LaTeX?
- Type \square in math mode, for example $\square \phi = \frac{1}{c^2} \partial_t^2 \phi - \nabla^2 \phi$. Load amssymb first with \usepackage{amssymb}.
- Which package do I need for \square?
- \square needs amssymb: add \usepackage{amssymb} to your preamble before the document starts.
- Can I use \square in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\square$ in running text. If you only need the glyph in text, paste the Unicode character □ instead (with XeLaTeX or LuaLaTeX and a font that has it).
Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf
Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI
- Gumawa ng magagandang TikZ diagrams gamit ang AI
- Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
- Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers