I am using krantz-single.sty in which the environments example and theorem are already defined with its own fonts, numbering (according to chapter) etc. I would like to number examples and theorems consecutively. So, I cannot use amsthm.sty to define Example as a newtheorem. I need only the counter for numbering to change. How to do it?
Asked
Active
Viewed 143 times
1
Arvind
- 111
1 Answers
3
Warning: the krantz_single package looks a little bit strange. It has counters named THEOREM or Example, so there's not really a consistent naming scheme.
However, the shared feature can be achieved with the concept of coupled counters from the xassoccnt package.
The advantage of the xassoccnt package is that it allows for an 'arbitrary' number of counter names as being coupled (well, nobody would do that really!)
Just define a group name, say krantz and fill the group with the name of the counters, THEOREM and Example here with \DeclareCoupledCounters.
The counters are consecutively stepped each time each member of the counter group is increased with \stepcounter or \refstepcounter.
\documentclass[a4paper]{book}
\usepackage{krantz_single}
\usepackage{xassoccnt}
\DeclareCoupledCountersGroup{krantz}
\DeclareCoupledCounters[name=krantz]{THEOREM,Example}
\begin{document}
\begin{theorem} This is first theorem, Theorem~0.1.
\end{theorem}
\begin{example} This example should be numbered 0.2.
\end{example}
\begin{theorem} This is second theorem, to be numbered Theorem~0.3
\end{theorem}
\end{document}

examplecounter be exactly (say) thetheoremcounter. For this, you can use any of the methods described in Slave duplicate counter (possible duplicate). – Werner Sep 24 '16 at 05:35Krantz-single.stybe found? – barbara beeton Sep 24 '16 at 13:48\documentclass[a4paper]{book} \usepackage{krantz_single}
\begin{document}
\begin{theorem} This is first theorem, Theorem~0.1. \end{theorem} \begin{example} This example should be numbered 0.2. \end{example} \begin{theorem} This is second theorem, to be numbered Theorem~0.3 \end{theorem} \end{document}
– Arvind Sep 26 '16 at 09:22