summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/projlib/PJLthm.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-30 20:15:57 +0000
committerKarl Berry <karl@freefriends.org>2021-07-30 20:15:57 +0000
commitc5b0b7223927e0d1ed15233367e14940f33d044a (patch)
treed55098f52591dfb53faa3c6b11af9e7ad9e1261b /Master/texmf-dist/tex/latex/projlib/PJLthm.sty
parentd716afa974239e84535924a3485ace7d2f979bb1 (diff)
projlib (30jul21)
git-svn-id: svn://tug.org/texlive/trunk@60118 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/projlib/PJLthm.sty')
-rw-r--r--Master/texmf-dist/tex/latex/projlib/PJLthm.sty37
1 files changed, 31 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/projlib/PJLthm.sty b/Master/texmf-dist/tex/latex/projlib/PJLthm.sty
index bd9fb06472a..f4070b90412 100644
--- a/Master/texmf-dist/tex/latex/projlib/PJLthm.sty
+++ b/Master/texmf-dist/tex/latex/projlib/PJLthm.sty
@@ -17,7 +17,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesPackage{PJLthm}
- [2021/07/27 Theorem setup and configuration]
+ [2021/07/30 Theorem setup and configuration]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{%
@@ -26,10 +26,15 @@
}
\DeclareBoolOption[false]{nothms}
\DeclareBoolOption[false]{nothmnum}
+\DeclareStringOption{thmnum}[PJL@thmnum@default]
\DeclareBoolOption[false]{draft}
\DeclareBoolOption[false]{fast}
-\DeclareBoolOption[false]{regionalref}
+\DeclareBoolOption[true]{regionalref}
+\DeclareBoolOption[false]{originalref}
\ProcessKeyvalOptions*\relax
+\if@PJLthm@originalref
+ \@PJLthm@regionalreffalse
+\fi
\if@PJLthm@draft
\@PJLthm@fasttrue
\fi
@@ -508,6 +513,18 @@
}{
\newaliascnt{PJLthm@highest}{section}
}
+\NewDocumentCommand{\CreateTheorem@thmnum}{m}{
+ \expandafter\ifstrempty\expandafter{\@PJLthm@thmnum}{
+ \CreateTheorem{#1}<PJLthm@highest>
+ }{
+ \expandafter\ifstrequal\expandafter{\@PJLthm@thmnum}{PJL@thmnum@default}{
+ \CreateTheorem{#1}
+ }{
+ \CreateTheorem{#1}<\@PJLthm@thmnum>
+ }
+ }
+}
+\AtEndPreamble{
\if@PJLthm@nothms\else
\if@PJLthm@nothmnum
\CreateTheorem*{theorem}
@@ -520,7 +537,7 @@
\CreateTheorem*{fact}
\CreateTheorem*{conjecture}
\else
-\CreateTheorem{theorem}<PJLthm@highest>
+\CreateTheorem@thmnum{theorem}
\CreateTheorem{lemma}[theorem]
\CreateTheorem{proposition}[theorem]
\CreateTheorem{corollary}[theorem]
@@ -580,14 +597,22 @@
\CreateTheorem*{remark}
\CreateTheorem*{observation}
\else
-\CreateTheorem{remark}<PJLthm@highest>
-\CreateTheorem{observation}<PJLthm@highest>
+\CreateTheorem@thmnum{remark}
+\CreateTheorem@thmnum{observation}
\fi
\CreateTheorem*{remark*}
\CreateTheorem*{observation*}
\fi
+}
-\numberwithin{equation}{PJLthm@highest}
+\expandafter\ifstrempty\expandafter{\@PJLthm@thmnum}{
+ \numberwithin{equation}{PJLthm@highest}
+}{
+ \expandafter\ifstrequal\expandafter{\@PJLthm@thmnum}{PJL@thmnum@default}{
+ }{
+ \numberwithin{equation}{\@PJLthm@thmnum}
+ }
+}
\gappto{\PJLlang@langconfig@chinese}{%
\crefname{equation}{式}{式}%