diff --git a/src/wip/proof.pysty b/src/wip/proof.pysty index fe81afb..ebbcff9 100644 --- a/src/wip/proof.pysty +++ b/src/wip/proof.pysty @@ -2,6 +2,7 @@ __HEADER__(Automatic references to theorems in proofs. Claim counters within pro \RequirePackage{xkeyval} \RequirePackage{refcount} +\RequirePackage{translator} __LANGUAGE_OPTIONS_X__ @@ -12,12 +13,57 @@ __END_OPTIONS_X__ \RequirePackage{etoolbox} \RequirePackage{xparse} +\newtranslation[to = English]{Claim}{Claim} +\newtranslation[to = German]{Claim}{Behauptung} +\newtranslation[to = English]{claim}{claim} +\newtranslation[to = German]{claim}{Behauptung} + +\newtranslation[to = English]{Proof}{Proof} +\newtranslation[to = German]{Proof}{Beweis} +\newtranslation[to = English]{proof}{proof} +\newtranslation[to = German]{proof}{Beweis} + +\newtranslation[to = English]{Proof*}{Proof*} +\newtranslation[to = German]{Proof*}{Beweis*} +\newtranslation[to = English]{proof*}{proof*} +\newtranslation[to = German]{proof*}{Beweis*} + +\newtranslation[to = English]{Proof of}{Proof of} +\newtranslation[to = German]{Proof of}{Beweis von} +\newtranslation[to = English]{proof of}{proof of} +\newtranslation[to = German]{proof of}{Beweis von} + +\newtranslation[to = English]{Proof* of}{Proof* of} +\newtranslation[to = German]{Proof* of}{Beweis* von} +\newtranslation[to = English]{proof* of}{proof* of} +\newtranslation[to = German]{proof* of}{Beweis* von} + +\newtranslation[to = English]{Continuation of proof}{Continuation of proof} +\newtranslation[to = German]{Continuation of proof}{Fortsetzung des Beweises} +\newtranslation[to = English]{continuation of proof}{continuation of proof} +\newtranslation[to = German]{continuation of proof}{Fortsetzung des Beweises} + +\newtranslation[to = English]{Continuation of proof of}{Continuation of proof of} +\newtranslation[to = German]{Continuation of proof of}{Fortsetzung des Beweises zu} +\newtranslation[to = English]{continuation of proof of}{continuation of proof of} +\newtranslation[to = German]{continuation of proof of}{Fortsetzung des Beweises zu} + +\newtranslation[to = English]{Continuation of proof*}{Continuation of proof*} +\newtranslation[to = German]{Continuation of proof*}{Fortsetzung des Beweises*} +\newtranslation[to = English]{continuation of proof*}{continuation of proof*} +\newtranslation[to = German]{continuation of proof*}{Fortsetzung des Beweises*} + +\newtranslation[to = English]{Continuation of proof* of}{Continuation of proof* of} +\newtranslation[to = German]{Continuation of proof* of}{Fortsetzung des Beweises* zu} +\newtranslation[to = English]{continuation of proof* of}{continuation of proof* of} +\newtranslation[to = German]{continuation of proof* of}{Fortsetzung des Beweises* zu} + %%Give claim an own counter and let it reset at each proof %See also at: %https://tex.stackexchange.com/questions/283502/reset-counter-at-beginning-of-proof -\newtheorem{claim}{__IF__(english) Claim\else Behauptung\fi} -\newtheorem*{claim*}{__IF__(english) Claim\else Behauptung\fi} -\AtBeginDocument{\def\claimautorefname{__IF__(english) Claim\else Behauptung\fi}} +\newtheorem{claim}{\translate{Claim}} +\newtheorem*{claim*}{\translate{Claim}} +\AtBeginDocument{\def\claimautorefname{\translate{Claim}}} __NEW_IF__(hyperref,false) \AtBeginDocument{ @@ -38,11 +84,11 @@ __NEW_IF__(hyperref,false) % Restore correct counter for claim \ifcsdef{the__PACKAGE_PREFIX__#2@save@claim}{ \setcounter{claim}{\value{__PACKAGE_PREFIX__#2@save@claim}} - \def__PACKAGE_MACRO__(proofprefix){__IF__(english) Continuation of proof\IfBooleanT{#1}{*}\space of\else Fortsetzung des Beweises\IfBooleanT{#1}{*}\space zu\fi} + \def__PACKAGE_MACRO__(proofprefix){\IfBooleanTF{#1}{\translate{Continuation of proof* of}}{\translate{Continuation of proof of}}} }{ \newcounter{__PACKAGE_PREFIX__#2@save@claim} \setcounter{claim}{0} - \def__PACKAGE_MACRO__(proofprefix){__IF__(english) Proof\ifBooleanT{#1}{*}\space of\else Beweis\IfBooleanT{#1}{*}\space von\fi} + \def__PACKAGE_MACRO__(proofprefix){\IfBooleanTF{#1}{\translate{Proof* of}}{\translate{Proof of}}} } % Set up counter number printing as subindexed by numbering of the reference \let__PACKAGE_MACRO__(theoldclaim)\theclaim @@ -60,23 +106,15 @@ __NEW_IF__(hyperref,false) \AtBeginDocument{ \RenewDocumentEnvironment{proof}{s o} { - \IfNoValueTF{#2}{ - __PACKAGE_MACRO__(saved@proof)[ - __IF__(english) - Proof\IfBooleanT{#1}{\emph{*}} - \else - Beweis\IfBooleanT{#1}{\emph{*}} - \fi - ] - }{ - __PACKAGE_MACRO__(saved@proof)[__IF__(english) Proof\else Beweis\fi\IfBooleanT{#1}{\emph{*}}\space(#2)] - } + __PACKAGE_MACRO__(saved@proof)[\IfBooleanTF{#1}{\translate{Proof*}}{\translate{Proof}}\IfValueT{#2}{\space(#2)}] } { __PACKAGE_MACRO__(saved@endproof) } } +\NewDocumentEnvironment{oldproof}{}{__PACKAGE_MACRO__(saved@proof)}{__PACKAGE_MACRO__(saved@endproof)} + %%subproof environment - essentially copied proof environment from amsthm and modified its name + symbol \DeclareRobustCommand{\blackqed}{% \ifmmode \mathqed diff --git a/tests/wip/proof/test.tex b/tests/wip/proof/test.tex index 3292124..9e4e81b 100644 --- a/tests/wip/proof/test.tex +++ b/tests/wip/proof/test.tex @@ -1,5 +1,6 @@ -\documentclass[german]{article} +\documentclass[ngerman]{article} +\usepackage{babel} \usepackage{mkessler-proof} \usepackage{mkessler-fancythm} \usepackage{mkessler-hypersetup} @@ -45,21 +46,21 @@ Nun kommen wir wieder zurück zum eigentlichen Beweis: Aus \autoref{cl:qed} und \autoref{cl:würzburg} folgt nun die Aussage. \end{refproof} -a -\begin{proof} - first -\end{proof} -a \begin{proof}[anm] second \end{proof} -a +\begin{proof} + first +\end{proof} \begin{proof}* third \end{proof} -a \begin{proof}*[anm] fourth \end{proof} +\begin{oldproof} + test +\end{oldproof} + \end{document}