2

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}
6
  • 1
    Does tex.stackexchange.com/questions/43346/… help? – egreg Mar 9 '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 – user31729 Mar 9 '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 9 '16 at 21:08
  • apologies.. i am trying to achieve a theorem labeled 1.1A – coder123 Mar 9 '16 at 21:09
  • 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 9 '16 at 21:15
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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