Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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 May 9 '13 at 15:01
1  
I think what I am trying to do is closer to this - tex.stackexchange.com/questions/101814/… –  conorsomahony May 9 '13 at 15:24

1 Answer 1

up vote 4 down vote accepted
\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

share|improve this answer
    
Hi kan, thanks for the answer. –  conorsomahony May 9 '13 at 15:28
    
@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 May 9 '13 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... –  conorsomahony May 9 '13 at 15:35
    
@conorsomahony Oh, good catch, I'll update my answer, just a few moments please... :) –  kan May 9 '13 at 15:37
1  
@conorsomahony See my update. :) –  kan May 9 '13 at 16:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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