2

I have defined this environment:

\newenvironment{proofln}{\par \textbf{Proof}\list{}{\leftmargin=10pt\rightmargin=0pt\topsep=0pt}\item\relax}{\endlist\textbf{Q.E.D}}

Now I use it like this:

\begin{proofln}
    \setlength{\abovedisplayskip}{0pt}
    \setlength{\belowdisplayskip}{0pt}
\begin{flalign*}
    &am + bn + (K-K) = d&\\
    &= am + K + bn - K&\\
    &= am + Kab + bn - Kab&\\
    &= a(m + Kb) + b(n - Ka)&
\end{flalign*}
\end{proofln}
\begin{proofln}
    abcd
\end{proofln}

And the flaign is still inserting spaces above for some reason.
The bottom proofln is also doing weird - the spacing between content and "Proof" and content and "Q.E.D" is not equal.

enter image description here

How can I fix these issues?

2

For some reasons the amsmath environments insert an extra vertical space of \baselineskip here. So one fix is to back up by this amount. Below I have captured the adjustments in a new environment you can place around the equation.

Sample output

\documentclass{amsart}

\newenvironment{proofln}{\par\noindent\textbf{Proof}\list{}{\leftmargin=10pt\rightmargin=0pt\topsep=0pt}\item\relax}{\endlist\noindent\textbf{Q.E.D}}

\newenvironment{fixmathspace}{\abovedisplayskip=0pt\abovedisplayshortskip=0pt\belowdisplayskip=0pt\belowdisplayshortskip=0pt\vspace{-\baselineskip}}{}

\begin{document}

\begin{proofln}
  \begin{fixmathspace}
    \begin{flalign*}
      &am + bn + (K-K) = d&\\
      &= am + K + bn - K\\
      &= am + Kab + bn - Kab\\
      &= a(m + Kb) + b(n - Ka)
    \end{flalign*}
  \end{fixmathspace}
\end{proofln}

\begin{proofln}
  \begin{fixmathspace}
    \begin{equation*}
      x = y
    \end{equation*}
  \end{fixmathspace}
\end{proofln}

\begin{proofln}
  abcd
\end{proofln}

\end{document}

Note that there are short versions of the displayskips, that are usually zero plus some glue, that I have also put to zero in the above code. They apply to the second equation above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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