Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

amslatex: \qedhere

782 views
Skip to first unread message

Rupert Levene

unread,
Apr 2, 2001, 7:52:29 PM4/2/01
to
How can I persuade qed symbols that are placed with \qedhere in
displayed equations to align with the others flush against the right
margin?

I'm using amsthm 1999/11/29 v2.0.

Rupert

Martin Vaeth

unread,
Apr 3, 2001, 8:10:58 AM4/3/01
to
Rupert Levene <rh...@cam.ac.uk> wrote:
>How can I persuade qed symbols that are placed with \qedhere in
>displayed equations to align with the others flush against the right
>margin?

AFAIK, with AMSLaTeX alone, you simply can't: I guess that the creators of
AMSLaTeX actually *wanted* that the qed symbol is flushed against the right
margin, but they could not do better.

I had tried hard to solve a similar problem, but I found no
solution to force TeX to set a symbol to the right of a displayed equation
without the TeX primitives \eqno which is hard to use for your purpose.
It probably has a deeper meaning that these are *primitives* instead of macros.

I were glad, if somebody would tell me that I am mistaken!

The only reasonable "workaround" I know is to use the "ntheorem" package
which I would recommend anyway instead of the amsthm environments:
In this case, you do not even have to use the \qedhere command, because
ntheorem automatically detects whether the last object in your theorem/proof is
a displayed equation. The only drawback that I know is that you can not
display a "qed" *before* the actual end of the environment (I had this problem,
because I wanted to print certain "Scores" to the right margin instead of a
qed symbol *several times* within the environment).

[My answers do not contradict each other: "ntheorem" reimplements large
parts of the various display-environments to make use of the \eqno primitive;
the implementation is very cumbersome and makes heavey use of internals of
the AMSLaTeX package]

Michael J Downes

unread,
Apr 3, 2001, 9:46:55 AM4/3/01
to tech-s...@ams.org
Rupert Levene <rh...@cam.ac.uk> writes:

> How can I persuade qed symbols that are placed with \qedhere in
> displayed equations to align with the others flush against the right
> margin?

? In simple cases, that normally happens automatically, for example in
all but one of the examples in the test file below.

For those circumstances where the technical obstacles are especially
difficult (as in the multline example below), you will get a warning
that \qedhere probably will not print where desired. Some kinds of
workarounds are possible, but I cannot suggest anything specific without
seeing an example of your material.

If you are not using amsmath, \qedhere will print flush right only in
single equations, not in eqnarray, because we don't want to inflict on
users the kind of ongoing problems that we think would follow from
attempting to patch eqnarray. But if you are not using amsmath you might
as well use the "ntheorem" package, which places the QED symbol
automatically without requiring \qedhere at all.

Regards, Michael Downes
tech-s...@ams.org

------------------------------------------------------------------------
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}

\begin{document}
\begin{proof}
A proof that ends with an equation.
\[a=b+c. \qedhere\]
\end{proof}

\begin{proof}
A proof that ends with an equation.
\begin{equation*}
a=b+c. \qedhere
\end{equation*}
\end{proof}

\begin{proof}
A proof that ends with an equation.
\begin{equation*}\begin{split}
a&=b+c-d+e\\
&=f-g. \qedhere
\end{split}
\end{equation*}
\end{proof}

\begin{proof}
A proof that ends with an equation.
\begin{multline*}
a=b+c\\
-d+e-f+g. \qedhere
\end{multline*}
\end{proof}

\begin{proof}
A proof that ends with an equation.
\begin{gather*}
a=b+c,\\
d=e+f-g. \qedhere
\end{gather*}
\end{proof}

\begin{proof}
A proof that ends with an equation.
\begin{align*}
a&=b+c,\\
d&=e+f-g. \qedhere
\end{align*}
\end{proof}

\end{document}

Rupert Levene

unread,
Apr 3, 2001, 3:14:28 PM4/3/01
to

Michael J Downes wrote:
>
> Rupert Levene <rh...@cam.ac.uk> writes:
>
> > How can I persuade qed symbols that are placed with \qedhere in
> > displayed equations to align with the others flush against the right
> > margin?
>
> ? In simple cases, that normally happens automatically, for example in
> all but one of the examples in the test file below.

Not for me! Only the fourth example's qed symbol is flush right, and
this is because that bit of the equation is as well. I'm using Miktex
1.20e... should I update something?

>
> For those circumstances where the technical obstacles are especially
> difficult (as in the multline example below), you will get a warning
> that \qedhere probably will not print where desired. Some kinds of
> workarounds are possible, but I cannot suggest anything specific without
> seeing an example of your material.

For me, this "fails" in that the two displayed equations appear
identical.

----
\documentclass{article}
\usepackage{amsmath,amsthm}

\begin{document}

\begin{proof}
\[ x \qedhere \]
\end{proof}

\[ x \quad \qedsymbol \]

\end{document}
----

Rupert

Rupert Levene

unread,
Apr 3, 2001, 5:38:40 PM4/3/01
to
>
> For me, this "fails" in that the two displayed equations appear
> identical.
>
> ----
> \documentclass{article}
> \usepackage{amsmath,amsthm}
>
> \begin{document}
>
> \begin{proof}
> \[ x \qedhere \]
> \end{proof}
>
> \[ x \quad \qedsymbol \]
>
> \end{document}
> ----

Indeed, a little digging shows:

> \qedhere=\long macro:
->\begingroup \let \mathqed \math@qedhere \let \@elt \setQED@elt
\QED@stack \relax \relax \endgroup .
l.26 \show\qedhere

> \math@qedhere=\long macro:
->\quad \hbox {\qedsymbol }.
l.28 \show\math@qedhere

so I think that the two equations probably don't just look identical.

Rupert

Rupert Levene

unread,
Apr 4, 2001, 7:35:41 AM4/4/01
to
Problem solved: I was using an old amsmath so I upgraded.

Rupert

0 new messages