112

How do I type a QED symbol - I want a full box and not an empty box like \qed gives you. (I'm not using \begin{proof})

Guy
  • 14,178
  • 27
  • 67
  • 88

10 Answers10

66

You can use \blacksquare:

When creating TeX, Knuth provided the symbol ■ (solid black square), also called by mathematicians tombstone or Halmos symbol (after Paul Halmos, who pioneered its use as an equivalent of Q.E.D.). The tombstone is sometimes open: □ (hollow black square).

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
  • @ucortanbai FYI, "Use *x*." is a complete sentence. As for whether `_` (i.e. subscripting the ■) makes it look better is completely subjective matter. If you want to make that stand, do it in your answer. – Sinan Ünür Sep 13 '14 at 19:48
63

enter image description here

\documentclass{scrartcl}
\usepackage{amssymb}
\begin{document}
$\backslash$blacksquare: $\blacksquare$

$\backslash$square: $\square$
\end{document}

You can easily find such symbols with http://write-math.com

When you want to align it to the right, add \hfill.

I use:

\renewcommand{\qed}{\hfill\blacksquare}
\newcommand{\qedwhite}{\hfill \ensuremath{\Box}}
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
  • 2
    Redefining `\qed` in this way seems to break `\qedhere` command. I prefer to redefine `\qedsymbol` instead. – Alexey B. Jan 12 '14 at 05:41
11

If you \usepackage{amsmath}, the \blacksquare command will typeset a solid black square. The \square command will give you a hollow square.

The ulsy package has a few version of the lightning bolt for contradictions: \blitza, \blitzb, ..., \blitze. Just drop \usepackage{ulsy} into the preamble of your document.

Finally, as others have pointed out, the Comprehensive LaTeX Symbols List is a great resource for finding the perfect symbol for the job.

godbyk
  • 8,359
  • 1
  • 31
  • 26
9

Add to doc header:

\usepackage{ amssymb }

Then at the desired location add:

$ \blacksquare $
Shai
  • 111,146
  • 38
  • 238
  • 371
Meg O
  • 91
  • 1
  • 1
7

As described here, you can redefine the command \qedsymbol, in your case - to \blacksquare:

\renewcommand{\qedsymbol}{\ensuremath{\blacksquare}}

This works both with \qed command and proof environment.

Alexey B.
  • 1,106
  • 8
  • 17
  • This is a rehash of previous answers. – Maarten Bodewes Dec 01 '21 at 22:09
  • @MaartenBodewes It isn't. What I wanted to say is that the "correct" command to define is `\qedsymbol`, which is used by other commands and environments. What exactly you define it to is your choice. – Alexey B. Dec 26 '21 at 20:25
  • If you make that clear in your answer - e.g. mentioning a name clash, as I suppose that's why you need this specific name (?) - then I'm happy to remove the downvote and comment; currently it is locked in. – Maarten Bodewes Dec 26 '21 at 20:47
5

What about \blacksquare? http://amath.colorado.edu/documentation/LaTeX/Symbols.pdf

John
  • 15,990
  • 10
  • 70
  • 110
  • is there a reason this won't work? do I need to import anything? (`\square` works fine) – Guy Dec 15 '09 at 21:34
  • Oh ok ... \square in the link I gave you is a white square. Thought you wanted a fileed-in square. – John Dec 15 '09 at 21:40
5

\rule{1.2ex}{1.2ex} will give you a filled box.

\fbox{\phantom{\rule{.7ex}{.7ex}}} will give you an empty box. The \phantom command will typeset with invisible ink.

The advantage of this approach is that no package is needed. Also the size is up to your control. Less is more.

user1958943
  • 461
  • 5
  • 2
5

Simple answer:

In the preamble make sure you have \usepackage{amssymb}

Then in the preamble we can define this simple command: \newcommand{\qed}{\hfill $\blacksquare$}

Then whenever you want the QED symbol to complete a proof, you type \qed.

If you prefer a hollow square, replace \blacksquare with \square

Disaster Area
  • 59
  • 1
  • 1
4

I think you are looking for this:

\newcommand*{\QEDA}{\hfill\ensuremath{\blacksquare}}

Usage:

\begin{example}
  blah blah blah \QEDA
\end{example}
MattAllegro
  • 6,455
  • 5
  • 45
  • 52
LKB
  • 157
  • 6
1

The question specifically mentions a full box and not an empty box and not using proof environment from amsthm package. Hence, an option may be to use the command \QED from the package stix. It reproduces the character U+220E (end of proof, ∎).

MattAllegro
  • 6,455
  • 5
  • 45
  • 52