3

Just a quick question about line spacing (which seems to account for at least half of my LaTeX woes). I'm writing a proof in align* environment and can't seem to get rid of the spacing before and after. What I would like is for the first line of the proof to be in line with "proof:" and for the last line of the proof to be in line with the qed/box.

Here's my code:

\begin{res} (Bianchi Identity)
\[ \dd \Phi = \varphi \wedge \Phi - \Phi \wedge \varphi \]
\end{res}
\begin{proof}
\begin{align*}
        \dd \Phi &= \dd(\dd \varphi - \varphi \wedge \varphi) \\
                 &= - \dd \varphi \wedge \varphi + \varphi \wedge \dd \varphi \\
                 &= - (\dd \varphi - \varphi \wedge \varphi) \wedge  \varphi + \varphi \wedge (\dd \varphi - \varphi \wedge \varphi) \\
                 &= - \Phi \wedge \varphi + \varphi \wedge \Phi 
\end{align*}
\end{proof}

enter image description here

5
  • 1
    Add some text between “Proof” and the alignment; use \qedhere in the last line of the alignment.
    – egreg
    Feb 15, 2015 at 13:52
  • Please provide a compilable MWE, what is the definition of environment res?
    – AboAmmar
    Feb 15, 2015 at 13:54
  • Haha thanks for answering again egreg! The \qedhere trick works a dream :) what do you mean by add some text? It doesn't seem to reduce the line spacing, and anyway I don't want any text between the two. Feb 15, 2015 at 13:55
  • sorry @AboAmmar I will edit the question Feb 15, 2015 at 13:58
  • @AerinmundFagelson: Thanks for your mail to me: Just use the mouse and select your code, then click on the {} symbol above the editor or press CTRL-K
    – user31729
    Feb 15, 2015 at 14:07

1 Answer 1

4

It's better having some text between the label Proof and the alignment. Use \qedhere in the last line. Note that the attribution should be an optional argument to res.

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

\newtheorem{res}{Result}[section]

\newcommand{\dd}{\mathop{}\!\mathrm{d}}

\begin{document}
\setcounter{section}{3}\setcounter{res}{10} % just to get 3.11

\begin{res}[Bianchi Identity]
\[ \dd \Phi = \varphi \wedge \Phi - \Phi \wedge \varphi \]
\end{res}
\begin{proof}
Just compute the differential as
\begin{align*}
        \dd \Phi &= \dd(\dd \varphi - \varphi \wedge \varphi) \\
                 &= - \dd \varphi \wedge \varphi + \varphi \wedge \dd \varphi \\
                 &= - (\dd \varphi - \varphi \wedge \varphi) \wedge  \varphi + \varphi \wedge (\dd \varphi - \varphi \wedge \varphi) \\
                 &= - \Phi \wedge \varphi + \varphi \wedge \Phi \qedhere
\end{align*}
\end{proof}

\end{document}

enter image description here

The alternative with no text might be

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

\newtheorem{res}{Result}[section]

\newcommand{\dd}{\mathop{}\!\mathrm{d}}

\begin{document}
\setcounter{section}{3}\setcounter{res}{10} % just to get 3.11

\begin{res}[Bianchi Identity]
\[ \dd \Phi = \varphi \wedge \Phi - \Phi \wedge \varphi \]
\end{res}
\begin{proof}
\mbox{}\par\nopagebreak\vspace{-2\baselineskip}\vspace{-\abovedisplayskip}
\begin{align*}
        \dd \Phi &= \dd(\dd \varphi - \varphi \wedge \varphi) \\
                 &= - \dd \varphi \wedge \varphi + \varphi \wedge \dd \varphi \\
                 &= - (\dd \varphi - \varphi \wedge \varphi) \wedge  \varphi + \varphi \wedge (\dd \varphi - \varphi \wedge \varphi) \\
                 &= - \Phi \wedge \varphi + \varphi \wedge \Phi \qedhere
\end{align*}
\end{proof}

\end{document}

enter image description here

3
  • Is it possible to line the two up without adding text? I know it might not look as nice but just to check Feb 15, 2015 at 14:00
  • @AerinmundFagelson Just added. I can't recommend it; words are necessary in proofs.
    – egreg
    Feb 15, 2015 at 14:01
  • I see your point, the first option looks nicest. Thanks again :) Feb 15, 2015 at 14:03

You must log in to answer this question.

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