1

I am using thmtools as a front end to amsthm and I have a definition environment as follows.

\declaretheorem[
    style=mydefinitionstyle,
    name=Definition,
    numberwithin=chapter
]{definition}

And what I want is another environment, say called definitionAlt, which would be used to give an alternative definition of the one just given, i.e., it uses the same number/counter as the definition just given but adds an "a" (or "b" or whatever), without incrementing the counter, and cross-referencing would still work.

\begin{definition}
\label{def:main_definition}
This is a definition which is numbered 1.1
\end{definition}

\begin{definitionAlt}
\label{def:alt_definition}
This is an alternative definition to the preceding one, which is automatically numbered 1.1a
\end{definitionAlt}

I have seen similar questions such as What’s the most straightforward way to typeset theorems etc. when the numbering is entirely manual?

which does some manual theorem numbering, but I cant find an answer that does exactly what I want.

Doe anyone have any suggestions?

2
  • This has come up several types. This is possible with counters. Just define a new counter, call it defntype, which is \alph and hook that counter to this environment.
    – kan
    Commented May 9, 2013 at 15:01
  • 1
    I think what I am trying to do is closer to this - tex.stackexchange.com/questions/101814/… Commented May 9, 2013 at 15:24

1 Answer 1

4
\documentclass{report}
\usepackage{thmtools} 
\declaretheorem[
    style=mydefinitionstyle,
    name=Definition,
    numberwithin=chapter
]{definition}

\declaretheorem[
    style=mydefinitionstyle,
    name=Definition,
    numberwithin=definition,
]{definitionAlt}
\renewcommand\thedefinitionAlt{\thedefinition\alph{definitionAlt}}

\begin{document}
\chapter{Testing Alternate Definitions Counter} 
\begin{definition}
\label{def:main_definition}
This is a definition which is numbered 1.1
\end{definition}

\begin{definitionAlt}
\label{def:alt_definitiona}
This is an alternative definition to the preceding one, which is automatically numbered 1.1a
\end{definitionAlt} 

\begin{definitionAlt}
\label{def:alt_definitionb}
This is an alternative definition to the preceding one, which is automatically numbered 1.1b.
\end{definitionAlt} 

\begin{definition}
\label{def:another_main_definition}
This is a definition which is numbered 1.2.
\end{definition}
And, of course, I can refer to my second alternate definition, the definition \ref{def:alt_definitionb} and my another definition, the definition \ref{def:another_main_definition} quite well!

\begin{definitionAlt}
\label{def:new_alt_definitiona}
This is an alternative definition to the preceding one, which is automatically numbered 1.2a.
\end{definitionAlt} 

begin{definition}
\label{def:yet_another_main_definition}
This is a definition which is numbered 1.3.
\end{definition}
\end{document} 

Thanks to Marco Daniel for his help on this one!.


The Output

Here it goes:

defntypeenviron.png

9
  • @conorsomahony Glad to have helped! If this answer is what you were looking for, could you please accept this by clicking on the tick mark besides this answer? :)
    – kan
    Commented May 9, 2013 at 15:31
  • I just noticed one small issue, the alph part of the counter doesn't get reset, so If I add another definitionAlt after Definition 1.2 - then this gets the number 1.2c, instead of 1.2a again... Commented May 9, 2013 at 15:35
  • @conorsomahony Oh, good catch, I'll update my answer, just a few moments please... :)
    – kan
    Commented May 9, 2013 at 15:37
  • 1
    @conorsomahony See my update. :)
    – kan
    Commented May 9, 2013 at 16:14
  • @kan -- er, you want to repair the text for def. 1.2a -- it now purportedly refers to itself. (i don't want to make the change, since i would undoubtedly bollix up the output.) Commented May 9, 2013 at 16:33

You must log in to answer this question.

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