8

I am using the amsthm package and get a blank square like $\Square$ at the end of proofs. How can I redefine to get the black Halmos tombstone $\Blacksquare$ instead?

I want the symbol to be right aligned, but it would be useful if I were to be able to switch off the right-alignment.

Gonzalo Medina
  • 505,128

1 Answers1

10

Redefine \qedsymbol:

\documentclass{article}
\usepackage{amsthm}
\usepackage{amssymb}

\renewcommand\qedsymbol{$\blacksquare$}

\begin{document}

\begin{proof}
A test text
\end{proof}

\end{document}

enter image description here

I wouldn't recommend to switch off right alignment for the end-mark (it's not standard, so readers might miss the end-mark and quite franckly, it looks ugly), but you could do something like this:

\documentclass{article}
\usepackage{amsthm}
\usepackage{amssymb}

\renewcommand\qedsymbol{$\blacksquare$}
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\@addpunct{.}]\ignorespaces
}{%
  \nolinebreak\qedsymbol\endtrivlist\@endpefalse
}
\makeatother

\begin{document}

\begin{proof}
A test text some more text and some more text and some more text and
\end{proof}

\end{document}

enter image description here

As barbara beeton mentions in her comment, it might be desired to turn off right alignment on a per-case basis; in this case, it's enough to locally redefine \qedsymbol to be empty and then add the desired symbol at the end (taking some care to prevent undesired line breaks); something along these lines:

\documentclass{article}
\usepackage{amsthm}
\usepackage{amssymb}

\renewcommand\qedsymbol{$\blacksquare$}
\newcommand\placeqed{\nobreak\enspace$\blacksquare$}

\begin{document}

\begin{proof}
A test text some more text and some more text and some more text and
\end{proof}

\begin{proof}
\renewcommand\qedsymbol{}
A test text some more text and some more text and some more text and\placeqed
\end{proof}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • That is nice! Do you know how i may turn off the rught alignment? – Frode Alfson Bjørdal Jul 25 '15 at 02:10
  • 2
    @FrodeBjørdal I updated my answer with a better redefinition. However, I insist, I wouldn't recommend this. – Gonzalo Medina Jul 25 '15 at 02:19
  • to get rid of the automatic right-aligned symbol, it's sufficient to \renewcommand{\qedsymbol}{}. then the desired symbol can simply be inserted at the end of the text with \nobreak\hspace{<dimen>}\<symbolname>; i specified \nobreak because such a symbol is likely to get overlooked on a line by itself (and it doesn't look very good either). the redefinition of the symbol will persist only for the current proof; this enables both formats to be used, while redefining proof limits your options. – barbara beeton Jul 25 '15 at 09:38
  • @barbarabeeton Yes, it's better to have both options. I'll add your suggestion to my answer. Thanks. – Gonzalo Medina Jul 25 '15 at 13:34