3

Is there any way from the code below that a number letter/number theorem can be generated? I am trying to achieve a theorem labeled 1.1A.

\documentclass{book}
\usepackage{amsthm}

 \newtheorem{theo}{Theorem}[chapter]
 \newcounter{tmp}

 \begin{document}

 \chapter{Test Chapter}
 \begin{theo}
 test
 \end{theo}

 \begingroup
 \setcounter{tmp}{\value{theo}}% store current value of theorem counter
 \setcounter{theo}{0} %assign desired value to theorem counter
  \renewcommand\thetheo{\Alph{theo}}% locally redefine the representation of    the theorem counter
 \begin{theo}
 test
 \end{theo}
  \endgroup


 \end{document}
  • 1
    Does http://tex.stackexchange.com/questions/43346/how-do-i-get-sub-numbering-for-theorems-theorem-1-a-theorem-1-b-theorem-2 help? – egreg Mar 09 '16 at 21:06
  • 1
    Is the inner theo a sub theorem then? What should 1.1a indicate. Subtheorem a of theorem 1.1? I don't think the group is really necessary –  Mar 09 '16 at 21:07
  • I'm afraid your write-up isn't very clear. Currently, your code generates two theorem-like environments, labelled "Theorem 1.1" and "Theorem A". Please be more specific as to what you're trying to achieve. – Mico Mar 09 '16 at 21:08
  • apologies.. i am trying to achieve a theorem labeled 1.1A – coder123 Mar 09 '16 at 21:09
  • And what does the "A" in "1.1A" stand for? Does Theorem 1.1A represent an entirely separate theorem, or is it a sub-theorem of Theorem 1.1? Please advise. – Mico Mar 09 '16 at 21:12
  • 1
    @coder123: If you're wanting to provide a slight variation of Theorem 1.1, you could use Theorem 1.1'. Could you describe what you're after in better detail? – Werner Mar 09 '16 at 21:15

1 Answers1

3

In my opinion, a 2nd theorem environment which 'depends' on the upper level environment theo is a cleaner solution than to use \begingroup...\endgroup etc. and storing the counter, changing the output etc.

\documentclass{book}
\usepackage{amsthm}

\newtheorem{theo}{Theorem}[chapter]

\newtheorem{subtheo}{Subheorem}[theo] % Use theo as driver counter
\renewcommand{\thesubtheo}{\thetheo\Alph{subtheo}} % Change subtheo counter for alpha output


\begin{document}

\chapter{Test Chapter}
\begin{theo}
test
\end{theo}

\begin{subtheo}
test
\end{subtheo}


\end{document}

enter image description here