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: Logika & Pembuktian, Geometri
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 Operator Lanjutan →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).
Editor LaTeX AI Terbaik, Alternatif Overleaf
Octree membantu peneliti dari 15+ universitas menulis makalah penelitian lebih cepat menggunakan AI
- Hasilkan diagram TikZ yang indah menggunakan AI
- Unggah gambar dan konversi ke LaTeX dengan mulus
- Dapatkan bantuan instan untuk menulis dan memformat makalah penelitian