From 58aa1ac09b1d9e4769d0a0661cf12e2b2db41b14 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sat, 22 May 2021 03:00:53 +0000
Subject: CTAN sync 202105220300

---
 macros/latex/contrib/projlib/ProjLib.dtx | 94 ++++++++++++++++++++++++++++----
 1 file changed, 84 insertions(+), 10 deletions(-)

(limited to 'macros/latex/contrib/projlib/ProjLib.dtx')

diff --git a/macros/latex/contrib/projlib/ProjLib.dtx b/macros/latex/contrib/projlib/ProjLib.dtx
index 94e4aa5d8e..12abe0328e 100644
--- a/macros/latex/contrib/projlib/ProjLib.dtx
+++ b/macros/latex/contrib/projlib/ProjLib.dtx
@@ -18,47 +18,47 @@
 %
 %<*PJLamssim>
 \ProvidesPackage{PJLamssim}
-    [2021/05/19 Simulate some features of amsart]
+    [2021/05/20 Simulate some features of amsart]
 %</PJLamssim>
 %
 %<*PJLauthor>
 \ProvidesPackage{PJLauthor}
-    [2021/05/19 Enhanced author information block]
+    [2021/05/20 Enhanced author information block]
 %</PJLauthor>
 %
 %<*PJLdate>
 \ProvidesPackage{PJLdate}
-    [2021/05/19 Convert yyyy-mm-dd to normal datetime format]
+    [2021/05/20 Convert yyyy-mm-dd to normal datetime format]
 %</PJLdate>
 %
 %<*PJLdraft>
 \ProvidesPackage{PJLdraft}
-    [2021/05/19 Some useful macros for the draft stage]
+    [2021/05/20 Some useful macros for the draft stage]
 %</PJLdraft>
 %
 %<*PJLlang>
 \ProvidesPackage{PJLlang}
-    [2021/05/19 Multi-language configuration]
+    [2021/05/20 Multi-language configuration]
 %</PJLlang>
 %
 %<*PJLlogo>
 \ProvidesPackage{PJLlogo}
-    [2021/05/19 The ProjLib logo]
+    [2021/05/20 The ProjLib logo]
 %</PJLlogo>
 %
 %<*PJLpaper>
 \ProvidesPackage{PJLpaper}
-    [2021/05/19 Paper style configuration]
+    [2021/05/20 Paper style configuration]
 %</PJLpaper>
 %
 %<*PJLthm>
 \ProvidesPackage{PJLthm}
-    [2021/05/19 Theorem setup and configuration]
+    [2021/05/20 Theorem setup and configuration]
 %</PJLthm>
 %
 %<*PJLtoolkit>
 \ProvidesPackage{PJLtoolkit}
-    [2021/05/19 Collective interface of ProjLib Toolkit]
+    [2021/05/20 Collective interface of ProjLib Toolkit]
 %</PJLtoolkit>
 %
 \RequirePackage{kvoptions}
@@ -764,7 +764,12 @@
     prefix = @PJLthm@
 }
 \DeclareBoolOption[false]{nothms}
+\DeclareBoolOption[false]{fast}
+\DeclareBoolOption[false]{regionalref}
 \ProcessKeyvalOptions*\relax
+\if@PJLthm@fast
+    \@PJLthm@regionalreftrue
+\fi
 
 \RequirePackage{PJLlang}
 \RequirePackage{amsmath,amsthm}
@@ -787,6 +792,69 @@
     {\expandafter\PassFirstToSecond%
         \expandafter{\temp}{\endgroup\InnerCreateTheorem{#1}}}%
 }%
+\if@PJLthm@regionalref
+\NewDocumentCommand{\InnerCreateTheorem}{mmmod<>d()}{%
+% #1 = star or no star
+% #2 = name of environment
+% #3 = emptiness or star to append to name of environment
+% #4 = numbered like
+% #5 = numbered within
+% #6 = existed environment
+    \IfBooleanTF{#1}{%
+        \IfValueTF{#4}
+            {\@firstoftwo}
+            {\IfValueTF{#5}{\@firstoftwo}{\@secondoftwo}}%
+    }{%
+        \IfValueTF{#4}
+            {\IfValueTF{#5}{\@firstoftwo}{\@secondoftwo}}{
+            \@secondoftwo}
+    }%
+    {%
+        \GenericError{}%
+        {\string\CreateTheorem\space syntax error\on@line}{%
+        You cannot call the starred variant with optional argument,\MessageBreak
+        nor call the unstarred variant with several optional arguments.}%
+        {}%
+    }{%
+        \IfValueTF{#6}{%
+            \IfBooleanTF{#1}{%
+                \ifcsmacro{#2#3}%
+                {\renewenvironment{#2#3}{\begin{#6*}}{\end{#6*}}}%
+                {\newenvironment{#2#3}{\begin{#6*}}{\end{#6*}}}%
+            }{%
+                \ifcsmacro{#2#3}%
+                {\renewenvironment{#2#3}{\begin{#6}}{\end{#6}}}%
+                {\newenvironment{#2#3}{\begin{#6}}{\end{#6}}}%
+            }
+        }{%
+            \IfBooleanTF{#1}{%
+                \newtheorem*{#2#3}{\csname#2name\csname\languagename ABBR\endcsname\endcsname}
+            }{%
+                \IfValueTF{#5}{%
+                    \newtheorem{PJL#2#3}{\csname#2name\csname\languagename ABBR\endcsname\endcsname}[#5]%
+                    \newaliascnt{#2#3}{PJL#2#3}%
+                }{%
+                    \IfValueTF{#4}{%
+                            \newtheorem{PJL#2#3}[#4]{\csname#2name\csname\languagename ABBR\endcsname\endcsname}
+                        }{%
+                            \newtheorem{PJL#2#3}{\csname#2name\csname\languagename ABBR\endcsname\endcsname}  
+                            \newaliascnt{#2#3}{PJL#2#3}%
+                        }%
+                }%
+                \crefname{PJL#2#3}%
+                    {\csname#2name\csname\languagename ABBR\endcsname\endcsname}%
+                    {\csname#2name\csname\languagename ABBR\endcsname\endcsname}%
+                \Crefname{PJL#2#3}%
+                    {\csname#2name\csname\languagename ABBR\endcsname\endcsname}%
+                    {\csname#2name\csname\languagename ABBR\endcsname\endcsname}%
+                \NewDocumentEnvironment{#2#3}{}
+                    {\begin{PJL#2#3}}
+                    {\end{PJL#2#3}}
+            }%
+        }%
+    }%
+}%
+\else
 \NewDocumentCommand{\InnerCreateTheorem}{mmmod<>d()}{%
 % #1 = star or no star
 % #2 = name of environment
@@ -853,7 +921,7 @@
             \NewDocumentEnvironment{#2#3}{}
                 {\csname#2\csname\languagename ABBR\endcsname#3\endcsname}%
                 {\csname end#2\csname\languagename ABBR\endcsname#3\endcsname}%
-        }
+        }%
     }%
 }%
 \NewDocumentCommand{\CreateTheoremNumberedLikeAliasCounter}{mmm}{%
@@ -867,6 +935,7 @@
         {\csname#1name#2\endcsname}%
         {\csname#1name#2\endcsname}%
 }%
+\fi
 
 %% English theorems names
 \def\theoremnameEN{Theorem}
@@ -1158,6 +1227,7 @@
 \DeclareBoolOption[false]{author}
 \DeclareBoolOption[false]{amssim}
 \DeclareBoolOption[false]{nothms}
+\DeclareBoolOption[false]{regionalref}
 \DeclareBoolOption[false]{palatino}
 \DeclareBoolOption[false]{times}
 \DeclareBoolOption[false]{garamond}
@@ -1170,10 +1240,14 @@
     \PassOptionsToPackage{fast}{PJLdate}
     \PassOptionsToPackage{fast}{PJLdraft}
     \PassOptionsToPackage{fast}{PJLlogo}
+    \PassOptionsToPackage{fast}{PJLthm}
 \fi
 \if@PJLtoolkit@nothms
     \PassOptionsToPackage{nothms}{PJLthm}
 \fi
+\if@PJLtoolkit@regionalref
+    \PassOptionsToPackage{regionalref}{PJLthm}
+\fi
 
 \if@PJLtoolkit@author
     \RequirePackage{PJLauthor}
-- 
cgit v1.2.3

