LaTeX forum ⇒ Page LayoutMath environment within a list.

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
lucia_
Posts: 7
Joined: Mon Sep 14, 2020 4:04 pm

Math environment within a list.

Postby lucia_ » Thu Apr 29, 2021 2:37 pm

Hi everyone,

I am writing an essay and I am using amsthm to create "claim" and "proof" math environments. Usually when one uses a "proof" environment, Latex creates an empty line before the proof. For example:

\documentclass{report}
\usepackage{amsthm}
\theoremstyle{remark}
\newtheorem{claim}{Claim}[chapter]
\begin{document}
\begin{claim}
This is a claim.
\end{claim}
\begin{proof}
This is a proof.
\end{proof}
\end{document}


I wanted to remove this line, so I did the following:

\documentclass{report}
\usepackage{amsthm}
\theoremstyle{remark}
\newtheorem{claim}{Claim}[chapter]

\newenvironment{claimproof}
  {\vspace{-1pc}\proof}
  {\endproof}

\begin{document}
\begin{claim}
This is a claim.
\end{claim}
\begin{claimproof}
This is a proof.
\end{claimproof}
\end{document}


However, I've noticed that when I am within an enumerate environment, it no longer works:

\documentclass{report}
\usepackage{amsthm}
\usepackage{enumitem}
\theoremstyle{remark}
\newtheorem{claim}{Claim}[chapter]

\newenvironment{claimproof}
  {\vspace{-1pc}\proof}
  {\endproof}

\begin{document}
\begin{enumerate}
	\item Hello. This is some text in a list. Hello hello. This is some text in a list. Some text in a list. ajsdhsdkfjhsdkfjashkdfjdshkf.
	\begin{claim}
	This is a claim.
	\end{claim}
	\begin{claimproof}
	This is a proof.
	\end{claimproof}
\end{enumerate}
\end{document}


Does anyone know how to keep that space before the proof removed, even when I am within an enumerate environment?

User avatar
Ijon Tichy
Posts: 464
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Thu Apr 29, 2021 4:02 pm

This is the paragraph separation, that is the default of enumerate environments. You are already using package enumitem. So you could try \begin{enumerate}[parsep=0pt] or \begin{enumerate}[nosep]. For more information see the enumitem manual.

lucia_
Posts: 7
Joined: Mon Sep 14, 2020 4:04 pm

Postby lucia_ » Thu May 06, 2021 2:18 pm

Hi Ijon,

That worked wonderfully.

Thanks so much for your help! :)

Lucia


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 3 guests