How to number nonconsecutive addenda in LaTeX without disrupting original Theorem numbering?

1.3k views Asked by At

I am writing a thesis heavy with Definitions, Theorems, Lemmas and the like. I need to give a basic definition of a concept, and then later in the thesis expand on this definition as more parameters add to the complexity and thus to the definition. So I need something which would look (structurally) like this:

Definition 1

Definition 2

Definition 3

Addendum 1.a (Referring to Definition 1)

Addendum 1.b (Referring to Definition 1 )

Definition 4

Addendum 1.c (Referring to Definition 1)

Addendum 3.a (Referring to Definition 3)

Definition 5

I can't seem to find anything that will let me do this. Does anyone have an idea?

2

There are 2 answers

0
Alexey Malistov On

In preambule:

\newtheorem{Definition}{Definition}
\newtheorem{Addendum}{Addendum}[Definition]
\def\theAddendum{\theDefinition .\alph{Addendum}}

Main text:

\newcount\saveDefCounter

\begin{Definition} ... \end{Definition}
\begin{Definition} ... \end{Definition}
\begin{Definition} ... \end{Definition}

\saveDefCounter\arabic{Definition}
\setcounter{Definition}{1}

\begin{Addendum} ... \end{Addendum}
\begin{Addendum} ... \end{Addendum}

\setcounter{Definition}{\saveDefCounter}

\begin{Definition} ... \end{Definition}
\begin{Definition} ... \end{Definition}
0
Rupert Nash On

Based on Alexey's answer, try

\documentclass{article}
\newtheorem{Definition}{Definition}

\makeatletter
\newenvironment{add}[1]{ % environment has one required arg, a label to follow
  \@ifundefined{c@add@#1}{ % does a private counter exist for the label?
    \newcounter{add@#1} % define if not
  }{ % do nothing if it does
  }
  \stepcounter{add@#1}
  \@begintheorem{Addendum}{\ref{#1}.\csname theadd@#1\endcsname}\ignorespaces
  % use latex internal macro to write the theorem start environment
}{ % end the environment
  \@endtheorem
}
\makeatother

\begin{document}

\begin{Definition}\label{def1} ... \end{Definition}
\begin{Definition}\label{def2} ... \end{Definition}
\begin{Definition}\label{def3} ... \end{Definition}


\begin{add}{def1} ... \end{add}
\begin{add}{def2} ... \end{add}
\begin{add}{def1} ... \end{add}


\begin{Definition} ... \end{Definition}
\begin{Definition} ... \end{Definition}
\end{document}

The add environment must get a label specifying the definition to which it is to append. Put the bit between \makeatletter and \makeatother in a style file if you want to make it reusable.