summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/reptheorem/reptheorem.sty28
1 files changed, 15 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/reptheorem/reptheorem.sty b/Master/texmf-dist/tex/latex/reptheorem/reptheorem.sty
index 8faae5eb735..ea3a91171b8 100644
--- a/Master/texmf-dist/tex/latex/reptheorem/reptheorem.sty
+++ b/Master/texmf-dist/tex/latex/reptheorem/reptheorem.sty
@@ -18,14 +18,14 @@
%%
%% This work has the LPPL maintenance status `maintained'.
%%
-%% The Current Maintainer of this work is Jesse Sraat.
+%% The Current Maintainer of this work is Jesse Straat.
%%
%% This work consists of the main file reptheorem.dtx
%% and the derived files
%% reptheorem.sty, reptheorem.pdf, reptheorem.ins
%%
-\ProvidesPackage{reptheorem}[2024-08-12 v1.1 Reptheorem package]
+\ProvidesPackage{reptheorem}[2024-09-22 v1.2 Reptheorem package]
\def\reptheorem@theoremfile{\relax}
\NewDocumentCommand{\theoremfile}{ O{\jobname.thm} }{
\def\reptheorem@theoremfile{#1}
@@ -49,25 +49,29 @@ File #1 not found. I will not import any theorems.%
\begin{#1}\label{#2}
}
#4
-\end{#1}
-\expandafter\gdef\csname thmtype@#2\endcsname{#1}
+\expandafter\gdef\csname thmtype@#2\endcsname{#1}%
\expandafter\long\expandafter\gdef\csname thm@#2\endcsname{#4}%
+\IfValueT{#3}{% Only save theorem name if it exists
\expandafter\gdef\csname thmdesc@#2\endcsname{#3}%
-\long\gdef\@thmoutput{%
+}
+\expandafter\long\expandafter\gdef\csname thmoutput@#2\endcsname{%
\string\expandafter\string\gdef\noexpand%
\csname thmtype@#2\string\endcsname{#1}%
^^J%
\string\expandafter\string\long\string\expandafter%
\string\gdef\noexpand\csname thm@#2\string\endcsname{#4}%
+\IfValueT{#3}{
^^J%
\string\expandafter\string\gdef\noexpand%
\csname thmdesc@#2\string\endcsname{#3}%
}
-\write\@auxout{\@thmoutput}
+}
+\write\@auxout{\csname thmoutput@#2\endcsname}
\if\reptheorem@theoremfile\relax
\else
-\write\@thmlist{\@thmoutput}
+\write\@thmlist{\csname thmoutput@#2\endcsname}
\fi
+\end{#1}
}{}
\newcounter{old@counter}
\NewDocumentCommand{\repthm}{ m +o }{
@@ -81,17 +85,16 @@ File #1 not found. I will not import any theorems.%
\def\thetheorem{\ref{#1}}
\let\@@theoremnotdefined\relax
\ifcsname thm@#1\endcsname% Check if theorem is even defined
-\expandafter\edef\expandafter\@@thmdesc{\csname thmdesc@#1\endcsname}%
\expandafter\let\expandafter\@@thm\csname thm@#1\endcsname
-\IfValueTF{\@@thmdesc}{% Check if theorem has name
-\begin{\@@thmtype}[\@@thmdesc]
+\ifcsname thmdesc@#1\endcsname % Check if theorem has name
+\begin{\@@thmtype}[\csname thmdesc@#1\endcsname]
\@@thm
\end{\@@thmtype}
-}{% No optionals
+\else % No optionals
\begin{\@@thmtype}
\@@thm
\end{\@@thmtype}
-}
+\fi
\else
\IfValueTF{#2}{
\begin{\@@thmtype}
@@ -111,7 +114,6 @@ using the optional parameter%
\setcounter{\@@thmtype}{\value{old@counter}}
\endgroup
}
-
\endinput
%%
%% End of file `reptheorem.sty'.