0

In Theorems 1 and 2, there is extra space between the equation and the proof. In Theorem 3, there isn't. What is causing this in the case of Theorem 2 and how can I get the \proof command not to insert the extra space (without resorting to negative vspace)? I wish to learn about the mechanics (I'm not looking for a package that colors my equations: I'm aware of those).

\documentclass{article}

\usepackage{amsthm,xcolor}
\newtheorem{theorem}{Theorem}


\begin{document}



\begin{theorem}
    blabla
    {\color{red}
    \begin{equation} 
    x
    \end{equation}}%
    \proof
    hi  
\end{theorem}

\begin{theorem}
    blabla
    \begin{equation} \color{red}
    x
    \end{equation}
    \proof
    hi  
\end{theorem}


\begin{theorem}
    blabla
        \begin{equation} {\color{red}
        x}
        \end{equation}%
    \proof
    hi  
\end{theorem}
\end{document}

enter image description here

10
  • 2
    Why do you nest the proof in the theorem?
    – Bernard
    Jan 31, 2020 at 19:52
  • Have you aware that you applied the scope of red color in three different ways? That matter ...
    – Fran
    Jan 31, 2020 at 19:55
  • @bernard Ha. Are you saying that for any theorem/lemma/etc, the \proof should go outside the environment? That doesn't solve the excess spacing issue.
    – JPi
    Jan 31, 2020 at 20:23
  • @Fran Yes, that's the point of the question.
    – JPi
    Jan 31, 2020 at 20:24
  • Inside a theorem environment, you could set \belowdisplayskip to be the same as belowdisplayshortskip.
    – Bernard
    Jan 31, 2020 at 20:27

1 Answer 1

2

The package amsthm provides a proof environment. For implementation reasons, the command \proof exists, but should not be used in a document, because it opens an internal trivlist environment which is not properly closed.

Besides, the proof doesn't belong to the statement, so the environment should go outside theorem.

In order to color (part of) an equation, use \textcolor{<color>}{<math>}.

So the correct way to input the thing is

\documentclass{article}

\usepackage{amsthm,xcolor}

\newtheorem{theorem}{Theorem}

\begin{document}

\begin{theorem}
blabla
\begin{equation}
\textcolor{red}{x}
\end{equation}
\end{theorem}

\begin{proof}
hi
\end{proof}

\end{document}

which has no strange spacing, as you can clearly see.

enter image description here

If you don't want the “tombstone” (aka “end-of-proof symbol”), just add

\renewcommand{\qedsymbol}{}

before \begin{document}.

This said, you're free to shoot on your own foot, but using unsupported commands or syntax is, well, unsupported.

1
  • Thanks @egreg. It doesn't solve my particular problem, but I'll accept your answer and start a new question.
    – JPi
    Feb 3, 2020 at 14:42

You must log in to answer this question.

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