diff --git a/src/wip/refproof.pysty b/src/wip/refproof.pysty index 14c6a1d..9fefbde 100644 --- a/src/wip/refproof.pysty +++ b/src/wip/refproof.pysty @@ -120,6 +120,7 @@ __END_OPTIONS_X__ \def\proofdepth{Depth:~\the__PACKAGE_PREFIX__proofdepth} +%%% A 'smart' proof environment \AtBeginDocument{ \RenewDocumentEnvironment{proof}{s o} { @@ -156,3 +157,25 @@ __END_OPTIONS_X__ } } +\NewDocumentEnvironment{subproof}{s o} +{ + \stepcounter{__PACKAGE_PREFIX__proofdepth} + %Save the current claim counter + \setcounter{__PACKAGE_PREFIX__save@claim}{\value{claim}} + \setcounter{claim}{0} + \def\theclaim{\arabic{claim}} + __PACKAGE_MACRO__(saved@subproof)[% + \IfBooleanTF{#1}{% + \translate{Subproof*}% + }{% + \translate{Subproof}% + }% + \IfValueT{#2}{\space(#2)}% + ] +} +{ + __PACKAGE_MACRO__(saved@endproof) + %Restore previous claim counter + \setcounter{claim}{\value{__PACKAGE_PREFIX__save@claim}} + \addtocounter{__PACKAGE_PREFIX__proofdepth}{-1} +} diff --git a/tests/wip/proof/test.tex b/tests/wip/proof/test.tex index 7af634f..ac7be22 100644 --- a/tests/wip/proof/test.tex +++ b/tests/wip/proof/test.tex @@ -9,9 +9,18 @@ \begin{document} \section{test} + +\begin{subproof} + test +\end{subproof} + +\begin{subproof}*[hi] + test +\end{subproof} + \begin{proof} Beginn des Beweises: - \begin{proof} + \begin{proof}* Ein unterbeweis \end{proof} Jetzt sind wir fertig.