4

I'm trying to number theorems in by number and letter, where each group of letters is of different size. The theorems are linked together and I would like to show it in the text. I use the ntheorem package but don't understand how to change the default numbering order.

\documentclass{article}
\usepackage{ntheorem}
\newtheorem{theorem}{Hypothesis}

\begin{document}

\begin{theorem}
This is theorem 1 (should be 1a)
\end{theorem}

\begin{theorem}
This is theorem 2 (should be 1b)
\end{theorem}

\begin{theorem}
This is theorem 2 (should be 2a)
\end{theorem}

\end{document}
1
  • 2
    It's not obvious from reading your example how you expect LaTeX to know that the third theorem there should increment the "number" part of the number and start over with the "letter" part. Maybe you need a new environment which the grouped theorems can sit inside, as in \begin{theoremgroup} ... (grouped theorems go here) ... \end{theoremgroup}? – Hammerite Dec 1 '13 at 16:43
7

This is a possible solution.

Each time you want to increment the number you have to issue the command \theoremgroup.

Code:

\documentclass{article}
\usepackage{ntheorem}
\newtheorem{theorem}{Hypothesis}

\usepackage{chngcntr}
\newcounter{pretheorem}
\counterwithin{theorem}{pretheorem}

\renewcommand\thetheorem{\arabic{pretheorem}\alph{theorem}}
\newcommand{\theoremgroup}{\refstepcounter{pretheorem}}

\begin{document}

\theoremgroup
\begin{theorem}
This is theorem 1a
\end{theorem}

\begin{theorem}
This is theorem 1b
\end{theorem}

\theoremgroup
\begin{theorem}
This is theorem 2a
\end{theorem}

\end{document} 

Output:

enter image description here

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