summaryrefslogtreecommitdiff
path: root/macros/luatex/optex/sections.opm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-04-02 03:02:37 +0000
committerNorbert Preining <norbert@preining.info>2020-04-02 03:02:37 +0000
commit0e03b1c035f50863fd828faf12e59f1b3c6850a7 (patch)
treee7d84e3fbaf71d54256d43e2adbb07e82417c077 /macros/luatex/optex/sections.opm
parentcbb8c5a5f12642aa506e68d0eb0503e021804595 (diff)
CTAN sync 202004020302
Diffstat (limited to 'macros/luatex/optex/sections.opm')
-rw-r--r--macros/luatex/optex/sections.opm58
1 files changed, 55 insertions, 3 deletions
diff --git a/macros/luatex/optex/sections.opm b/macros/luatex/optex/sections.opm
index dae71df77a..2a7629560c 100644
--- a/macros/luatex/optex/sections.opm
+++ b/macros/luatex/optex/sections.opm
@@ -128,10 +128,13 @@
\_newcount \_fnum % figure numbers
\_newcount \_dnum % numbered display maths
-\_def \_chapx {\_incr\_chapnum \_secnum=0 \_seccnum=0 \_tnum=0 \_fnum=0 \_dnum=0 \_lfnotenum=0 }
-\_def \_secx {\_incr\_secnum \_seccnum=0 \_tnum=0 \_fnum=0 \_dnum=0 }
+\_def \_chapx {\_incr\_chapnum \_secnum=0 \_seccnum=0 \_resetcountchap \_lfnotenum=0 }
+\_def \_secx {\_incr\_secnum \_seccnum=0 \_resetcountsec }
\_def \_seccx {\_incr\_seccnum }
+\_def \_resetcountchap {\_tnum=0 \_fnum=0 \_dnum=0 }
+\_def \_resetcountsec {\_tnum=0 \_fnum=0 }
+
\_def \_thechapnum {\_the\_chapnum}
\_def \_thesecnum {\_othe\_chapnum.\_the\_secnum}
\_def \_theseccnum {\_othe\_chapnum.\_the\_secnum.\_the\_seccnum}
@@ -350,6 +353,55 @@
}
\_public \eqmark ;
-\_endcode % -------------------------------------
+ \_doc -----------------------------
+ The `\numberedpar <letter>{<name>}` is implemented here.
+ You can say `\let\resetcountsec=\relax` if you don't want to reset
+ counters A, B, C, D, E nor `\fnum` nor `\tnum` in sections, but only in
+ chapters. Or you can define you own concept of `\_chapx` and `\_secx`
+ macros (see above). Then you will want to re-define `\_theAnum`, `\_thefnum`
+ etc. macros.
+ \_cod -----------------------------
+
+\_newcount\_counterA \_newcount\_counterB \_newcount\_counterC
+\_newcount\_counterD \_newcount\_counterE
+
+\_def\_resetcounters{\_counterA=0 \_counterB=0 \_counterC=0 \_counterD=0 \_counterE=0 }
+\_addto \_resetcountchap {\_resetcounters}
+\_addto \_resetcountsec {\_resetcounters}
+
+\_def \_theAnum {\_othe\_chapnum.\_othe\_secnum.\_the\_counterA}
+\_def \_theBnum {\_othe\_chapnum.\_othe\_secnum.\_the\_counterB}
+\_def \_theCnum {\_othe\_chapnum.\_othe\_secnum.\_the\_counterC}
+\_def \_theDnum {\_othe\_chapnum.\_othe\_secnum.\_the\_counterD}
+\_def \_theEnum {\_othe\_chapnum.\_othe\_secnum.\_the\_counterE}
+
+\_def\_numberedpar#1#2{\_ea \_incr \_csname _counter#1\_endcsname
+ \_def\_tmpa{#1}\_def\_tmpb{#2}\_numberedparparam}
+\_optdef\_numberedparparam[]{%
+ \_ea \_printnumberedpar \_csname _the\_tmpa num\_ea\_endcsname\_ea{\_tmpb}}
+ \_doc -----------------------------
+ The `\_printnumberedpar \theXnum {<name>}` opens numbered paragraph and
+ prints it. The optional parameter is in `\_the\_opt`. You can re-define
+ it if you need another design.
+
+ `\_printnumberedpar` need not to be re-define if you only need to print
+ Theorems in italic and to insert vertical skips (for example). You can do this
+ by the following:
+ \_begtt
+ \def\theorem {\medskip\bgroup\it \numberedpar A{Theorem}}
+ \def\endtheorem {\par\egroup\medskip}
+ \_endtt
+ \theorem Let $M$ be... \endtheorem
+ \_cod -----------------------------
+
+\_def \_printnumberedpar #1#2{\_par
+ \_noindent\_wlabel #1%
+ {\bf #2 #1\_istoksempty\_opt\_iffalse \_space \_the\_opt \_fi.}\_space
+ \_ignorespaces
+}
+\_public \numberedpar ;
+
+
+\_endcode % -------------------------------------