Page LayoutMath environment within a list.

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

Math environment within a list.

Post by lucia_ »

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:

Code: Select all

\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:

Code: Select all

\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:

Code: Select all

\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?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Math environment within a list.

Post by Ijon Tichy »

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.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
lucia_
Posts: 7
Joined: Mon Sep 14, 2020 4:04 pm

Math environment within a list.

Post by lucia_ »

Hi Ijon,

That worked wonderfully.

Thanks so much for your help! :)

Lucia
Post Reply