4

I have a problem that I could not solve, even after looking around for a while on the site.

Quite simply, I do like how the following MWE looks like in terms of spacing, but I would like to have the claims numbered within each proof starting from 1.

\documentclass{article}
\usepackage{amsmath}%
\usepackage{amsthm}%
\usepackage{amsfonts}%
\usepackage{amssymb}%

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}

\theoremstyle{remark}
\newtheorem{claim}{Claim}

\begin{document}

\begin{theorem}
Bla
\end{theorem}

\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}

\begin{theorem}
Bla
\end{theorem}

\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}

\end{document}

The problem is that all the solutions I found modified in some way the present spacing between the objects, which is the default look.

Is it possible to avoid such a situation?

Thank you for your time.

1 Answer 1

3

This may be what you want.

\usepackage{etoolbox}
\AtEndEnvironment{proof}{\setcounter{claim}{0}}

Here we reset the claim counter after each proof environment.

\documentclass{article}
\usepackage{amsmath}%
\usepackage{amsthm}%
\usepackage{amsfonts}%
\usepackage{amssymb}%

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}

\theoremstyle{remark}
\newtheorem{claim}{Claim}
%\numberwithin{claim}{theorem} %% <-- This is another alternative if you like little difference.
\usepackage{etoolbox}
\AtEndEnvironment{proof}{\setcounter{claim}{0}}
\begin{document}

\begin{theorem}
Bla
\end{theorem}

\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}

\begin{theorem}
Bla
\end{theorem}

\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}

\end{document}

enter image description here

6
  • Clean and smooth. Great answer, thanks a lot!
    – Kolmin
    Commented May 18, 2016 at 4:27
  • Just wondering, a sudden curiosity. In case I would like to have only one unnumbered claim, how could I obtain it? (e.g. assume that in theorem 2 there is only one claim, which I would leave unnumbered) Thanks a lot, and sorry for the late curiosity.
    – Kolmin
    Commented May 18, 2016 at 4:38
  • 1
    @Kolmin \newtheorem* is for such purposes. Declare \newtheorem*{myclaim}{Claim} and then \begin{myclaim}...\end{myclaim} will not be numbered.
    – user11232
    Commented May 18, 2016 at 8:58
  • 1
    since you're using amsthm, you should be able to use \qedhere before the last \end{claim} to move the tombstone up to the last line, not have it on a line by itself. Commented May 18, 2016 at 14:19
  • @HarishKumar: Thanks a lot! I knew I could do it in such a way, but I thought that maybe there was another option.
    – Kolmin
    Commented May 18, 2016 at 16:06

You must log in to answer this question.

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