8

When a proof ends with a math equation, it adds an extra space. It means that the proof square goes to the next line and doesn't appear exactly in the last line.

Here is an example:

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]

\begin{document}
\begin{theorem}
...
\end{theorem}
\begin{proof}
...
$$\begin{array}{ccc}
A & \Longrightarrow & B\\
 & \Longrightarrow & C
\end{array}$$
\end{proof}
\begin{theorem}
...
\end{theorem}
\end{document}

And the compiled result is the following.

enter image description here

What should I do to have the square exactly aligned, it means in the same line "\Longrightarrow C" exists?

1
  • 1
    the ntheorem package does what you want automatically, at least for an equation on a single line.
    – pluton
    Oct 19, 2016 at 13:53

3 Answers 3

8

You should never (in the sense of never ever) use $$...$$ in LaTeX. For no reason whatsoever. See Why is \[ ... \] preferable to $$ ... $$?

For proofs that end with a display there is \qedhere.

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]

\begin{document}
\begin{theorem}
...
\end{theorem}
\begin{proof}
...
\begin{align*}
A & \Longrightarrow B\\
 & \Longrightarrow C\qedhere
\end{align*}
\end{proof}
\begin{theorem}
...
\end{theorem}
\end{document}

enter image description here

Depending on the nature of the alignment, you can also use

\begin{proof}
...
\begin{equation*}
\begin{split}
A & \Longrightarrow B\\
 & \Longrightarrow C\qedhere
\end{split}
\end{equation*}
\end{proof}
2
  • What is difference between align and split? Oct 19, 2016 at 13:38
  • 1
    @AmirHoseinSadeghiManesh Several, but explaining them is quite long. You can look at the documentation of amsmath for more information. I don't know what's the right environment to use in your case because the formulas are too generic.
    – egreg
    Oct 19, 2016 at 13:43
5

At a minimum, you should (a) insert the directive \qedhere immediately after "C" and (b) change \begin{array}{ccc} to \begin{array}[b]{ccc}. The [b] ("bottom") positioning specifier informs LaTeX that the QED symbol should be aligned at the bottom rather than at the center of the array.

Incidentally, you should not use $$ to initiate and terminate displaymath-mode in a LaTeX document. It's badly deprecated. Instead, use \[ and \]. See Why is \[ ... \] preferable to $$ ... $$? for a longer discussion.

0
3

I would like to point that ntheorem has an automatic placement of the end-of-proof symbol, without having to ask it (thmmarks option). In addition, we can use its amsthm compatibility option:

\documentclass[10pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[thmmarks, amsmath, thref, amsthm]{ntheorem}%
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]

\begin{document}
\begin{theorem}
...
\end{theorem}
\begin{proof}
...
 \begin{align*}
A & \Longrightarrow B\\
 & \Longrightarrow C
\end{align*} %
\end{proof}

\begin{theorem}
...
\end{theorem}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .