9

Just as my title says, I would prefer to have my qed symbol to be 1 line lower than the last line of my proof. By default its on the same line and aligned to the right.

How can I achieve this?

EDIT: See below code for an example:

\documentclass[11pt,a4paper]{article}
\usepackage[margin=3cm]{geometry}
\usepackage[english]{babel}
\usepackage{amsmath, amsthm}
\begin{document}

\begin{proof}
    Hello there good chap! I'll put in another line here just to be sure its clear what I mean.
\end{proof}



\end{document}

3 Answers3

11

Add the following lines in your preamble:

\usepackage{etoolbox}
\patchcmd{\endproof}
  {\popQED}
  {\par\popQED}
  {}
  {}

In this way we patch the proof environment (its end part \endproof) to issue a \par before printing the qed symbol.

Complete MWE:

\documentclass[11pt,a4paper]{article}
\usepackage[margin=3cm]{geometry}
\usepackage[english]{babel}
\usepackage{amsmath, amsthm}

\usepackage{etoolbox}
\patchcmd{\endproof}
  {\popQED}
  {\par\popQED}
  {}
  {}

\begin{document}

\begin{proof}
    Hello there good chap! I'll put in another line here just to be sure its clear what I mean.
\end{proof}

\end{document} 

Output:

enter image description here

karlkoeller
  • 124,410
  • @BallzofFury You're welcome, happy to help. – karlkoeller Feb 13 '14 at 11:19
  • 4
    This way it can jump to the next page at a page break I'm afraid... maybe something like \relax\ifhmode\\\else\par\fi\popQED ? – yo' Feb 13 '14 at 11:19
  • @tohecz no, this doesn't work. Maybe \nopagebreak[4]\par\popQED is better – karlkoeller Feb 13 '14 at 11:27
  • @karlkoeller It was just a shot in the darkness. That one should work probably. Another option might be redefining \qedsymbol to occupy the whole line width. – yo' Feb 13 '14 at 11:28
  • @tohecz And, anyway, the normal behavior of the qed is to jump on the next page. Try this document: \lipsum[1-6] aaa \begin{proof} Hello there good chap! I'll put in another line here just to be sure its clear whats. \end{proof} – karlkoeller Feb 13 '14 at 11:43
  • @karlkoeller -- the example is using amsthm. if the proof ends with a display, it already drops down a line (plus the post-display skip); with this new approach, it is dropped even further, so even if it does stay on the same page, there will be a huge gap. and \qedhere doesn't work. maybe testing to see whether you're already in vertical mode, and not adding more space there would take care of that problem. – barbara beeton Feb 13 '14 at 13:39
  • @barbarabeeton \qedhere works as expected and in presence of a displayed math, no more space is added. – karlkoeller Feb 13 '14 at 15:26
  • @karlkoeller -- but that's not what's been requested. \qedhere will continue to put the tombstone on the "last" line of a proof-ending display (which may be centered vertically, if split or aligned is used) and happily overwrite a right-hand equation number unless a starred version suppresses the numbers. the question explicitly asks for a one-line drop. (not that i agree with this, mind you, but it's what was requested.) – barbara beeton Feb 13 '14 at 15:31
8

Don't do it. In most cases the tombstone will hang from nowhere.

\documentclass[a4paper]{article}
\usepackage{amsthm}

% lower the symbol and make it zero width
\renewcommand{\qedsymbol}{\raisebox{-\baselineskip}{\llap{\openbox}}}

\begin{document}

\begin{proof}
This is a proof that this setting is \emph{really bad}
\end{proof}

\end{document}

enter image description here

egreg
  • 1,121,712
2

It seems sufficient (not thoroughly tested) to issue a \par\nobreak before the "QED paragraph" is set:

enter image description here

\documentclass{article}
\usepackage{amsthm,amsmath,xpatch}
\newtheorem{theorem}{Theorem}

% \xpatchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\xpatchcmd{\qed}{\leavevmode}{\par\nobreak\leavevmode}{}{}

\begin{document}
\begin{proof}
\begin{equation}
  f(x) = ax^2 + bx + c
\end{equation}
\end{proof}

\begin{proof}
\begin{equation}
  f(x) = ax^2 + bx + c
\end{equation}
Some more text.
\end{proof}
\end{document}
Werner
  • 603,163