I'm texing my university lecture notes and want to include some problems with solutions in the document.
What I want:
- While all other
amsthm
environments are consecutively numberedDefinition 1.1
,Theorem 1.2
, etc., I want to have problem numbersProblem 1.A
,Problem 1.B
,Problem 2.A
, etc. - For each problem I want to have a solution with exactly the same printed counter
1.A
,1.B
,2.A
, etc. Naturally, one could just use a separatesolution
counter and callproblem
andsolution
the same number of times. - The solutions should appear at the end of the document in their own section, so some kind of deferred printing. Thus the above approach doesn't work, since the first number, the section number, doesn't correspond anymore.
Do you have any packages or ideas on implementing this? Should I use ntheorem
for that? Any help is welcomed.
Edit (@Werner): My question is actually fairly general, and therefore I think a description wouldn't help as much. But here is my setup anyway: I have my custom package and use amsthm
. I use the article
documentclass. At the moment, the theorem-like environments look as follows:
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mypackage}
\RequirePackage[T1]{fontenc}
\RequirePackage[ngerman=ngerman-x-latest]{hyphsubst}
\RequirePackage[ngerman]{babel}
\RequirePackage{amsmath}
\RequirePackage{amsthm}
\newtheorem{theorem}{Satz}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{corollary}{Korollar}[section]
\newtheorem{axiom}{Axiom}[section]
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem*{notation}{Bezeichnung}
\newtheorem{problem}{Aufgabe}[section] %These two environments
\newtheorem{solution}{Lösung}[section] %are of interest
\theoremstyle{remark}
\newtheorem{example}{Beispiel}[section]
\newtheorem*{remark}{Bemerkung}
\newtheorem{case}{Fall}
%Replace all theorem environment counters except `problem` and
%`solution` by `equation` counter. Therfore, they share the counter
%with equation, but still have the preceeding section number.
%Maybe you have a better way, let me know.
\renewcommand*{\c@theorem}{\c@equation}
\renewcommand*{\c@lemma}{\c@equation}
\renewcommand*{\c@corollary}{\c@equation}
\renewcommand*{\c@axiom}{\c@equation}
\renewcommand*{\c@definition}{\c@equation}
\renewcommand*{\c@example}{\c@equation}
%Reset `case` counter
\@addtoreset{case}{theorem}
\@addtoreset{case}{lemma}
\@addtoreset{case}{corollary}
article
type class. Is the 1 in problem 1.A referring to the section? But then you're talking about “the end of each chapter”, so my initial guess seems wrong. Can you please clarify? How should equation numbers be typeset? With the section number or not?