Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

It seems there is an issue within the ams packages, which results in an incompatibility between the fleqn option, and the \qedhere command.

If those are used together, the qed symbol is flushed to the left of the equation, instead of the right.

In the ams revision history, I see a line about a bugfix with "fleqn/qedhere" issues, which is about amscls version 2.02, while I'm using amsclass (and thus amsthm) version 2.20. I have no idea if the bug they fixed is the same I'm experiencing, though.

MWE:

\documentclass{article}

\usepackage{amsthm}
\usepackage[fleqn]{amsmath}

\begin{document}
This is a statement.
\begin{proof}
  This is the equation settling it all:
  \begin{equation}
    1 + 1 = 3 \qedhere
  \end{equation}
\end{proof}
\end{document}

Enclosing the \qedhere in a \mbox{}, as suggested in amsthm's manual, doesn't produce the wanted output either (the qed is one quad right of the equation).

I'm sure there exists plenty of complicated solutions to this problem, however I'd like to avoid them if possible. More precisely, if I could fix it without changing anything out of my preamble, it would be great.

I have hope, because it seems google can't give me anything relevant to that problem, but I don't believe I'm the only one with it. So I might be missing something obvious.

Thanks in advance

share|improve this question
    
It's surely a bug; but I'd avoid ending a proof with a numbered display. Unfortunately, the placement is wrong also with equation*. :( –  egreg Sep 20 '12 at 9:57
    
I'm actually using the mathtools package to number only the equations I need. Even if I will never need this one, it spares the hassle of deciding each time whether the equation should or shouldn't be numbered. –  T. Verron Sep 20 '12 at 11:12
add comment

1 Answer

this definitely is a (known) bug in amsmath. and it's worse than you may realize -- when the qed box is set with \qedhere, fleqn and an equation number, the equation number protrudes into the right-hand margin.

here's a workaround if you are using fleqn and want an end-of-proof box on an equation without an equation number that ends a proof:

\documentclass{article}

\usepackage{amssymb}
\newcommand{\qedsymbol}{$\Box$}
\usepackage{amsthm}
\usepackage[fleqn]{amsmath}

\begin{document}
This is a statement.  Make it long enough that the right margin is clearly delimited.
\begin{proof}
  Use an explicit tag to get the qed box:
  \begin{equation*}
    1 + 1 = 3 \tag*{\qedsymbol}
  \end{equation*}
  \let\qed\relax
\end{proof}
\end{document}

do observe the distinction between \qedsymbol and \qed; if only the \qedsymbol is made to disappear, an extra blank line will be inserted after the display to hold the now-invisible box.

there are several other known problems with fleqn, and all are on the list to be looked at and corrected the next time the code is opened up for an overhaul.

share|improve this answer
    
Thank you for that answer! It does indeed work, but I'd rather avoid the use of this \let... line at each equation. An alternative would be to use a custom proof environment, but that wouldn't seem natural either. –  T. Verron Sep 25 '12 at 17:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.