summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/optex/base
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/optex/base')
-rw-r--r--Master/texmf-dist/tex/optex/base/bib-iso690.opm10
-rw-r--r--Master/texmf-dist/tex/optex/base/cite-bib.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/colors.opm6
-rw-r--r--Master/texmf-dist/tex/optex/base/doc.opm8
-rw-r--r--Master/texmf-dist/tex/optex/base/f-baskervald.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-baskerville.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-erewhon.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-fbb.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/f-fraunces.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-heros.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-jost.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-kerkis.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-lido.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-lmfonts.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-neohellenic.opm23
-rw-r--r--Master/texmf-dist/tex/optex/base/f-newcm.opm11
-rw-r--r--Master/texmf-dist/tex/optex/base/f-oldstandard.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/f-plex.opm56
-rw-r--r--Master/texmf-dist/tex/optex/base/f-poltawski.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-raleway.opm32
-rw-r--r--Master/texmf-dist/tex/optex/base/f-technika.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/fams-ini.opm33
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-opmac.opm6
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-preload.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-resize.opm6
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-select.opm39
-rw-r--r--Master/texmf-dist/tex/optex/base/graphics.opm7
-rw-r--r--Master/texmf-dist/tex/optex/base/hisyntax-kt.opm (renamed from Master/texmf-dist/tex/optex/base/hisytnax-kt.opm)0
-rw-r--r--Master/texmf-dist/tex/optex/base/hyperlinks.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/if-macros.opm70
-rw-r--r--Master/texmf-dist/tex/optex/base/lang-data.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/lists.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/logos.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/makeindex.opm60
-rw-r--r--Master/texmf-dist/tex/optex/base/maketoc.opm6
-rw-r--r--Master/texmf-dist/tex/optex/base/margins.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/math-macros.opm15
-rw-r--r--Master/texmf-dist/tex/optex/base/math-preload.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/more-macros.opm64
-rw-r--r--Master/texmf-dist/tex/optex/base/multicolumns.opm55
-rw-r--r--Master/texmf-dist/tex/optex/base/optex-tricks.opm475
-rw-r--r--Master/texmf-dist/tex/optex/base/optex.ini2
-rw-r--r--Master/texmf-dist/tex/optex/base/optex.lua35
-rw-r--r--Master/texmf-dist/tex/optex/base/others.opm43
-rw-r--r--Master/texmf-dist/tex/optex/base/output.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/parameters.opm6
-rw-r--r--Master/texmf-dist/tex/optex/base/pdfuni-string.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/prefixed.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/ref-file.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/sections.opm12
-rw-r--r--Master/texmf-dist/tex/optex/base/slides.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/styles.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/table.opm30
-rw-r--r--Master/texmf-dist/tex/optex/base/uni-lcuc.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/unimath-codes.opm6
-rw-r--r--Master/texmf-dist/tex/optex/base/unimath-macros.opm6
-rw-r--r--Master/texmf-dist/tex/optex/base/usebib.opm12
-rw-r--r--Master/texmf-dist/tex/optex/base/verbatim.opm26
58 files changed, 922 insertions, 312 deletions
diff --git a/Master/texmf-dist/tex/optex/base/bib-iso690.opm b/Master/texmf-dist/tex/optex/base/bib-iso690.opm
index 5595d658770..e8df4a2d6e8 100644
--- a/Master/texmf-dist/tex/optex/base/bib-iso690.opm
+++ b/Master/texmf-dist/tex/optex/base/bib-iso690.opm
@@ -1,6 +1,6 @@
% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_undefined {BIB style (iso690) <2023-09-13>} % loaded on demand by \usebib
+\_codedecl \_undefined {BIB style (iso690) <2024-07-23>} % loaded on demand by \usebib
\_ifx\_optexbibstyle\_undefined \_errmessage
{This file can be read by: \_string\usebib/? (iso690) bibfiles command only}
@@ -36,7 +36,7 @@
}
\_doc -----------------------------
- Formating of Author/Editor lists.
+ Formatting of Author/Editor lists.
\_cod -----------------------------
\_def\_firstauthorformat{%
@@ -312,7 +312,6 @@
{\_bibwarning}%
\_bprinta [howpublished] {[*].\ }{}%
\_bprinta [ednote] {\_prepareednote*\_bprintv[citedate]{}{.}\ }{\_bibwarning}%
- \_bprinta [year] {}{\_bibwarning}%
\_bprinta [citedate] {\_docitedate*///\_relax.\ }{}%
\_bprintb [doi] {\_predoi DOI \_ulink[http://dx.doi.org/##1]{##1}.\ }{}%
\_bprintb [url] {\_preurl\_url{##1}. }{}%
@@ -484,9 +483,9 @@ can add the secondary name (interpreted as Firstname) after the comma. Example:
\begtt
author = "Czech\ Technical\ University\ in\ Prague,
- Faculty\ of\ Electrical\ Engeneering",
+ Faculty\ of\ Electrical\ Engineering",
\endtt
-output: CZECH TECHNICAL UNIVERSITY IN PRAGUE, Faculty of Electrical Engeneering.
+output: CZECH TECHNICAL UNIVERSITY IN PRAGUE, Faculty of Electrical Engineering.
\seccc The editor field
@@ -933,6 +932,7 @@ Other options in the option field are silently ignored.
\_endinput
+2024-07-23 ... generic: warning about missing year removed (bug fixed)
2023-09-13 ... \_createbibmark: no comma if year is missing
2023-06-23 ... @ONLINE entry introduced
2023-04-22 ... incollection: typo corrected
diff --git a/Master/texmf-dist/tex/optex/base/cite-bib.opm b/Master/texmf-dist/tex/optex/base/cite-bib.opm
index 805b84de030..132a1d982f9 100644
--- a/Master/texmf-dist/tex/optex/base/cite-bib.opm
+++ b/Master/texmf-dist/tex/optex/base/cite-bib.opm
@@ -1,6 +1,6 @@
% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \cite {Cite, Biblioraphy <2021-04-13>} % preloaded in format
+\_codedecl \cite {Cite, Bibliography <2021-04-13>} % preloaded in format
\_doc -----------------------------
Registers used by `\cite`, `\bib` macros are declared here.
@@ -131,7 +131,7 @@
If `\_addcitelist` is processed after \^`\usebib`, then
\`\_Xcite``{<bibpart>/}{<label>}` is saved to the `.ref`
file. The `\_Xcite` creates `\_ctlstB:<bibpart>/` as a list of saved
- `\_citeI[<label>]`. Finally, \^`\usebib` concats boths lists `\_ctlst:<bibpart>/`
+ `\_citeI[<label>]`. Finally, \^`\usebib` concats both lists `\_ctlst:<bibpart>/`
and `\_ctlstB:<bibpart>/` in the second \TeX/ run.
\_cod ----------------------------
diff --git a/Master/texmf-dist/tex/optex/base/colors.opm b/Master/texmf-dist/tex/optex/base/colors.opm
index e43a40c779b..6a4782834d0 100644
--- a/Master/texmf-dist/tex/optex/base/colors.opm
+++ b/Master/texmf-dist/tex/optex/base/colors.opm
@@ -106,7 +106,7 @@
\_doc -----------------------------
The attribute \`\_transpattr` is allocated and set by the
- \`\transparency``<number>` macro. If such level of the tranparency was
+ \`\transparency``<number>` macro. If such level of the transparency was
never used in the document then
\^`\addextgstate{tr<number>}`\code{\{<</ca X /CA X>>\}} is applied
(where `X` is `(255-<number>)/255`).
@@ -208,7 +208,7 @@
RGB to CMYK and from CMYK to RGB for given color. It has precedence
before general formulae used in the \^`\_rgbtocmyk` and \^`\_cmyktorgb`
macros. Note, that the values <R> <G> <B> <C> <M> <Y> <K> must be given
- exacly in the same format as in \^`\setcmykcolor` and \^`\setrgbcolor`
+ exactly in the same format as in \^`\setcmykcolor` and \^`\setrgbcolor`
parameters. For example, `0.5` or `.5` or `.50` are different values from
point of view of this mapping.
\_cod -----------------------------
@@ -408,7 +408,7 @@ $$
$$
You can use minus instead of plus in the linear combination in `\colordef`. The
-given color is substracted in such case and the negative components are
+given color is subtracted in such case and the negative components are
rounded to zero immediately. For example
\begtt
\colordef \Color {\Brown-\Black}
diff --git a/Master/texmf-dist/tex/optex/base/doc.opm b/Master/texmf-dist/tex/optex/base/doc.opm
index c334019de29..28cbd19353d 100644
--- a/Master/texmf-dist/tex/optex/base/doc.opm
+++ b/Master/texmf-dist/tex/optex/base/doc.opm
@@ -3,7 +3,7 @@
\_codedecl \printdoc {Macros for documentation printing <2023-12-10>} % loaded on demand by \load[doc]
\_doc -----------------------------
- General decalarations.
+ General declarations.
\_cod -----------------------------
\_fontfam[lmfonts]
@@ -181,7 +181,7 @@
When printing Index, we distinguish the Index entries with their main
documentation point (they are created as links and backslash is added),
Index entries with only user documentation points have backslash added
- but no link is created. Other index entries are printed as usuall
+ but no link is created. Other index entries are printed as usual
without backslash.
\_cod -----------------------------
@@ -223,7 +223,7 @@
\_doc -----------------------------
Main documentation points and hyperlinks to/from it.
Main documentation point: \code{\\`\\foo`}.
- User documentation point: \code{\\^`\\foo}, first occurence only.
+ User documentation point: \code{\\^`\\foo}, first occurrence only.
The next occurrences are only links to the main documentation point.
Link to user documentation point: \code{\\~`\\foo}.
\_cod -----------------------------
@@ -329,7 +329,7 @@ documentation points are saved to the index.
The listing mode creates all control sequences which are listed in the
index as an active link to the main documentation point of such control sequence
-and prints them in blue. Moreower, active links are control sequneces of the
+and prints them in blue. Moreower, active links are control sequences of the
type `\_foo` or `\.foo` although the documentation mentions only `\foo`.
Another text is printed in black.
diff --git a/Master/texmf-dist/tex/optex/base/f-baskervald.opm b/Master/texmf-dist/tex/optex/base/f-baskervald.opm
index 3a9540a5a8f..8d43942b527 100644
--- a/Master/texmf-dist/tex/optex/base/f-baskervald.opm
+++ b/Master/texmf-dist/tex/optex/base/f-baskervald.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_famdecl [Baskervald] \Baskervald {Free vaiants of classical Baskerville by ADF}
+\_famdecl [Baskervald] \Baskervald {Free variants of classical Baskerville by ADF}
{\caps} {\rm \bf \it \bi} {}
{[Baskervaldx-Reg]}
{\_def \_fontnamegen {[Baskervaldx-\_currV]:script=latn;\_capsV\_fontfeatures}}
diff --git a/Master/texmf-dist/tex/optex/base/f-baskerville.opm b/Master/texmf-dist/tex/optex/base/f-baskerville.opm
index a0f5e3e99d2..974e0dba6bb 100644
--- a/Master/texmf-dist/tex/optex/base/f-baskerville.opm
+++ b/Master/texmf-dist/tex/optex/base/f-baskerville.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_famdecl [Baskerville] \Baskerville {Free vaiants of classical Baskerville}
+\_famdecl [Baskerville] \Baskerville {Free variants of classical Baskerville}
{\caps} {\rm \bf \it \bi} {}
{[BaskervilleF-Regular]}
{\_def \_fontnamegen {[BaskervilleF-\_currV]:script=latn;\_capsV\_fontfeatures}}
diff --git a/Master/texmf-dist/tex/optex/base/f-erewhon.opm b/Master/texmf-dist/tex/optex/base/f-erewhon.opm
index efc23c411e6..63ee67ff5e9 100644
--- a/Master/texmf-dist/tex/optex/base/f-erewhon.opm
+++ b/Master/texmf-dist/tex/optex/base/f-erewhon.opm
@@ -10,7 +10,7 @@ Modifiers:^^J
\caps ...... caps & small caps^^J
\slant ..... slanted Regular, Bold^^J%
Variants:^^J
- \sl ... slanted Regular, \sb ... slanted Bold^^J
+ \sl ... slanted Regular, \bs ... slanted Bold^^J
}}
\_moddef \resetmod {\_fsetV caps={} \_fvars Regular Bold Italic Bolditalic }
diff --git a/Master/texmf-dist/tex/optex/base/f-fbb.opm b/Master/texmf-dist/tex/optex/base/f-fbb.opm
index ac69a89a992..ce105fb30a3 100644
--- a/Master/texmf-dist/tex/optex/base/f-fbb.opm
+++ b/Master/texmf-dist/tex/optex/base/f-fbb.opm
@@ -1,7 +1,7 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
\_famdecl [fbb] \FBembo {Bembo–like fonts derived from Cardo}
- {\caps \swash} {\rm \bf \it \bi} {}
+ {\caps \swash} {\rm \bf \it \bi} {adjusted Garamond-Math}
{[fbb-Regular]}
{\_def\_fontnamegen {[fbb-\_currV]:script=latn;\_capsV\_swaV\_fontfeatures}}
@@ -17,6 +17,8 @@ Modifier:^^J
\_initfontfamily % new font family must be initialized
+\_loadmath 1.06 {[Garamond-Math]} % x-size adjusted Garamond-Math
+
\_endcode
See historical notice in texdoc fbb.
diff --git a/Master/texmf-dist/tex/optex/base/f-fraunces.opm b/Master/texmf-dist/tex/optex/base/f-fraunces.opm
index 7684dbc4e8a..a4202c24c0f 100644
--- a/Master/texmf-dist/tex/optex/base/f-fraunces.opm
+++ b/Master/texmf-dist/tex/optex/base/f-fraunces.opm
@@ -18,7 +18,7 @@ Modifiers:^^J
\bolder .... \rm, \it = Medium, \bf, \bi = Black^^J%
Variable font parameters:^^J
\wght ...... 100--1000 (default 400): weight of the strokes^^J
- \opsz ...... 6--144 (default 14): optical size modifiation^^J
+ \opsz ...... 6--144 (default 14): optical size modification^^J
\ssoft ..... 0--100 (default 0): softness of serifs^^J
Use \wght=650 \ssoft=50 (for example). It acts like others font modifiers.^^J%
Extended variants:^^J
diff --git a/Master/texmf-dist/tex/optex/base/f-heros.opm b/Master/texmf-dist/tex/optex/base/f-heros.opm
index a7aebdb4b82..bd111553cb7 100644
--- a/Master/texmf-dist/tex/optex/base/f-heros.opm
+++ b/Master/texmf-dist/tex/optex/base/f-heros.opm
@@ -202,7 +202,7 @@ section~\ref[fontcommands].
If you need to use an internal control sequence declared in your fontfile,
use the reserved name space with names starting with two `_` followed by family
-indentifier or by `vf` if it relates to variable fonts.
+identifier or by `vf` if it relates to variable fonts.
The name of `\<Familyselector>` should begin with an uppercase letter.
diff --git a/Master/texmf-dist/tex/optex/base/f-jost.opm b/Master/texmf-dist/tex/optex/base/f-jost.opm
index 27d64821a16..a78fad34b7f 100644
--- a/Master/texmf-dist/tex/optex/base/f-jost.opm
+++ b/Master/texmf-dist/tex/optex/base/f-jost.opm
@@ -11,7 +11,7 @@ Modifiers (weight):^^J
\hairline ... \rm, \it: Hairline, \bf, \bi: Book^^J
\thin ....... \rm, \it: Thin, \bf, \bi: Medium^^J
\light ...... \rm, \it: Light, \bf, \bi: SemiBold^^J
- \medium ..... \rm, \it: Medium, \bf, \bi: Hevy^^J
+ \medium ..... \rm, \it: Medium, \bf, \bi: Heavy^^J
Extended Variants:^^J
\kf, \ki .... Black, BlackItalic^^J
}}
diff --git a/Master/texmf-dist/tex/optex/base/f-kerkis.opm b/Master/texmf-dist/tex/optex/base/f-kerkis.opm
index 4bc31ead65d..530e026af1c 100644
--- a/Master/texmf-dist/tex/optex/base/f-kerkis.opm
+++ b/Master/texmf-dist/tex/optex/base/f-kerkis.opm
@@ -12,7 +12,7 @@ Modifiers:^^J
\sans ...... sans serif^^J
\sanssemi .. semibold sans serif (only \rm, accented letters not available)^^J
Variant:^^J
- \calli ..... Calligraphic (only upercase, lowercase letters equal to Italic)^^J
+ \calli ..... Calligraphic (only uppercase, lowercase letters equal to Italic)^^J
}}
\_moddef \resetmod {\_fvars {} -Bold -Italic -BoldItalic }
diff --git a/Master/texmf-dist/tex/optex/base/f-lido.opm b/Master/texmf-dist/tex/optex/base/f-lido.opm
index 13b4cb76286..92ec9eca86f 100644
--- a/Master/texmf-dist/tex/optex/base/f-lido.opm
+++ b/Master/texmf-dist/tex/optex/base/f-lido.opm
@@ -10,7 +10,7 @@ Variants:^^J
\rm \bf \it \bi ... classical variants^^J
\mf \mi .... medium regular and medium italics (between normal and bold)^^J
Modifiers:^^J
- \cond ...... condensed (italic is not avalable for \cond variants)^^J
+ \cond ...... condensed (italic is not available for \cond variants)^^J
\medium .... sets \mf \bf \mi \bi family
}}
diff --git a/Master/texmf-dist/tex/optex/base/f-lmfonts.opm b/Master/texmf-dist/tex/optex/base/f-lmfonts.opm
index 90519e3aad6..09786de3a66 100644
--- a/Master/texmf-dist/tex/optex/base/f-lmfonts.opm
+++ b/Master/texmf-dist/tex/optex/base/f-lmfonts.opm
@@ -99,7 +99,7 @@ Note: Text fonts support optical sizes, but LatinModern-Math only for scripts.^^
\_moddef \upital {\_fsetV subfam=mu \_fvars r . . . }
\_moddef \dunhill {\_fsetV subfam=du \_fvars r . sl . }
-% submodifiers (they select special vaiants in a subfamily)
+% submodifiers (they select special variants in a subfamily)
\_moddef \nbold {\_onlyif subfam=rm,ss,tp: {\_fvars r b i bi }}
\_moddef \bolder {\_onlyif subfam=rm,ss,tp: {\_fvars r bx i bxi }}
\_moddef \slant {\_onlyif subfam=rm: {\_fvars r bx isl bxisl }%
diff --git a/Master/texmf-dist/tex/optex/base/f-neohellenic.opm b/Master/texmf-dist/tex/optex/base/f-neohellenic.opm
new file mode 100644
index 00000000000..fb0285ad64e
--- /dev/null
+++ b/Master/texmf-dist/tex/optex/base/f-neohellenic.opm
@@ -0,0 +1,23 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [Neohellenic] \Neohellenic {Sans serif fonts + math and full Greek}
+ {\caps} {\rm \bf \it \bi} {Neohellenic}
+ {[GFSNeohellenic]}
+ {\_def\_fontnamegen {[GFSNeohellenic\_currV]:script=latn;\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifier:^^J
+ \caps ...... caps & small caps (\rm only)^^J
+}}
+
+\_moddef \resetmod {\_fsetV caps={} \_fvars {} Bold It BoldIt }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
+
+\_initfontfamily % new font family must be initialized
+
+\_loadmath {[GFSNeohellenicMath]}
+
+\_endcode
+
+See the file `f-heros.opm` for information about principles of such
+font-macro-files.
diff --git a/Master/texmf-dist/tex/optex/base/f-newcm.opm b/Master/texmf-dist/tex/optex/base/f-newcm.opm
index ba83b0d7294..24b979940db 100644
--- a/Master/texmf-dist/tex/optex/base/f-newcm.opm
+++ b/Master/texmf-dist/tex/optex/base/f-newcm.opm
@@ -1,7 +1,7 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
\_famdecl [New Computer Modern] \NewCM {CM with Book variants, Cyrillic, Greek}
- {\book \ttset \sans \caps} {\rm \bf \it \bi} {NewCMMath}
+ {\book \ttset \sans \caps} {\rm \bf \it \bi} {NewCM-Regular}
{[NewCM10-Regular]}
{\_def\_fontnamegen {[NewCM\_typfV-\_currV]:\_capsV\_fontfeatures}}
@@ -32,6 +32,15 @@ Note: use \book\normalmath if you want Math in book-style too.
\_endcode
+If you want to use \book variant in the whole document, you can load
+NewCMMath-Book Unicode math font too. Use the following declaration in this
+case:
+
+\loadmath{NewCMMath-Book}
+\fontfam[newcm]
+\book\rm
+
+
See the file `f-heros.opm` for information about principles of such
font-macro-files.
diff --git a/Master/texmf-dist/tex/optex/base/f-oldstandard.opm b/Master/texmf-dist/tex/optex/base/f-oldstandard.opm
index 68d01da26ca..33488a730cd 100644
--- a/Master/texmf-dist/tex/optex/base/f-oldstandard.opm
+++ b/Master/texmf-dist/tex/optex/base/f-oldstandard.opm
@@ -1,7 +1,7 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
\_famdecl [OldStandard] \Oldstandard {inspired by a typeface most commonly used in old books}
- {\caps} {\rm \bf \it \bi} {}
+ {\caps} {\rm \bf \it \bi} {OldStandard}
{[OldStandard-Regular]}
{\_def\_fontnamegen {[OldStandard-\_currV]:script=latn;\_capsV\_fontfeatures}}
@@ -15,6 +15,8 @@ Modifier:^^J
\_initfontfamily % new font family must be initialized
+\_loadmath {[OldStandard-Math]}
+
\_endcode
See the file `f-heros.opm` for information about principles of such
diff --git a/Master/texmf-dist/tex/optex/base/f-plex.opm b/Master/texmf-dist/tex/optex/base/f-plex.opm
new file mode 100644
index 00000000000..87e7748c0fb
--- /dev/null
+++ b/Master/texmf-dist/tex/optex/base/f-plex.opm
@@ -0,0 +1,56 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [Plex] \Plex
+ {IBM Plex font family}
+ {\serif \sans \mono
+ \thin \elight \light \regular \text \medium \semibold
+ \cond \nocond}
+ {\rm \bf \it \bi}
+ {}%% No math!
+ {IBMPlexSerif-Regular}
+ {\_def\_fontnamegen {[IBMPlex\_subV-\_currV]:\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Subfamilies:^^J
+ \serif .... Serif (default)^^J
+ \sans ..... Sans serif^^J
+ \mono ..... Mono^^J%
+Weight modifiers:^^J
+ \thin ........ \rm \it = thin, \bf \bi = light^^J
+ \elight ...... \rm \it = extra light, \bf \bi = regular^^J
+ \light ....... \rm \it = light, \bf \bi = medium^^J
+ \regular ..... \rm \it = regular, \bf \bi = bold (default)^^J
+ \text ........ \rm \it = text, \bf \bi = bold^^J
+ \medium ...... \rm \it = medium, \bf \bi = bold^^J
+ \semibold .... \rm \it = regular, \bf \bi = semibold^^J%
+Modifiers:^^J
+ \cond \nocond .... Condensed (sans serif only)^^J%
+}}
+
+\_moddef \resetmod {\__Plex_nocond \__Plex_serif \__Plex_regularVars}
+
+\_def\__Plex_nocond {\_fsetV cond={} }
+\_def\__Plex_serif {\_fsetV sub=Serif }
+\_def\__Plex_regularVars {\_fvars Regular Bold Italic BoldItalic }
+
+\_moddef \serif {\__Plex_serif}
+\_moddef \sans {\_fsetV sub={Sans\_condV} }
+\_moddef \mono {\_fsetV sub=Mono }
+
+\_moddef \thin {\_fvars Thin Light ThinItalic LightItalic }
+\_moddef \elight {\_fvars ExtraLight Regular ExtraLightItalic Italic }
+\_moddef \light {\_fvars Light Medium LightItalic MediumItalic }
+\_moddef \regular {\__Plex_regularVars}
+\_moddef \text {\_fvars Text Bold TextItalic BoldItalic }
+\_moddef \medium {\_fvars Medium Bold MediumItalic BoldItalic }
+\_moddef \semibold {\_fvars Regular SemiBold Italic SemiBoldItalic }
+
+\_moddef \cond {\_fsetV cond=Condensed }
+\_moddef \nocond {\__Plex_nocond}
+
+\_initfontfamily
+
+\_endcode
+
+Official font repository:
+https://github.com/IBM/plex
diff --git a/Master/texmf-dist/tex/optex/base/f-poltawski.opm b/Master/texmf-dist/tex/optex/base/f-poltawski.opm
index 6ebf089a31c..4d698dea8eb 100644
--- a/Master/texmf-dist/tex/optex/base/f-poltawski.opm
+++ b/Master/texmf-dist/tex/optex/base/f-poltawski.opm
@@ -13,7 +13,7 @@ Modifiers:^^J
\expd ...... semi expanded, designed for 8pt size^^J
\cond ...... semi condensed, designed for 12pt size^^J
\ccond ..... condensed, designed for 17pt size^^J
- \osize ..... auto-sitches between \ccond \cond \noexpd \expd \eexpd by size^^J
+ \osize ..... auto-switches between \ccond \cond \noexpd \expd \eexpd by size^^J
\caps ...... caps & small caps^^J
}}
diff --git a/Master/texmf-dist/tex/optex/base/f-raleway.opm b/Master/texmf-dist/tex/optex/base/f-raleway.opm
new file mode 100644
index 00000000000..16e58b4bd09
--- /dev/null
+++ b/Master/texmf-dist/tex/optex/base/f-raleway.opm
@@ -0,0 +1,32 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [Raleway] \Raleway {Elegant grotesk, nine weights in two variants}
+ {\thin \elight \light \normal \medium \semibold \bolder}
+ {\rm \bf \it \bi} {}
+ {[Raleway-Regular]}
+ {\_def\_fontnamegen {[Raleway-\_currV]:\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifiers (face weight):^^J
+ \thin ...... \rm, \it = Thin, \bf, \bi = Light^^J
+ \elight .... \rm, \it = ExtraLight, \bf, \bi = Regular^^J
+ \light ..... \rm, \it = Light, \bf, \bi = Medium^^J
+ \normal .... \rm, \it = Regular, \bf, \bi = SemiBold^^J
+ \medium .... \rm, \it = Medium, \bf, \bi = Bold^^J
+ \semibold .. \rm, \it = SemiBold, \bf, \bi = ExtraBold^^J
+ \bolder .... \rm, \it = Bold, \bf, \bi = Black^^J%
+}}
+
+\_moddef \resetmod {\_fsetV caps={} \_fvars Regular SemiBold Regular-Italic SemiBold-Italic }
+\_moddef \thin {\_fvars Thin Light Thin-Italic Light-Italic }
+\_moddef \elight {\_fvars ExtraLight Regular ExtraLight-Italic Regular-Italic }
+\_moddef \light {\_fvars Light Medium Light-Italic Medium-Italic }
+\_moddef \normal {\_fvars Regular SemiBold Regular-Italic SemiBold-Italic }
+\_moddef \medium {\_fvars Medium Bold Medium-Italic Bold-Italic }
+\_moddef \semibold {\_fvars SemiBold ExtraBold SemiBold-Italic ExtraBold-Italic }
+\_moddef \bolder {\_fvars Bold Black Bold-Italic Black-Italic }
+
+\_initfontfamily % new font family must be initialized
+
+\_endcode
+
diff --git a/Master/texmf-dist/tex/optex/base/f-technika.opm b/Master/texmf-dist/tex/optex/base/f-technika.opm
index b29b29ed0c8..0030f9ba373 100644
--- a/Master/texmf-dist/tex/optex/base/f-technika.opm
+++ b/Master/texmf-dist/tex/optex/base/f-technika.opm
@@ -7,7 +7,7 @@
\_wlog{\_detokenize{%
Modifiers:^^J
- \light ..... ligher variants: \rm\bf=light \bf\bi=normal^^J
+ \light ..... lighter variants: \rm\bf=light \bf\bi=normal^^J
\book ...... semi-ligher variants: \rm\bf=book \bf\bi=bold^^J
\caps ...... caps & small caps^^J%
Special variant:^^J
diff --git a/Master/texmf-dist/tex/optex/base/fams-ini.opm b/Master/texmf-dist/tex/optex/base/fams-ini.opm
index 7d3f0332a83..d6fa06ff151 100644
--- a/Master/texmf-dist/tex/optex/base/fams-ini.opm
+++ b/Master/texmf-dist/tex/optex/base/fams-ini.opm
@@ -108,7 +108,7 @@
-: {\mono\initials\displ\keybr} }
\_famfrom{Victor Gaultney}
-\_faminfo [Gentium] {Serif free fonts, support Greek, Cyrrilic, IPA} {f-gentium}
+\_faminfo [Gentium] {Serif free fonts, support Greek, Cyrillic, IPA} {f-gentium}
{ -,\caps,\book,\book\caps: {\rm\bf\it\bi} }
\_famalias [GentiumPro]
@@ -217,6 +217,12 @@
\caps, \caps\cond: {\rm\bf\it\bi} \caps\ttset: {\rm\bf}
}
+\_famfrom {Google, Matt McInerney, Pablo Impallari, Rodrigo Fuenzalida}
+\_faminfo [Raleway] {Elegant grotesk, nine weights in two variants} {f-raleway}
+ { \thin,\elight,\light,\normal,\medium,\semibold,\bolder: {\rm\it}
+ \semibold,\bolder: {\bf\bi}
+ }
+
\_famfrom {Malgorzata Budyta, Janusz Marian Nowacki}
\_faminfo [Kurier] {Two element sans serif typeface} {f-kurier}
{ -,\cond,\caps,\caps\cond: {\rm\it\bf\bi}
@@ -265,6 +271,11 @@
\thin\caps,\light\caps,\book\caps,\caps,\medium\caps,%
\thin\allsc,\light\allsc,\book\allsc,\allsc,\medium\allsc: {\rm\bf\it\bi} }
+\_famfrom {GFS, Takis Katsoulidis, George D. Matthiopoulos}
+\_faminfo [Neohellenic] {Sans serif fonts with math and full Greek} {f-neohellenic}
+ { -: {\rm\bf\it\bi} \caps:{\rm} }
+\_famalias [GFS Neohellenic]
+
\_famfrom {Raph Levien}
\_faminfo [Inconsolata] {A monospaced font for code listing} {f-inconsolata}
{ -,\narrow: {\rm\bf} }
@@ -276,11 +287,27 @@
\_famfrom {Séamas Ó Brógáin}
\_faminfo [Clara] {Clara, a serif font family} {f-clara}
{ -: {\rm\bf\it\bi} \caps: {\rm} }
-
+
\_famfrom {Maxim Iorsh}
\_faminfo [Culmus] {Hebrew roman, sans and mono fonts from the Culmus project} {f-culmus}
{\roman,\sans,\mono: {\rm\bf\it\bi}}
+\_famfrom {IBM, Mike Abbink, Paul van der Laan, Pieter van Rosmalen}
+\_faminfo [Plex]
+ {IBM Plex font family}
+ {f-plex}
+ { \thin,\elight,\light,-,\text: {\rm\it}
+ \semibold,-: {\bf\bi}
+ \sans\thin,\sans\elight,\sans\light,\sans,\sans\text: {\rm\it}
+ \sans\semibold,\sans: {\bf\bi}
+ \cond\sans\thin,\cond\sans\elight,\cond\sans\light,%
+ \cond\sans,\cond\sans\text: {\rm\it}
+ \cond\sans\semibold,\cond\sans: {\bf\bi}
+ \mono\thin,\mono\elight,\mono\light,\mono,\mono\text: {\rm\it}
+ \mono\semibold,\mono: {\bf\bi}
+ }
+\_famalias[IBM Plex]
+
\_endcode
Once you have prepared a font family file with the name `f-<famname>.opm` and
@@ -319,7 +346,7 @@ The `fams-ini.opm` and `fams-local.opm` files can use the macros
}
\medskip
-The \^`\_faminfo` commad has the syntax:
+The \^`\_faminfo` command has the syntax:
\begtt \catcode`\<=13
\_faminfo [<Family Name>] {<comments>} {<file-name>}
{ <mod-plus-vars> }
diff --git a/Master/texmf-dist/tex/optex/base/fonts-opmac.opm b/Master/texmf-dist/tex/optex/base/fonts-opmac.opm
index 646a0257b9d..f2089536da2 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-opmac.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-opmac.opm
@@ -127,11 +127,11 @@
Suppose following example:
`{\typosize[13/15] Let $M$ be a subset of $R$ and $x\in M$...}`
If \^`\mfontsrule=1` then \^`\typosize` does not load math fonts
- immediatelly but at the first math formula. It is done by `\everymath`
+ immediately but at the first math formula. It is done by `\everymath`
register, but the contents of this register is processed inside the math
group. If we do `\everymath={\_normalmath}` then this complicated macro
will be processed three times in your example above. We want only one
- pocessing, so we do `\everymath={`\`\_setmathfonts``}` and
+ processing, so we do `\everymath={`\`\_setmathfonts``}` and
this macro closes math mode first, loads fonts and opens math mode again.
\_cod -----------------------------
@@ -183,7 +183,7 @@
The \`\boldify` macro does `\let\rm\bf`, `\let\it\bi` and
`\let\normalmath=\boldmath`. All following text will be in bold.
If should be used after \^`\typosize` or \^`\typoscale` macros.\nl
- The internal \`\_runboldmath` macro runs `\_boldmath` immediatelly
+ The internal \`\_runboldmath` macro runs `\_boldmath` immediately
if no delay of the math font loading is set by \^`\_setmainvaluesL`.\nl
The `\rm`, `\it` in math mode must keep its original meaning.
\_cod -----------------------------
diff --git a/Master/texmf-dist/tex/optex/base/fonts-preload.opm b/Master/texmf-dist/tex/optex/base/fonts-preload.opm
index 82387970e68..fb2a7f370ce 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-preload.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-preload.opm
@@ -43,7 +43,7 @@ use them in the Font Selection System. But the protected versions of these
control sequences are used in the Font Selection System.
If the `*.tfm` files are missing during format generation then the format is
-succesfully generated without any pre-loaded fonts. It doesn't matter if each
+successfully generated without any pre-loaded fonts. It doesn't matter if each
document processed by \OpTeX/ declares Unicode fonts. You can create such
fonts-less format anyway if you set \`\fontspreload` to `\relax` before
`\input optex.ini`, i.e.:
diff --git a/Master/texmf-dist/tex/optex/base/fonts-resize.opm b/Master/texmf-dist/tex/optex/base/fonts-resize.opm
index f4dd3c40339..0f3f07d148b 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-resize.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-resize.opm
@@ -220,7 +220,7 @@ Let's sum it up. Suppose that \^`\initunifonts` was used.
The `\font` primitive is able to load OpenType
fonts (`otf` or `ttf`), Type1 fonts (`afm` and `pfb`) or classical `tfm` fonts.
We strongly recommend to prefer OpenType format over Type1 format
-over `tfm` format. The last one desn't support Unicode. If there is nothing
+over `tfm` format. The last one doesn't support Unicode. If there is nothing
else left and you must to use `tfm`, then you must to implement re-encoding from
Unicode to the `tfm` encoding at macro level, see the
\ulink[http://petr.olsak.net/optex/optex-tricks.html\#nonunicode]{\OpTeX/ trick 0018}
@@ -300,7 +300,7 @@ the current size. So, the example above can be realized by
re-initialized: now it accepts extended syntax and it is able to load Unicode
OpenType fonts.
* \^`\ufont` is a shortcut of `\initunifonts \font`. I.e.\ it behaves like
- `\font` and accepts extended syntax immediatelly.
+ `\font` and accepts extended syntax immediately.
* \^`\sfont` has syntax like extended `\font`. It declares a macro which
selects the given font and resizes it to the current size (given by
\^`\setfontsize`). In various part of document (text, footnotes, titles), the
@@ -334,7 +334,7 @@ implemented in various design sizes: `cmr5`, `cmr6`, `cmr7`, `cmr8`, `cmr9`,
sizes". Each design size is implemented in its individual font file and \OpTeX/ is
able to choose right file if various optical sizes and corresponding file
names are declared for the font by \^`\_regtfm` or \^`\_regoptsizes` command.
-The command \^`\setfontsize` sets the internal reuirements for
+The command \^`\setfontsize` sets the internal requirements for
optical size if the parameter is in the format `at<dimen>` or `mag<factor>`.
Then the command \^`\resizethefont` or \^`\fontlet` or variant selectors try to choose
the font suitable for the required optical size. For example
diff --git a/Master/texmf-dist/tex/optex/base/fonts-select.opm b/Master/texmf-dist/tex/optex/base/fonts-select.opm
index d403a490d5f..1709ab3f5ca 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-select.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-select.opm
@@ -286,7 +286,7 @@
\_protected\_edef\_tmpa {%
\_noexpand\_famdepend\_noexpand#1{_f:\_noexpand\_currfamily:\_csstring#1}}%
\_ifx #1\tt
- \_protected\_def\_tt{{\_def\_xfamv{tt}#2\_ea}\_the\_font \_def\_currvar{\_tt}}%
+ \_protected\_def\_tt{{\_def\_xfamv{tt}#2\_ea}\_the\_font \_def\_currvar{\_tt}\_matt}%
\_let\tt=\_tt
\_else \_setnewmeaning #1=\_tmpa \famvardef
\_fi
@@ -800,12 +800,17 @@ about it. There are two cases:
\^`\tt` is an additional special variant selector which is defined as \"select typewriter
font independently of the current font family". By default, the typewriter font-face
-from LatinModern font family is used.
+from LatinModern font family is used. When using this default `\tt` selector you need not to
+load the LatinModern family (by \^`\fontfam[lm]`) because the font file is explicitly
+specified in the macro \^`\_ttunifont`. The default `\tt` selector
+scales this font without respecting optical sizes.
The \^`\tt` variant selector is used in \OpTeX/ internal macros
-\^`\_ttfont` (verbatim texts) and \^`\_urlfont` (printing URL's).
+\^`\_ttfont` (verbatim texts), \^`\_urlfont` (printing URL's),
+\^`\_printii` (printing index entry when doc macros are activated) and
+\^`\ttraggedright` (plain~\TeX/ macro).
-The behavior of \^`\tt` can be re-defined by \^`\famvardef`. For example:
+The \^`\tt` variant selector can be re-defined by \^`\famvardef`. For example:
\begtt
\fontfam[Cursor]
@@ -818,10 +823,32 @@ Test in URL \url{http://something.org}.
\endtt
%
You can see that \^`\tt` stay family independent. This is a special feature only
-for \^`\tt` selector. New definitions of \^`\_ttfont` and \^`\_urlfont` are done too.
-It is recommended to use `\setff{-liga;-tlig}` to suppress the
+for \^`\tt` selector. It is recommended to use `\setff{-liga;-tlig}` to suppress the
ligatures in typewriter fonts.
+The \^`\famvardef\tt` behaves differently than \^`\famvardef\anythingelse`:
+it creates the \^`\tt` variant selector independent of current font family
+and it redefines both macros `\tt` and `\_tt` in order to all internal \OpTeX/ macros
+based on this selector are working with the new selected font.
+
+If you load \^`\fontfam[lm]` and declare `\famvardef\tt{\LMfonts\ttset\setff{-tlig}\rm}`
+then you get almost the same behavior as the default `\tt` selector does with one
+difference: a new `\tt` selector respects optical sizes declared in
+the LatinModern font family.
+
+You can implement ex-height correction of `\tt` font with
+respect to your font family used for general text. For example:
+
+\begtt
+\load[lm]
+\famvardef\tt{\LMfonts\ttset\setfontsize{mag1.1}\setff{-tlig}\rm}
+... or ...
+\let\oritt=\tt
+\famvardef\tt{\setfontsize{mag1.1}\oritt}
+\endtt
+The second alternative uses the default font from \^`\_ttunifont` without
+respecting optical sizes.
+
If Unicode math font is loaded then the `\tt` macro selects typewriter
font-face in math mode too. This face
is selected from used Unicode math font and it is independent of
diff --git a/Master/texmf-dist/tex/optex/base/graphics.opm b/Master/texmf-dist/tex/optex/base/graphics.opm
index bf3fec09b6b..88dea56d036 100644
--- a/Master/texmf-dist/tex/optex/base/graphics.opm
+++ b/Master/texmf-dist/tex/optex/base/graphics.opm
@@ -40,6 +40,7 @@
\_opinput {\_the\_picdir #1_tex}% file with labels
\_egroup}
+\_newtoks\_tmptoks
\_newtoks\_inkdefs \_inkdefs={%
\_def\makeatletter#1\makeatother{}%
\_def\includegraphics[#1]#2{\_inkscanpage#1,page=,\_fin \_inspic{\_the\_tmptoks}\_hss}%
@@ -234,7 +235,7 @@
The \`\_setflcolors` uses the \^`\_setcolor` macro to separate filling (non-stroking)
color and stroking color.
The \`\_coc` macro means \"create oval or circle" and it expands to
- the stroking primitve `S` or filling primitive `f` or boh `B`. Only boundary
+ the stroking primitive `S` or filling primitive `f` or boh `B`. Only boundary
stroking is performed after `\fcolor=\relax`. You cannot combine
`\fcolor=\relax` with `\shadow=Y`.
\_cod -----------------------------
@@ -349,7 +350,7 @@
this effect. The `\shadowlevels+1/2` level is equal to the shifted given path.
\_cod -----------------------------
-\_def\_shadowlevels{9} % number of layers for blurr effect
+\_def\_shadowlevels{9} % number of layers for blur effect
\_def\_shadowdarknessA{0.025} % transparency of first shadowlevels/2 layers
\_def\_shadowdarknessB{0.07} % transparency of second half of layers
\_def\_shadowmoveto{1.8 -2.5} % vector defines shifting layer (in bp)
@@ -454,5 +455,5 @@ the \^`\transformbox{<transformation>}{\copy\mypic}`.
2022-03-03: \_coc introduced
2021-07-16: \inoval, \incircle are more simple, using attribitecolor features
2021-03-19: \inkinspic: pictures in subdirectories, bug fixed
-2020-12-21: \puttext: \box0 in goup, bugfix
+2020-12-21: \puttext: \box0 in group, bugfix
2020-04-12: \_public \clipinoval \clipincircle ; added, bug fixed
diff --git a/Master/texmf-dist/tex/optex/base/hisytnax-kt.opm b/Master/texmf-dist/tex/optex/base/hisyntax-kt.opm
index 8a9d2dffac3..8a9d2dffac3 100644
--- a/Master/texmf-dist/tex/optex/base/hisytnax-kt.opm
+++ b/Master/texmf-dist/tex/optex/base/hisyntax-kt.opm
diff --git a/Master/texmf-dist/tex/optex/base/hyperlinks.opm b/Master/texmf-dist/tex/optex/base/hyperlinks.opm
index 7c3e78635aa..dda19b91300 100644
--- a/Master/texmf-dist/tex/optex/base/hyperlinks.opm
+++ b/Master/texmf-dist/tex/optex/base/hyperlinks.opm
@@ -77,7 +77,7 @@
\nl
\`\ilink``[<type>:<spec>]{<text>}` is equivalent to \^`\link` but
the `<color>` is used from \^`\hyperlinks` declaration
- (or it is overwriten by `\def\_<type>linkcolor`).
+ (or it is overwritten by `\def\_<type>linkcolor`).
\nl
\`\ulink``[<url>]{<text>}` creates external link.
The `<url>` is detokenized with `\escapechar=-1` before it is used, so
@@ -122,7 +122,7 @@
are typical skips used for special characters, their meaning is
documented in the code below. You can change them.
Default values: penalty 9990 is inserted between each pair of normal
- chararacters, penalty 100 is inserted after special charcters, nobreak before special
+ characters, penalty 100 is inserted after special characters, nobreak before special
characters. The URL can be broken at any place using these default
values. If you want to disable breaking between normal characters, say
`\let\_urlxskip=\nobreak`.
diff --git a/Master/texmf-dist/tex/optex/base/if-macros.opm b/Master/texmf-dist/tex/optex/base/if-macros.opm
index 25af86fe303..28adb0a02fb 100644
--- a/Master/texmf-dist/tex/optex/base/if-macros.opm
+++ b/Master/texmf-dist/tex/optex/base/if-macros.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \newif {Special if-macros, is-macros and loops <2024-02-19>} % preloaded in format
+\_codedecl \newif {Special if-macros, is-macros and loops <2024-11-24>} % preloaded in format
\_doc ----------------------------
\secc Classical \code{\\newif}
@@ -35,6 +35,15 @@
\begtt \catcode`<=13
\if<something> \afterfi{<result is true>} \else \afterfi{<result is false>} \fi
\endtt
+ \`\afterxfi` `{<what to do>}<ignored>\xfipoint` closes all opened
+ `\if..\fi` conditionals until \`\xfipoint` is found and then proceses <what to do>.
+ The <ignored> text must expand to nothing (or spaces only); arbitrary number
+ of opened conditionals can be closed here. Example:
+ \begtt
+ \ifodd#1 \ifodd#2 \afterxfi{odd-odd} \else \afterxfi{odd-even} \fi
+ \else \ifodd#2 \afterxfi{even-odd} \else \afterxfi{even-even} \fi
+ \fi \xfipoint
+ \endtt
Nested `\if..\afterfi{\if..\afterfi{...}\fi}\fi` are possible. Another approach is mentioned
in \ulink[http://petr.olsak.net/optex/optex-tricks.html\#fiinif]{OpTeX trick 0098}
which also solves the `\fi` in `\if` problem.
@@ -42,6 +51,9 @@
\_long\_def \_afterfi#1#2\_fi{\_fi#1}
\_long\_def \afterfi#1#2\fi{\_fi#1}
+\_let\_xfipoint=\_empty \_let\xfipoint=\_empty % \xfipoint alone does nothing
+\_long\_def \_afterxfi#1#2\_xfipoint{\_romannumeral#20 #1}
+\_long\_def \afterxfi#1#2\xfipoint{\_romannumeral#20 #1}
\_doc ----------------------------
\secc Loops
@@ -49,11 +61,10 @@
until `\ifsomething` is false. Then `<codeB>` is not executed and loop is
finished. This works like in plain \TeX, but implementation is somewhat
better (you can use `\else` clause after the `\ifsomething`).
-
There are public version `\loop...\repeat` and private version
\`\_loop` ...\`\_repeat`. You cannot mix both versions in one loop.
- The `\loop` macro keeps its original plain TeX meaning. It is not
+ The `\loop` macro keeps its original plain \TeX/ meaning. It is not
expandable and nested `\loop`s are possible only in a \TeX/ group.
\_cod ----------------------------
@@ -64,6 +75,30 @@
\_def \_iterate {\_body \_ea \_iterate \_fi}
\_doc -----------------------------
+ \`\xloop` `<parameters>\do <codeA> \ifsomething <codeB> \repeat` or\nl
+ \`\_xloop` `<parameters>\_do <codeA> \_ifsomething <codeB> \_repeat`
+ behave analogically like \^`\loop`, but moreover: you can specify a rule of
+ parameters scanning (like in `\def` primitive) and you can
+ use these parameters (i.e. `#1`, `#2`, etc.) in the <codeA> or <codeB>.
+ Each iteration of this loop reads next parameters from the input queue
+ (just after `\repeat`) using the <parameters> rule. Example:
+ \begtt
+ \def\countparams{\tmpnum=0
+ \xloop ##1,\do \ifx\end##1\empty \else \incr\tmpnum \repeat}
+ \def\list{A, B, C}
+ \ea \countparams \list,\end, % \tmpnum = the number of comma separated parameters
+ \endtt
+ Second new feature: the \^`\xloop` macro is expandable,
+ if <codeA> and <codeB> include only expandable macros. This is not the
+ case of previous example but you can prefix `\tmpnum=0` and `\incr` by
+ the `\immediateassignment` \LuaTeX/ primitive and you get expandable macro
+ `\countparams`.
+ \_cod -----------------------------
+
+\_long\_def\xloop#1\do#2\repeat{\_immediateassignment\_long\_def\_body#1{#2\_ea\_body\_fi}\_body}
+\_long\_def\_xloop#1\_do#2\_repeat{\_immediateassignment\_long\_def\_body#1{#2\_ea\_body\_fi}\_body}
+
+ \_doc -----------------------------
{\_let\_moremainpoints=\_relax
\`\foreach` `<list>`\`\do` `{<what>}`
repeats `<what>` for each element of the
@@ -81,15 +116,19 @@
Note that `\foreach <list>\do {<what>}` is equivalent to `\foreach <list>\do #1{<what>}`.
Recommendation: it is better to use private variants of \`\_foreach`.
- When the user writes `\input tikz` then `\foreach` macro is redefined in
+ When the user writes `\load[tikz]` then `\foreach` macro is redefined in
each TikZ environment.
- The private variants use \`\_do` separator instead `\do` separator.}
+ The private variants use \`\_do` separator instead `\do` separator
+ and it isn't redefined.}
\_cod -----------------------------
\_newcount\_frnum % the numeric variable used in \fornum
\_def\_do{\_doundefined} % we need to ask \_ifx#1\_do ...
-\_long\_def\_foreach #1\_do #2#{\_isempty{#2}\_iftrue
+\_def\_foreach{\_foreachAx\_empty} \_def\foreach{\_foreachAy\_empty}
+\_long\_def\_foreachAx #1\_do #2#{\_ea\_foreachAz\_ea{#1}{#2}}
+\_long\_def\_foreachAy #1\do #2#{\_ea\_foreachAz\_ea{#1}{#2}}
+\_long\_def\_foreachAz #1#2{\_isempty{#2}\_iftrue
\_afterfi{\_foreachA{#1}{##1}}\_else\_afterfi{\_foreachA{#1}{#2}}\_fi}
\_long\_def\_foreachA #1#2#3{\_putforstack
\_immediateassignment \_long\_gdef\_fbody#2{\_testparam##1..\_iftrue #3\_ea\_fbody\_fi}%
@@ -98,9 +137,6 @@
\_long\_def\_testparam#1#2#3\_iftrue{\_ifx###1\_empty\_ea\_finbody\_else}
\_long\_def\_finbody#1\_finbody{}
-\_long\_def\foreach #1\do#2#{\_isempty{#2}\_iftrue
- \_afterfi{\_foreachA{#1}{##1}}\_else\_afterfi{\_foreachA{#1}{#2}}\_fi}
-
\_doc -----------------------------
{\_let\_moremainpoints=\_relax
\`\fornum` `<from>..<to>` \`\do` `{<what>}` or
@@ -112,7 +148,7 @@
The test in the \`\_fornumB` says: if (<to> $\string<$ <current number>
AND <step> is positive) or if (<to> $>$ <current number> AND <step> is
negative) then close loop by `\_getforstack`. Sorry, the condition is
- writen by somewhat cryptoid \TeX/ language.}
+ written by somewhat cryptoid \TeX/ language.}
\_cod -----------------------------
\_def\_fornum#1..#2\_do{\_fornumstep 1:#1..#2\_do}
@@ -175,7 +211,7 @@
\foreachdef\mymacro #1,{[#1]}
\mymacro{a,b,cd,efg,}
\endtt
- expands to [a][b][cd][efg]. Such user defined macros are more effecive during processing
+ expands to [a][b][cd][efg]. Such user defined macros are more effective during processing
than `\foreach` itself because they need not to operate with the for-stack.
\_cod ----------------------------
@@ -255,9 +291,9 @@
The category codes are relevant here. The macro is expandable.
\_cod ----------------------------
-\_long\_def\_isinlist#1#2{%
+\_long\_def\_isinlist#1#2#3{%
\_immediateassignment\_long\_def\_isinlistA##1#2##2\_end/_%
- {\_if\_relax\_detokenize{##2}\_relax \_ea\_unless\_fi}%
+ {\_if\_relax\_detokenize{##2}\_relax \_ea\_unless\_fi#3}%
\_ea\_isinlistA#1\_endlistsep#2\_end/_%
}
\_public \isinlist ;
@@ -268,11 +304,11 @@
\_cod -----------------------------
\_newread \_testin
-\_def\_isfile #1{%
+\_def\_isfile #1#2{%
\_openin\_testin ={#1}\_relax
\_ifeof\_testin \_ea\_unless
\_else \_closein\_testin
- \_fi
+ \_fi #2%
}
\_public \isfile ;
@@ -384,6 +420,10 @@
\_endcode
+2024-11-24 \foreach bug fixed: \foreach {xx}\do {...}
+2024-11-12 \isinlist, \isfile allow space before \iftrue/\iffalse
+2024-11-10 \xloop implemented.
+2024-09-10 \afterxfi implemented.
2024-02-19 \qcasesof reimplemented, it supports | for more phrases.
2023-12-07 \_testparam define \long (big fixed).
2023-10-17 \qcasesof introduced, \xcasesof reimplemented.
diff --git a/Master/texmf-dist/tex/optex/base/lang-data.opm b/Master/texmf-dist/tex/optex/base/lang-data.opm
index 17aa26c4bfb..a1634a2e7f9 100644
--- a/Master/texmf-dist/tex/optex/base/lang-data.opm
+++ b/Master/texmf-dist/tex/optex/base/lang-data.opm
@@ -201,5 +201,5 @@
2022-08-31: \_sortingdatahu corrected
2022-06-28: Spanish, Polish, French, Swedish, Hungarian sorting rules added
2022-06-28: German sorting rules added
-2022-02-19: concept finalized, but data still far of completness
+2022-02-19: concept finalized, but data still far of completeness
2022-02-04: released
diff --git a/Master/texmf-dist/tex/optex/base/lists.opm b/Master/texmf-dist/tex/optex/base/lists.opm
index b372edf635a..6fe699fedeb 100644
--- a/Master/texmf-dist/tex/optex/base/lists.opm
+++ b/Master/texmf-dist/tex/optex/base/lists.opm
@@ -125,6 +125,6 @@
2023-10-20 \style d moved from OpTeX trick 0108 to the format
2022-02-25 \olistskipamount, \ilistskipamount, \itemskipamount introduced
-2021-03-10 \_ifmmode*\_else\_ea\_startitem\_fi added to * defintition
+2021-03-10 \_ifmmode*\_else\_ea\_startitem\_fi added to * definition
2020-04-21 \isnextchar\par added to \enditems
2020-03-18 introduced
diff --git a/Master/texmf-dist/tex/optex/base/logos.opm b/Master/texmf-dist/tex/optex/base/logos.opm
index 1168c25b58f..0b0aff909c8 100644
--- a/Master/texmf-dist/tex/optex/base/logos.opm
+++ b/Master/texmf-dist/tex/optex/base/logos.opm
@@ -57,7 +57,7 @@
\_doc ----------------------------
The expandable versions of logos used in Outlines need the expandable
- \`\ingnslash` (instead of the \^`\ignoreslash`).
+ \`\ignslash` (instead of the \^`\ignoreslash`).
\_cod \_fin ----------------------
\_def\_ignslash#1{\_ifx/#1\_else #1\_fi}
diff --git a/Master/texmf-dist/tex/optex/base/makeindex.opm b/Master/texmf-dist/tex/optex/base/makeindex.opm
index a3af094f26d..bd9ccde7512 100644
--- a/Master/texmf-dist/tex/optex/base/makeindex.opm
+++ b/Master/texmf-dist/tex/optex/base/makeindex.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \makeindex {Makeindex and sorting <2023-06-02>} % preloaded in format
+\_codedecl \makeindex {Makeindex and sorting <2024-12-01>} % preloaded in format
\_doc -----------------------------
\^`\makeindex` implements sorting algorithm at \TeX/ macro-language level.
@@ -25,7 +25,7 @@
\_cod -----------------------------
\_def \_sortingdatalatin {%
- /,{ },-,&,@,%
+ |,<,/,{ },_,-,&,@,%
aAàÀâÂäÄáÁ,%
ąĄ,%
bB,%
@@ -64,7 +64,7 @@
źŹ,%
żŻ,%
^^Z,% Hungarian: cz:c^^Z, etc., see \_compoundcharshu in lang-data.opm
- 0,1,2,3,4,5,6,7,8,9,'%
+ 0,1,2,3,4,5,6,7,8,9,',>%
}
\_doc -----------------------------
@@ -76,7 +76,7 @@
Others not mentioned characters have undefined behavior during sorting.
\_cod -----------------------------
-\_def \_ignoredcharsgeneric {.,;?!:'"|()[]<>=+-}
+\_def \_ignoredcharsgeneric {.,;?!:'"()[]=+-}
\_doc -----------------------------
Sorting is always processed by rules of a given language. The macros
@@ -142,8 +142,8 @@
French sorting rule says: if the words are the same except for accents
then accented letters are sorted after unaccented leters but
read the words from their end in the second pass.
- For example corect sorting is: cote $\lt$ côte $\lt$ coté
- $\lt$ côté. This rule can be activated if the contol sequence
+ For example correct sorting is: cote $\lt$ côte $\lt$ coté
+ $\lt$ côté. This rule can be activated if the control sequence
\`\_secondpass``<lang-tag>` is set to \^`\_reversewords`.
For example, `lang-data.opm` declares `\_let\_secondpassfr=\_reversewords`.
@@ -151,7 +151,7 @@
Preparing to primary pass is performed by the \`\_setprimarysorting` macro
implemented here.
The <lang-tag> is saved to the \^`\_sortinglang` macro when sorting is
- initialized in \^`\_dosorting` (it is typicaly derived from current `\language` value).
+ initialized in \^`\_dosorting` (it is typically derived from current `\language` value).
The \^`\_setprimarysorting` is called from \^`\_dosorting` macro and all
processing of sorting is in a group. It sets actual
\^`\_sortingdata`, \^`\_compoundchars` and \^`\_ignoredchars` if given language
@@ -254,7 +254,7 @@
words are equal in the primary pass. It runs \^`\_setsecondarysorting` if it
was not initialized already. Then prepares compared words to `\_tmpa` and
`\_tmpb` and corrects them by \^`\_prepsecondpass` if needed.
- Finaly, the test is recursively done by the macro \`\_testAleBsecondaryX`
+ Finally, the test is recursively done by the macro \`\_testAleBsecondaryX`
`<converted-string1>0\_relax<converted-string2>1\_relax`
\_cod -----------------------------
@@ -282,26 +282,26 @@
\_def\_mergesort #1#2,#3{% by Miroslav Olsak
\_ifx,#1% % prazdna-skupina,neco, (#2=neco #3=pokracovani)
- \_addto\_iilist{#2,}% % dvojice skupin vyresena
+ \_toksapp\_tmptoks{#2,}% % dvojice skupin vyresena
\_sortreturn{\_fif\_mergesort#3}% % \mergesort pokracovani
\_fi
\_ifx,#3% % neco,prazna-skupina, (#1#2=neco #3=,)
- \_addto\_iilist{#1#2,}% % dvojice skupin vyresena
- \_sortreturn{\_fif\_mergesort}% % \mergesort dalsi
+ \_toksapp\_tmptoks{#1#2,}% % dvojice skupin vyresena
+ \_sortreturn{\_fif\_mergesort}% % \mergesort dalsi
\_fi
- \_ifx\_fin#3% % neco,konec (#1#2=neco)
- \_ifx\_empty\_iilist % neco=kompletni setrideny seznam
- \_def\_iilist{#1#2}%
+ \_ifx\_fin#3% % neco,konec (#1#2=neco)
+ \_if;\_the\_tmptoks;% % neco=kompletni setrideny seznam
+ \_tmptoks{#1#2}%
\_sortreturn{\_fif\_fif\_gobbletoend}% % koncim
\_else % neco=posledni skupina nebo \end
\_sortreturn{\_fif\_fif % spojim \indexbuffer+necoa cele znova
- \_edef\_iilist{\_ea}\_ea\_mergesort\_iilist#1#2,#3}%
+ \_tmptoks\_ea{\_ea}\_ea\_mergesort\_the\_tmptoks#1#2,#3}%
\_fi\_fi % zatriduji: p1+neco1,p2+neco2, (#1#2=p1+neco1 #3=p2)
\_isAleB #1#3\_ifAleB % p1<p2
- \_addto\_iilist{#1}% % p1 do bufferu
+ \_toksapp\_tmptoks{#1}% % p1 do bufferu
\_sortreturn{\_fif\_mergesort#2,#3}% % \mergesort neco1,p2+neco2,
\_else % p1>p2
- \_addto\_iilist{#3}% % p2 do bufferu
+ \_toksapp\_tmptoks{#3}% % p2 do bufferu
\_sortreturn{\_fif\_mergesort#1#2,}% % \mergesort p1+neco1,neco2,
\_fi
\_relax % zarazka, na ktere se zastavi \sortreturn
@@ -331,7 +331,7 @@
\_begingroup
\_ifasciisorting \_def\_sortinglang{ASCII}\_fi
\_ifx\_sortinglang\_undefined \_edef\_sortinglang{\_cs{_lan:\_the\_language}}\_fi
- \_message{OpTeX: Sorting \_string#1 (\_sortinglang) ...^^J}%
+ \_sortmessage{OpTeX: Sorting \_string#1 (\_sortinglang) ...^^J}%
\_ismacro\_sortinglang{ASCII}\_iftrue
\_def \_preparesorting##1{\_edef\_tmpb{\_ea\_ignoreit\_csstring##1}}%
\_let \_setsecondarysorting=\_relax
@@ -344,15 +344,17 @@
\_ea\_let \_ea\_compoundchars \_csname _xcompoundchars\_sortinglang\_endcsname
\_fi % \_compoundchars can differ in the second pass of sorting
\_csname _secondpass\_sortinglang \_endcsname % activates \_reversewords if needed
- \_def \_act##1{\_addto #1{##1,}}%
+ \_def \_act##1{\_toksapp\_tmptoks{##1,}}%
+ \_tmptoks{}%
\_edef #1{\_ea}\_ea\_xargs \_ea\_act #1;% commas between items added, mergesort initialized
- \_edef \_iilist{\_ea}\_ea\_mergesort #1\_fin,\_fin
+ \_tmptoks\_ea{\_ea}\_ea\_mergesort \_the\_tmptoks\_fin,\_fin
\_ea\_endgroup
- \_ea\_def\_ea#1\_ea{\_iilist}%
+ \_ea\_def\_ea#1\_ea{\_the\_tmptoks}%
}
+\_let\_sortmessage=\_message % User can do \let\_sortmessage=\_ignoreit, for example
\_doc -----------------------------
- French rules needs reverese reading the words in the second pass.
+ French rules needs reverse reading the words in the second pass.
The \`\_reversewords` is activated in this case and it adds
new job to the macro \`\_prepsecondpass`: it reverses the letters in
the compared words (saved in `\_tmpa` and `\_tmpb`) by the expandable
@@ -437,13 +439,17 @@
}
\setiicodes AÀÂÄÁ,ĆČ,DĎ,EÈÉËÊĚ,IÍÏÎ,LĹĽ,OÖÓÔ,RŔ,ŚŠ,TŤ,UÙÛÜÚŮŰ,YÝŸ,{},
\endtt
+ If the first character of the <word> is \string< or > then it isn't printed.
+ It can be used as first character of the index entry in order to put the entry
+ to a group entries sorted \string<before or >after whole normal entries.
\_cod -----------------------------
\_def\_printii #1&{\_definefirstii #1&%
\_ifx\_firstii\_lastii\_else
\_ea\_newiiletter\_ea{\_firstii}{#1}\_let\_lastii=\_firstii\_fi
\_gdef\_currii{#1}\_the\_everyii\_noindent
- \_hskip-\_iindent \_ignorespaces\_printiiA#1//}
+ \_hskip-\_iindent \_ignorespaces \_isnextchar<{\_ea\_printiiA\_ignoreit}%
+ {\_isnextchar>{\_ea\_printiiA\_ignoreit}{\_printiiA}}#1//}
\_def\_printiiA #1/{\_if^#1^\_let\_previi=\_currii \_else
\_ea\_scanprevii\_previi/&\_edef\_tmpb{\_detokenize{#1}}%
\_ifx\_tmpa\_tmpb \_iiemdash \_else#1 \_gdef\_previi{}\_fi
@@ -559,7 +565,8 @@
\_def\_iiB #1,{\_if$#1$\_else \_iiC#1/\_relax \_ea\_iiB\_fi}
\_def\_iiC #1/#2\_relax{\_if$#2$\_else\_iindex{#2#1}\_fi}
-\_def\_iid #1 {\_leavevmode\_iindex{#1}\_def\_iitypesaved{}#1\_futurelet\_tmp\_iiD}
+\_def\_iid #1 {\_leavevmode\_iindex{#1}\_def\_iitypesaved{}%
+ \_isnextchar<{\_ignoreit}{\_isnextchar>{\_ignoreit}{}}#1\_futurelet\_tmp\_iiD}
\_def\_iiD{\_ifx\_tmp,\_else\_ifx\_tmp.\_else\_space\_fi\_fi}
\_def\_iis #1 #2{{\_def~{ }\_global\_sdef{_,#1}{#2}}\_ignorespaces}
@@ -571,6 +578,9 @@
\_endcode % -------------------------------------
+2024-12-01 < first, > last character for sorting, unprinted by \makindex
+2024-11-24 | set as first in sortingdata: it can be used as item separator
+2024-10-31 \mergesort time-optimized using \toksapp instead \addto
2023-06-02 \_stripfromcaret introduced
2023-03-12 \_definefirstii introduced
2022-06-28 \_reversewords for French sorting introduced
@@ -579,6 +589,6 @@
2022-03-18 \iid didn't ignore space, bug fixed
2022-02-19 \_sotringdataen etc. moved to lang-data.opm file
2021-02-15 \_expandafter -> \_ea
-2021-02-01 secodary sorting: start from code 65
+2021-02-01 secondary sorting: start from code 65
2020-04-21 \isempty \iffalse ... \fi added to \iindex
2020-03-26 introduced
diff --git a/Master/texmf-dist/tex/optex/base/maketoc.opm b/Master/texmf-dist/tex/optex/base/maketoc.opm
index cb4c318b130..d373d0994d9 100644
--- a/Master/texmf-dist/tex/optex/base/maketoc.opm
+++ b/Master/texmf-dist/tex/optex/base/maketoc.opm
@@ -48,7 +48,7 @@
text text .................... <pageno>
\endtt
Margins given by `\leftskip` and `\rightskip` are denoted by `|` in the
- examle above.
+ example above.
\nl
\`\tocrefnum` is the global counter of all TOC records (used by hyperlinks).
\_cod ------------------------------------
@@ -85,7 +85,7 @@
* \`\_tocdotfill` creates dots in the TOC.
* \`\_nofirst``\macro` applies the `\macro` only if we don't print the first
record of the TOC.
- * \`\_tocpar` finalizes one TOC recors whith rlapped `<pageno>`.
+ * \`\_tocpar` finalizes one TOC record with rlapped `<pageno>`.
* \`\_pgn``{<pageno>}` creates <pageno> as link to real `<gpage>` saved in `#6`
of \^`\_tocline`. This is temporarily defined in the \^`\_tocline`.
\enditems
@@ -98,7 +98,7 @@
\_def\_tocpar{\_nobreak \_hskip-2\_iindent\_null \_par}
\_doc -----------------------------------
- If you want a special formating of TOC with adding more
+ If you want a special formatting of TOC with adding more
special lines (no generated as titles from `\chap`, `\sec`, `\secc`), you
can define `\addtotoc{<level>}{<type>}{<number>}{<o-title>}{<title>}` macro:
\begtt
diff --git a/Master/texmf-dist/tex/optex/base/margins.opm b/Master/texmf-dist/tex/optex/base/margins.opm
index c7751ccb064..b3948b81403 100644
--- a/Master/texmf-dist/tex/optex/base/margins.opm
+++ b/Master/texmf-dist/tex/optex/base/margins.opm
@@ -65,7 +65,7 @@
\_doc ----------------------------
\`\magscale` `[<factor>]` does `\mag=<factor>` and recalculates page
dimensions to their true values.\nl
- \`\_truedimen``<dimen-register>` retunrs true value of <dimen-register>
+ \`\_truedimen``<dimen-register>` returns true value of <dimen-register>
regardless of `\mag`.
\_cod ----------------------------
diff --git a/Master/texmf-dist/tex/optex/base/math-macros.opm b/Master/texmf-dist/tex/optex/base/math-macros.opm
index 9d0887ee0fb..ccdcfbc9331 100644
--- a/Master/texmf-dist/tex/optex/base/math-macros.opm
+++ b/Master/texmf-dist/tex/optex/base/math-macros.opm
@@ -1,6 +1,6 @@
% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \sin {Math macros plus mathchardefs <2024-06-02>} % preloaded in format
+\_codedecl \sin {Math macros plus mathchardefs <2024-11-19>} % preloaded in format
\_doc -----------------------------
The category code of the character `_` remains as the letter (11) and the mathcode
@@ -385,7 +385,7 @@
height+depth in em units.\nl
The \^`\big`, \^`\Big`, \^`\bigg`, \^`\Bigg` macros keep the strut height+depth
from plain \TeX/ and \^`\bbig` is a new macro in \OpTeX/. It generates the size
- 1.44\,em beween \^`\big` and \^`\Big` which is
+ 1.44\,em between \^`\big` and \^`\Big` which is
accessible in most of Unicode math fonts (but not in classical `cmex10`).
\_cod -----------------------------
@@ -1101,15 +1101,18 @@
\_def\_mathbox#1{{\_mathstyles{\_hbox{%
\_ifnum\_stylenum<2 \_everymath{\_currstyle}%
- \_else
+ \_else \_ifx \_normalmath\_normalunimath
\_ifnum\_stylenum=2 \_def\_textmff{ssty=1;}\_fi
\_ifnum\_stylenum=3 \_def\_textmff{ssty=2;}\_def\_scriptmff{ssty=2;}\_fi
- \_typoscale[\_dobystyle{}{}{700}{500}/]\_fi #1}}}%
+ \_typosize[\_ea\_ignorept\_the\_fontdimen6\_dobystyle{}{}\_scriptfont\_scriptscriptfont1/]%
+ \_else \_typoscale[\_dobystyle{}{}{700}{500}/]%
+ \_fi\_fi #1}}}%
}
\_public \mathbox ;
\_endcode %---------------------------------------------------
+2024-11-19 \typosize used fo Uni-fonts in \mathbox in order to respect their sizes
2024-06-02 don't apply \mathsbon twice
2023-05-24 \matsbon: "local num" added
2023-05-22 \mathsbon: \alpha_i\beta_j -> \alpha _i\beta _j (bug fixed)
@@ -1121,13 +1124,13 @@
2021-03-19 allow text mode \{ and \}
2021-02-15 \_mathbox redefines \_textmff etc. in order to respect optical sizes
2021-02-04 \_bordermatrixwithdelims introduced.
-2021-01-23 better expession for math styles in \matrix
+2021-01-23 better expression for math styles in \matrix
2021-01-22 bad use of \_stylenum in \matrix + bad value (bug fix: \_stylenum->\_mtstylenum)
2020-12-17 \box0->\hbox{\box0} in \_finphant and \_finsmash, see https://tex.stackexchange.com/questions/574997/
2020-06-14 \borermatrix, \cases corrected
2020-06-13 \adots introduced, \matrix smaller in T mode too.
2020-06-03 \notin corrected
-2020-06-02 $$\par$$ error is supressed, so we define \(l)eqalign(no), \displayines as \long
+2020-06-02 $$\par$$ error is suppressed, so we define \(l)eqalign(no), \displayines as \long
2020-05-30 \cases: group added in the second column.
"\displaylines to<size>" implemented and documented.
2020-05-11 \let\|=\Vert, bug fixed
diff --git a/Master/texmf-dist/tex/optex/base/math-preload.opm b/Master/texmf-dist/tex/optex/base/math-preload.opm
index fbfdc8af1e9..bcbfa175f8c 100644
--- a/Master/texmf-dist/tex/optex/base/math-preload.opm
+++ b/Master/texmf-dist/tex/optex/base/math-preload.opm
@@ -194,7 +194,7 @@
them only for 10\,pt typesetting). The `\skewchar` of some math families are
set here too.\nl
\^`\_setmathparam \Umathspaceafterscript` is used instead `\scriptspace`
- setting because \LuaTeX/ ingnores `\scriptspace` in most cases. There is
+ setting because \LuaTeX/ ignores `\scriptspace` in most cases. There is
small difference from classical \TeX/: we set \"scaled"
`\Umathspaceafterscript` dependent on textstyle, scriptstyle, etc.\ sizes.
The \`\_scriptspacefactor` is set to 0.05 which gives the same result
@@ -251,7 +251,7 @@ For example
2022-12-01 reading number by \_loadmathfamily, \_setmathfamily more robust
2022-11-16: \_corrmsize removed, \_mfactor introduced
-2022-09-04: \crampedstyles setings added.
+2022-09-04: \crampedstyles settings added.
2022-07-22: \_setmathparam\_Umathspaceafterscript added.
2022-02-22: \rm, \it, etc moved to fonts-select, \_marm, \_mait etc. introduced
2020-05-06: \itfam, \ttfam removed, (Unicode math preferred)
diff --git a/Master/texmf-dist/tex/optex/base/more-macros.opm b/Master/texmf-dist/tex/optex/base/more-macros.opm
index 7e1d1e2b94a..ef6c6faf784 100644
--- a/Master/texmf-dist/tex/optex/base/more-macros.opm
+++ b/Master/texmf-dist/tex/optex/base/more-macros.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \eoldef {OpTeX useful macros <2024-02-10>} % preloaded in format
+\_codedecl \eoldef {OpTeX useful macros <2024-10-31>} % preloaded in format
\_doc -----------------------------
We define \`\opinput` `{<file name>}` macro which
@@ -78,7 +78,7 @@
\_public \normalcatcodes ;
\_doc -----------------------------
- The \`\load` `[<filename-list>]` loads files specfied in
+ The \`\load` `[<filename-list>]` loads files specified in
comma separated `<filename-list>`. The first space (after comma)
is ignored using the trick `#1#2,`: first parameter is unseparated.
The `\load` macro saves information about loaded files by setting
@@ -205,39 +205,47 @@
`\_replacestringsA#1<textA>{...}` and runs
`\_replacestringsA<foo-body>?<textA>!<textA>`.
So, `#1` includes the first part of <foo-body> before first <textA>.
- It is saved to \`\_tmptoks` and `\_replacestringsB` is run in a loop.
- It finishes processing or appends the next part to `\_tmptoks` separated by
- <textB> and continues loop. The final part of the macro removes the last `?`
- from resulting `\_tmptoks` and defines a new version of the `\foo`.
-
- The \^`\replstring` macro is not expandable, but you can create your
- expandable macro, for example:
- \begtt
- \def\replAB#1{\immediateassigned{\def\tmp{#1}\replstring\tmp{A}{B}}\the\_tmptoks}
- \replAB {text A \and A} % expands to "text B \and B"
- \endtt
-
- There exists another limitation of the \^`\replstring` macro, see
- \ulink[http://petr.olsak.net/optex/optex-tricks.html\#xreplstring]{\OpTeX/ trick 0136}.
- The expandable \^`\xreplstring` macro is defined by Lua code here.
- And \ulink[http://petr.olsak.net/optex/optex-tricks.html\#replmacro]{\OpTeX/ trick 0137}
- defines \^`\replmacro` which enables more general modifications of macros by regular expressions.
+ It is saved to \`\_repltoks` and `\_replacestringsB` is run with `\_replacestingsC` in a loop.
+ It finishes processing (if final `!` is scanned) or appends the next part to `\_repltoks` separated by
+ <textB> and continues loop. The final part of the \^`\replstring` macro removes the last `?`
+ from resulting `\_repltoks` and defines a new version of the `\foo`.
\_cod -----------------------------
-\_newtoks\_tmptoks
+\_newtoks\_repltoks
\_catcode`!=3 \_catcode`?=3
-\_def\_replstring #1#2#3{% \replstring #1{stringA}{stringB}
- \_long\_def\_replacestringsA##1#2{\_tmptoks{##1}\_replacestringsB}%
- \_long\_def\_replacestringsB##1#2{\_ifx!##1\_relax \_else \_toksapp\_tmptoks{#3##1}%
- \_ea\_replacestringsB\_fi}%
- \_ea\_replacestringsA #1?#2!#2%
- \_long\_def\_replacestringsA##1?{\_tmptoks{##1}\_edef#1{\_the\_tmptoks}}%
- \_ea\_replacestringsA \_the\_tmptoks}
+\_long\_def\_replstring #1#2#3{% \replstring #1{stringA}{stringB}
+ \_long\_def\_replacestringsA##1#2{\_repltoks\_ea{##1}\_replacestringsB\_empty}%
+ \_long\_def\_replacestringsB##1#2{\_ea\_replacestringsC\_ea{##1}}%
+ \_long\_def\_replacestringsC##1{\_ifx!##1\_empty\_else
+ \_toksapp\_repltoks{#3##1}\_ea\_replacestringsB\_ea\_empty\_fi}%
+ \_ea\_replacestringsA \_ea\_empty#1?#2!#2%
+ \_ea\_replacestringsD \_ea\_empty\_the\_repltoks#1}
+\_long\_def\_replacestringsD #1?#2{\_repltoks\_ea{#1}\_edef#2{\_the\_repltoks}}%
\_normalcatcodes
\_public \replstring ;
\_doc -----------------------------
+ You can find three special tricks in the \^`\replstring` code:
+ \begitems
+ * Adding and removing `?` character: without this the
+ `\def\b{xxxA}\replstring\b{AA}{BB}` will cause an error.
+ * Using `\_toksapp` instead `\addto`: without this you cannot have $`#`_6$
+ in the string. Moreover, it significantly
+ reduces the calculation time. Unfortunately, it does \^`\replstring` unexpandable.
+ * Using `\_empty` before scanning separated parameters and removing it
+ after scanning by \^`\ea`: without this \TeX/
+ removes braces from `<textA>{xxx}<textA>`.
+ \enditems
+
+ The \^`\replstring` macro isn't expandable. But you can use
+ \ulink[http://petr.olsak.net/optex/optex-tricks.html\#xreplstring]{\OpTeX/ trick 0136}.
+ The expandable \^`\xreplstring` macro with more features is defined by Lua code here.
+ And \ulink[http://petr.olsak.net/optex/optex-tricks.html\#replmacro]{\OpTeX/ trick 0137}
+ defines \^`\replmacro` which enables more general modifications of macros by regular expressions.
+ \_cod -----------------------------
+
+ \_doc -----------------------------
The \`\catcode` primitive is redefined here. Why?
There is very common cases like \code{\\catcode`}`<something>`
or `\catcode"<number>` but these characters
@@ -408,6 +416,8 @@
\_endcode % -------------------------------------
+2024-10-31 \_tmptoks replaced by \_repltoks in \replstring
+2024-09-09 \replstring: uses \toksapp (better speed) and \empty (keeps braces)
2024-02-10 \optdef reimplemented, it can create expandable macros now.
2024-01-18 \bracedparam reimplemented.
2023-12-04 \nnum introduced
diff --git a/Master/texmf-dist/tex/optex/base/multicolumns.opm b/Master/texmf-dist/tex/optex/base/multicolumns.opm
index d84aef69c6f..ec80d0f208d 100644
--- a/Master/texmf-dist/tex/optex/base/multicolumns.opm
+++ b/Master/texmf-dist/tex/optex/base/multicolumns.opm
@@ -1,13 +1,13 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \begmulti {Balanced columns <2022-11-26>} % preloaded in format
+\_codedecl \begmulti {Balanced columns <2024-10-31>} % preloaded in format
\_doc -----------------------------
\`\_betweencolumns` or \`\_leftofcolumns` or \`\_rightofcolumns` include
a material printed between columns or left of all columns or right of all
- columns respectivelly. The \^`\_betweencolumns` must include a
+ columns respectively. The \^`\_betweencolumns` must include a
stretchability or a material with exactly \^`\colsep` width. You can
- redefine these macros. For example the rule between colums can be reached
+ redefine these macros. For example the rule between columns can be reached
by `\_def\_betweencolumns{\hss\vrule\hss}`.\nl
\`\_multiskip` puts its material at the start and at the end of
\^`\begmulti`...\^`\endmulti`.
@@ -35,8 +35,6 @@
`\widowpenalty` and `\clubppenalty` (they are set to 10000 in \OpTeX/).
\_cod -----------------------------
-\_newcount\_mullines
-
\_def\_begmulti #1 {\_par\_bgroup\_wipeepar
\_ifnum\_lastpenalty>10000 \_vskip4.5\_baselineskip\_penalty9999 \_vskip-4.5\_baselineskip \_fi
\_multiskip \_def\_Ncols{#1}
@@ -45,8 +43,6 @@
\_setbox0=\_hbox{\_leftofcolumns\_rightofcolumns}%
\_advance\_hsize by-\_wd0 \_advance\_hsize by\_colsep
\_divide\_hsize by\_Ncols \_advance\_hsize by-\_colsep
- \_mullines=0
- \_def\_par{\_ifhmode\_endgraf\_global\_advance\_mullines by\_prevgraf\_fi}%
}
\_def\_endmulti{\_vskip-\_prevdepth\_vfil
\_ea\_egroup\_ea\_egroup\_ea\_baselineskip\_the\_baselineskip\_relax
@@ -57,9 +53,8 @@
\_penalty0 % initialize \_pageoal
\_ifdim\_pagegoal=\_maxdimen \_setcolsize\_vsize
\_else \_setcolsize{\_dimexpr\_pagegoal-\_pagetotal}\_fi
- \_ifdim \_dimen1<2\_baselineskip
- \_vfil\_break \_setcolsize\_vsize \_fi
- \_ifnum\_mullines<\_tmpnum \_dimen0=\_ht6 \_else \_dimen0=.8\_maxdimen \_fi
+ \_ifdim \_dimen1<2\_baselineskip \_vfil\_break \_setcolsize\_vsize \_fi
+ \_setsplitsize % sets \_dimen0 = \_ht6
\_divide\_dimen0 by\_Ncols \_relax
%% split the material to more pages?
\_ifdim \_dimen0>\_dimen1 \_splitpart
@@ -72,17 +67,15 @@
\_cod -----------------------------
\_def\_makecolumns{\_bgroup % full page, destination height: \dimen1
- \_vbadness=20000 \_dimen6=\_wd6
+ \_vbadness=20000 \_splitmaxdepth=\_maxdepth \_dimen6=\_wd6
\_createcolumns
\_printcolumns
- \_dimen0=\_dimen1 \_divide\_dimen0 by\_baselineskip \_multiply\_dimen0 by\_Ncols
- \_global\_advance\_mullines by-\_dimen0
\_egroup
}
\_def\_splitpart{%
\_makecolumns % full page
\_vskip 0pt plus 1fil minus\_baselineskip \_break
- \_ifnum\_mullines<\_tmpnum \_dimen0=\_ht6 \_else \_dimen0=.8\_maxdimen \_fi
+ \_setsplitsize % sets \_dimen0 = \_ht6
\_divide\_dimen0 by\_Ncols \_relax
\_ifx\_balancecolumns\_flushcolumns \_advance\_dimen0 by-.5\_vsize \_fi
\_setcolsize\_vsize \_dimen2=\_dimen1
@@ -101,11 +94,11 @@
\_def\_balancecolumns{\_bgroup \_setbox7=\_copy6 % destination height: \dimen0
\_ifdim\_dimen0>\_baselineskip \_else \_dimen0=\_baselineskip \_fi
\_vbadness=20000 \_dimen6=\_wd6 \_dimen1=\_dimen0
- \_def\_tmp{\_createcolumns
+ \_def\_trybalance{\_createcolumns
\_ifvoid6 \_else
\_advance \_dimen1 by.2\_baselineskip
\_setbox6=\_copy7
- \_ea \_tmp \_fi}\_tmp
+ \_ea \_trybalance \_fi}\_trybalance
\_printcolumns
\_egroup
}
@@ -120,7 +113,7 @@
\`\_printcolumns` prints the columns prepared in `\box1`.
The first `\hbox{}` moves typesetting point to the next baseline.
Next negative skip ensures that the first line from
- splitted columns is at this position.
+ split columns is at this position.
\_cod -----------------------------
\_def\_setcolsize #1{\_dimen1=#1\_relax
@@ -142,8 +135,36 @@
}
\_public \begmulti \endmulti ;
+ \_doc -----------------------------
+ The accumulated `\box6` (before its splitting to pages and columns) can
+ be very large and we cannot measure it with classical \TeX/ methods because
+ we can get \"dimension too lagre" error or arithmetic overflow.
+ The \TeX/ limit for dimensions is about 5.75\,m. For example,
+ the `\box6` of the index in this document has about 6.5\,m height.
+
+ The \`\_rawht``<box-num>` macro solves this problem.
+ It expands to the height plus depth of
+ given `\vbox` as an integer in points (i.e. the the fraction part of points is
+ stripped and unit isn't appended). The limit $2^{31}$ of such an integer
+ allows us to measure boxes with many kilometers height.
+
+ The trick used in the \`\_setsplitsize` macro sets `\dimen0` to the maximum of
+ `.8\maxdimen` and actual `\ht6`, because 13100 is `.8\maxdimen` in points.
+ This is sufficient because if the `\dimen0` is big then we get $n$
+ columns for full page. This is not the last page where exact calculations
+ for balancing is needed.
+ \_cod -----------------------------
+
+\_def\_setsplitsize{%
+ \_ifnum \_rawht6 > 13100 \_dimen0 = .8\_maxdimen
+ \_else \_dimen0=\_ht6 \_def\_rawht6{0}\_fi
+}
+\_def\_rawht{\_directlua{optex.raw_ht()}}
+
\_endcode % -------------------------------------
+2024-10-31 \splitmaxdepth set, bug fixed
+2024-09-06 \_rawht implemented, more robust measurement of big boxes
2022-11-26 \at least three lines in the beginning of \begmulti at the page
2022-05-05 `\_betweencolumns` etc. introduced.
2021-05-20 Colors inside \begmulti...\endmuti, bug fixed
diff --git a/Master/texmf-dist/tex/optex/base/optex-tricks.opm b/Master/texmf-dist/tex/optex/base/optex-tricks.opm
index c90b429a4fc..53c3640632d 100644
--- a/Master/texmf-dist/tex/optex/base/optex-tricks.opm
+++ b/Master/texmf-dist/tex/optex/base/optex-tricks.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_undefined {OpTeX tricks ready to autoload <2024-05-07>} % chunks loaded on demand
+\_codedecl \_undefined {OpTeX tricks ready to autoload <2024-12-09>} % chunks loaded on demand
% Selected OpTeX tricks are here, they are auto-loaded if the macro is used first
% namespace: optextrick
@@ -9,43 +9,43 @@
%%%%%%%%%%%%
\newwrite\.outfile
-\def\begfile #1 {\_immediate\_openout\.outfile={#1}%
+\:\def\begfile #1 {\_immediate\_openout\.outfile={#1}%
\_begingroup \_setverb \_endlinechar=`\^^J \.begfileA^^J%
}
\_ea\_def\_ea\.begfileA\_ea#\_ea1\_ea^^J\_csstring\\endfile#2^^J{\_endgroup
\_ifx^#1^\_else \_immediate\_write\.outfile{\_ignoreit #1}\_fi
\_immediate\_closeout\.outfile
}
-\_let\createfile=\begfile
+\:\_let\createfile=\begfile
\_trick 0054 \beglua \begLUA \logginglua ;
%%%%%%%%%%%%
\_newtoks\.luamacros
\.luamacros={\_let\\=\_nbb \_edef\%{\_csstring\%}\_edef\#{\csstring\#}\_let\n=\_relax}
-\_def\beglua{\.savelineno\_bgroup \_setverb \_endlinechar=`\^^J \.begluaA}
+\:\_def\beglua{\.savelineno\_bgroup \_setverb \_endlinechar=`\^^J \.begluaA}
\_ea\_def\_ea\.begluaA\_ea#\_ea1\_csstring\\endlua^^J{\_egroup\.debuglua{#1}\_directlua{#1}}
-\_def\begLUA{\.savelineno\_bgroup \_setverb \_endlinechar=`\^^J \_catcode`\\=0 \.begLUAA}
+\:\_def\begLUA{\.savelineno\_bgroup \_setverb \_endlinechar=`\^^J \_catcode`\\=0 \.begLUAA}
\_def\.begLUAA#1\endLUA^^J{\_the\.luamacros\.debuglua{#1}\_directlua{#1}\_egroup}
\_def\.savelineno{\_edef\.tmp{\_the\_numexpr\_inputlineno+1}}
\_let\.debuglua=\_ignoreit
\_def\.printloglua#1{\_wlog{lua code processed (l.\.tmp):^^J#1-------------}}
-\_def\logginglua{\_let\.debuglua=\.printloglua}
+\:\_def\logginglua{\_let\.debuglua=\.printloglua}
\_trick 0055 \sethours \setminutes \setseconds \setweekday ;
%%%%%%%%%%%%
\_newcount\.hours \_newcount\.minutes \_newcount\.seconds \_newcount\.weekday
-\_def\setminutes{%
+\:\_def\setminutes{%
\.minutes=\_directlua{tex.sprint(\_the\_time\_pcent 60)}\_relax
\.hours=\_directlua{tex.sprint(math.floor(\_the\_time/60))}\_relax
}
-\_let\sethours=\setminutes
-\_def\setseconds{\_ea\.setsecondsA\_pdffeedback creationdate\_relax}
+\:\_let\sethours=\setminutes
+\:\_def\setseconds{\_ea\.setsecondsA\_pdffeedback creationdate\_relax}
\_def\.setsecondsA#1#2#3#4#5#6#7#8#9{\.setsecondsB}
\_def\.setsecondsB#1#2#3#4#5#6#7#8\_relax{\.seconds=#6#7\_relax}
-\_def\setweekday{\.weekday=\_directlua{% Zeller's algorithm:
+\:\_def\setweekday{\.weekday=\_directlua{% Zeller's algorithm:
local m, y, K, J
m = \_the\_month \_ifnum\_month<3 +12 \_fi
y = \_the\_year \_ifnum\_month<3 -1 \_fi
@@ -55,9 +55,9 @@
math.floor(K/4) + math.floor(J/4) - 2*J + 6)\_pcent 7)
}\_relax
}
-\_def\.Othe#1{\_ifnum#1<10 0\_fi\_the#1}
+\:\_def\Othe#1{\_ifnum#1<10 0\_fi\_the#1}
-\_nspublic \hours \minutes \seconds \weekday \Othe ;
+\_nspublic \hours \minutes \seconds \weekday ;
\_trick 0132 \thedimen ;
%%%%%%%%%%%%
@@ -114,11 +114,19 @@
nodetree.print(tex.box[\_the\_tmpnum])
}}
+\_trick 0143 \mathinexpr ;
+%%%%%%%%%%%%
+
+\_def\mathinexpr{\_directlua{\_foreach{abs}{acos}{asin}{atan}{ceil}{cos}{deg}{exp}%
+ {floor}{fmod}{huge}{log}{max}{maxinteger}{min}{mininteger}{modf}%
+ {pi}{rad}{random}{randomseed}{sin}{sqrt}{tan}{tointeger}{type}{ult}%
+ \_do{##1=math.##1 }}%
+}
\_trick 0134 \rebox \leftfill \rightfill \lrfill ;
%%%%%%%%%%%%
-\_def\rebox{\_directlua{
+\:\_def\rebox{\_directlua{
local nod = tex.box[token.scan_int()] % read head node of the given box
if not(nod==nil) and nod.id==1 then % given box must be \vbox
for n in node.traverse(nod.head) do
@@ -141,9 +149,9 @@
end
end
}}
-\_def\leftfill {\_leftskip=0pt plus1fill \_parindent=0pt }
-\_def\rightfill{\_rightskip=0pt plus1fill \_parindent=0pt }
-\_def\lrfill{\_leftskip=0pt plus1fill \_rightskip=\_leftskip \_parindent=0pt }
+\:\_def\leftfill {\_leftskip=0pt plus1fill \_parindent=0pt }
+\:\_def\rightfill{\_rightskip=0pt plus1fill \_parindent=0pt }
+\:\_def\lrfill{\_leftskip=0pt plus1fill \_rightskip=\_leftskip \_parindent=0pt }
\_trick 0101 \runsystem ;
@@ -275,13 +283,16 @@ define_lua_command('xreplstring', function()
end,'global') % we want to keep the meanig after group
}
-\_trick 0078 \algol ;
-%%%%%%%%%%%%
+\_trick 0078 0145 0146 \algol \algolkw \algolcap \makeLOA \algolnum ;
+%%%%%%%%%%%%%%%%%%%%%%
\_newtoks \_hisyntaxalg
\_hisyntaxalg = {
\_hicolor K \_bf % Keywords
- \_foreach {Require:}{Ensure:}{Input:}
+ \_replfromto {//}{^^J}{\algolcomment{#1}^^J}
+ \_replthis{++}{{++}}\_replthis{--}{{--}}
+ \_replfromto {$}{$}{${#1}$}
+ \_foreach {Require:}{Ensure:}{Input:}{Output:}{Launch:}
{while}{do}{if}{then}{else}{end}{function}{return}{print}
{for}{all}{range}{continue}{repeat}{until}{loop}
{not}{and}{or}{xor}{true}{false}
@@ -289,35 +300,97 @@ end,'global') % we want to keep the meanig after group
}
\_def\.algolmath#1${\_catcodetable\_optexcatcodes \_scantextokens{#1}$}
-\_def\algol{\_catcode`$=3 %
+\:\_def\algol{\_catcode`$=3 %
\_everymath={\.algolmath}%
\_def\_ttfont{\_rm}%
+ \_def\var##1{{\_it\_adef _{\_vrule height.4pt width4pt depth0pt\_relax}##1}}
\_catcode`\!=13
- \_bgroup \_lccode`\~=`\! \_lowercase{\_egroup \_def~##1~{\_ifx^##1^!\_else{\_bf##1}\_fi}}%
+ \_bgroup \_lccode`\~=`\!
+ \_lowercase{\_egroup \_protected\_def~##1~{\_ifx^##1^!\_else{\_bf##1}\_fi}}%
\_hisyntax{ALG}%
}
-\_def\var#1{{\_it\_adef _{\_vrule height.4pt width4pt\_relax}#1}}
+\:\_def\algolkw#1{\_toksapp\_hisyntaxalg{\_replthis{\n#1\n}{\z K{#1}}}}
+\_ifx\algolcomment\_undefined \_def\algolcomment#1{/\kern-.2em/{\it #1}} \_fi
+
+\_newcount\.anum
+\_def \.theanum {\_othe\_chapnum.\_othe\_secnum.\_the\.anum}
+\_addto\_seccx {\.anum=0 }
+
+\_sdef{_mt:algol:en}{Algorithm} \_sdef{_mt:algol:cs}{Algoritmus}
+
+\:\_def\algolcap{\_isnextchar [{\.capaA}{\.capaA[]}}
+\_def\.capaA [#1]#2\_relax{\_label[#1]%
+ \_incr\.anum
+ \_def\.algoltitle{\_indent\_wlabel{\.theanum}{\_bf\_mtext{algol} \.theanum}%
+ \_enspace\_rm\_strut\_ignorespaces #2}%
+ \_ewref\.Xalg{{}{\.theanum}{\_nospaceafter\_empty#2}}%
+ \_setbox0=\_vbox\_bgroup \_advance\_hsize by-2\_hhkern \_advance\_hsize by-.8pt
+ \_begingroup \_aftergroup\.createalgol
+}
+\_def\.createalgol{\_egroup % \box0 is completed
+ \_frame{\_vbox{\_medskip\_hbox{\.algoltitle}\_medskip\_hrule\_medskip\_box0\_medskip}}%
+ \_endgroup % of \begtt
+}
+\:\_def\makeLOA{%
+ \_ifx\.alglist\_undefined \_opwarning{no data for LOA, try to run TeX again}\_openref
+ \_else \.alglist\_fi
+}
+\_def\.alline #1#2#3#4#5{\_line{\_hskip2em\_llap{\_bf#2\_enspace}#3 \_tocdotfill\ \_ilink[pg:#4]{#5}}}
+
+\:\_def\algolnum{\_ttline=0
+ \_def\_printverbline ##1{\_putttpenalty
+ \_indent
+ \.testindent ##1.\_iftrue \_printverblinenum \_else \_decr\_ttline \_fi
+ \_kern\_ttshift ##1\_par}%
+ \_def\_printverblinenum{\_llap{\_sevenrm \_the\_ttline\_kern.1em}}%
+}
+\_def\.testindent#1#2\_iftrue {\_ea\_ifx#1\_dsp}
+
+\_globaldefs=0 % \refdecl needs to be processed when \localdefs=0
+\_refdecl{%
+ \_def\.alglist{}^^J
+ \_def\.Xalg#1#2#3{\_addto\.alglist{\.alline{#1}{#2}{#3}}%
+ \_ea\_addto\_ea\.alglist\_ea{\_currpage}}^^J
+}
-\_trick 0079 \ttlineref ;
+\_trick 0079 \ttlineref \lref ;
%%%%%%%%%%%%
-\_def\ttlineref#1{\_adef#1[##1]{\.setlref{##1}}}
-\_protected\_def\.setlref#1{\_sxdef{ttlin:#1}{\_the\_ttline}}
-\_def\lref[#1]{\_trycs{ttlin:#1}{??}}
+\:\_def\ttlineref#1{\_protected\_adef#1[##1]{\_label[ttline:##1]\_wlabel{\_the\_ttline}}}
+\:\_def\lref[#1]{\_ref[ttline:#1]}
\_trick 0011 \scaleto \scaletof ;
%%%%%%%%%%%%
-\_def\scaleto#1#{\_def\.tmp{#1}\.scaletoA}
+\:\_def\scaleto#1#{\_def\.tmp{#1}\.scaletoA}
\_def\.scaletoA#1{\_setbox0=\_hbox{{#1}}%
\_edef\.tmp{\_expr{\_bp{\.tmp}/\_bp{\_wd0}}}%
\_transformbox{\_pdfscale{\.tmp}{\.tmp}}{#1}}
-\_def\scaletof#1#{\_def\.tmp{#1}\.scaletofA}
+\:\_def\scaletof#1#{\_def\.tmp{#1}\.scaletofA}
\_def\.scaletofA#1{\_setbox0=\_hbox{{#1}}%
\_edef\.tmpa{\_expr{\_bp{\.tmp}/\_bp{\_wd0}}}%
\.scaletoA{\_setfontsize{mag\.tmpa}\_currvar#1}}
+\_trick 0141 \clipbox ;
+%%%%%%%%%%%%
+
+\_def\.scanthreedimens{%
+ \_directlua{tex.print(string.format('{\_pcent d}{\_pcent d}{\_pcent d}',
+ token.scan_dimen(),token.scan_dimen(),token.scan_dimen()))}%
+}
+
+\_def\clipbox{\_ea\_ea\_ea\.clipboxA\.scanthreedimens}
+\_def\.clipboxA#1#2#3#4#{\.clipboxB{#1}{#2}{#3}{#4}}
+\_def\.clipboxB#1#2#3#4#5{% #1,#2,#3: width, height, depth, #4 shift, #5 contents.
+ \_hbox to #1sp{%
+ \_pdfliteral{q 0 \_bp{-#3sp} \_bp{#1sp} \_bp{#2sp+#3sp} re W n}%
+ \_puttext #4{#5}%
+ \_pdfliteral{Q}%
+ \_vrule height#2sp depth#3sp width0pt \_hss
+ }%
+}
+
\_trick 0053 \ignoreinspic ;
%%%%%%%%%%%%
@@ -424,14 +497,14 @@ end,'global') % we want to keep the meanig after group
\_ea\_ea\_ea \.remdotxspace \_csname fcit:##1\_endcsname \_end .\ \_end \_relax {##1}%
}\.fcitlist % removing last .\space or .space from each bib-record
}}
-\_def\fullcite[#1]{\_trycs{fcit:#1}{??\_opwarning{\_string\fullcite[#1] unknown label}}}
+\:\_def\fullcite[#1]{\_trycs{fcit:#1}{??\_opwarning{\_string\fullcite[#1] unknown label}}}
\_trick 0071 \shadedframe ;
%%%%%%%%%%%%
\_def\.shadedframedefaults {% defaults:
frame-color=\Grey, % color of frame rules
- text-color=\Black, % color ot text inside the frame
+ text-color=\Black, % color of text inside the frame
shadow-color=\LightGrey, % color of shadow
bg-color=\Yellow, % background color inside the frame
rule-width=1pt, % width of rules used in the frame
@@ -580,7 +653,7 @@ end,'global') % we want to keep the meanig after group
}
\_def\.setcellcolorN#1\_fin#2#3{#2\_the\_tabiteml{\_localcolor#1\_unskip}\_the\_tabitemr#3}
-\_def\multispanc#1#2#3{\_multispan{#1}%
+\:\_def\multispanc#1#2#3{\_multispan{#1}%
\_ea\_ea\_ea\.cellcolexp#2#3\_fin\_hfil\_hfil\_ignorespaces}
\_def\.cellcolexp{\_futurelet\.next\.setcellcolor}
@@ -590,15 +663,15 @@ end,'global') % we want to keep the meanig after group
\_newcount\.tabline \.tabline=1
\_def\crx {\_crcr \_ifodd\.tabline \.colortabline \_else\_noalign{\_hrule height0pt}\_fi \_incr\.tabline}
\_def\.colortabline{\_noalign{\_localcolor\LightGrey
- \_hrule height\ht\_strutbox depth\_dimexpr\_dp\_strutbox +2\_tablinespace\_relax
- \_kern-\_dimexpr\ht\_strutbox+\_dp\_strutbox +2\_tablinespace}}
+ \_hrule height\_ht\_strutbox depth\_dimexpr\_dp\_strutbox +2\_tablinespace\_relax
+ \_kern-\_dimexpr\_ht\_strutbox+\_dp\_strutbox +2\_tablinespace}}
\_trick 0007 \crtop \crbot \crmid ;
%%%%%%%%%%%%
-\_def\crtop{\_crcr \_noalign{\_hrule height.6pt \_kern2.5pt}}
-\_def\crbot{\_crcr \_noalign{\_kern2.5pt\_hrule height.6pt}}
-\_def\crmid{\_crcr \_noalign{\_kern1pt\_hrule height.4pt\_kern1pt}}
+\:\_def\crtop{\_crcr \_noalign{\_hrule height.6pt \_kern2.5pt}}
+\:\_def\crbot{\_crcr \_noalign{\_kern2.5pt\_hrule height.6pt}}
+\:\_def\crmid{\_crcr \_noalign{\_kern1pt\_hrule height.4pt\_kern1pt}}
\_trick 0016 \longtable ;
%%%%%%%%%%%%
@@ -628,8 +701,8 @@ end,'global') % we want to keep the meanig after group
\_trick 0032 \vcent \vbot ;
%%%%%%%%%%%%
-\_def\vbot {\_let\_tableparbox=\_vbox}
-\_def\vcent {\_toksapp\_tabiteml{$}\_tokspre\_tabitemr{$}\_let\_tableparbox=\_vcenter}
+\:\_def\vbot {\_let\_tableparbox=\_vbox}
+\:\_def\vcent {\_toksapp\_tabiteml{$}\_tokspre\_tabitemr{$}\_let\_tableparbox=\_vcenter}
\_trick 0046 \tnote ;
%%%%%%%%%%%%
@@ -638,7 +711,7 @@ end,'global') % we want to keep the meanig after group
\_def\.tnotelist{}
\_def\.tnoteformat{$\Red^{\_rm\_athe\.tnotenum}$}
\_def\tnote#1{\_incr\.tnotenum \.tnoteformat\_global\_addto\.tnotelist{{#1}}}
-\_def\tnoteprint{\_par\_noindent \.tnotenum=0
+\:\_def\tnoteprint{\_par\_noindent \.tnotenum=0
\_ea\_foreach\.tnotelist \_do{\_advance\.tnotenum by1 \.tnoteformat##1 }\_par
\_global\.tnotenum=0 \_gdef\.tnotelist{}%
}
@@ -646,45 +719,224 @@ end,'global') % we want to keep the meanig after group
\_trick 0050 \tabnodes \tablebefore ;
%%%%%%%%%%%%
-\_def\tablebefore{\_ifvmode \_nointerlineskip\_null \_fi
- \_incr\.tndnum \_setpos[t\_the\.tndnum:ori:b]\_ea\.tbpxpy\_ea{\_the\.tndnum}{b}\_decr\.tndnum
+\_newcount\.tndnum \_newcount\.trownum
+\:\_def\tablebefore{\_incr\.tndnum \_ifvmode \_null \_fi
+ \_setpos[t\_the\.tndnum:ori:b]\_ea\.tbpxpy\_ea{\_the\.tndnum}{b}\_decr\.tndnum \_nobreak
}
-\_def\tableafter {\_setpos[t\_the\_tndnum:ori:e]\_ea\.tbpxpy\_ea{\_the\.tndnum}{e}}
+\:\_def\tableafter {\_setpos[t\_the\.tndnum:ori:e]\_ea\.tbpxpy\_ea{\_the\.tndnum}{e}}
\_def\.tbpxpy#1#2{%
- \_def\.tbpx[##1]{\_expr{\_bp{\_posx[t#1:##1]}-\_bp{\_posx[t#1:ori:#2]}}}%
- \_def\.tbpy[##1]{\_expr{\_bp{\_posy[t#1:##1]}-\_bp{\_posy[t#1:ori:#2]}}}%
+ \_def\.tbpx[##1##2]{\_expr{\_bp{\_posx[t#1:##1\_the\_numexpr##2]}-\_bp{\_posx[t#1:ori:#2]}}}%
+ \_def\.tbpy[##1##2]{\_expr{\_bp{\_posy[t#1:##1\_the\_numexpr##2]}-\_bp{\_posy[t#1:ori:#2]}}}%
}
-\_newcount\.tndnum \_newcount\.tablerownum
-\_def\.putnodeh#1{\_omit\_relax
+\_def\.putnodeh#1{\_immediateassigned{\_let\_tabstrutA=\_relax\_tabiteml{}\_tabitemr{}}\_relax
\_setpos[t\_the\.tndnum:l#1]\_hskip0pt plus1fill\_relax \_setpos[t\_the\.tndnum:r#1]}
\_def\.putnodelr{\_fornum 1..\_colnum-1\_do{\.putnodeh{##1}&}\.putnodeh{\_the\_colnum}%
- \_gdef\.putnode{\_noalign{\.putnodev}}\_cr}
-\_def\.putnodev{\_setpos[t\_the\.tndnum:v\_the\.tablerownum]\_incr\.tablerownum}
-\_def\tabnodes{\_incr\.tndnum \.tablerownum=0
- \_def\_tablepxpreset{\_everycr{}}\_let\.putnode=\.putnodelr \_everycr={\.putnode}}
-
-\_def\itl[#1,#2]{\_expr{\.tbpx[l\.enum{#2}]} \_expr{\.tbpy[v\.enum{#1-1}]}}
-\_def\icl[#1,#2]{\_expr{\.tbpx[l\.enum{#2}]}
- \_expr{(\.tbpy[v\.enum{#1-1}]+(\.tbpy[v\.enum{#1}]))/2}}
-\_def\ibl[#1,#2]{\_expr{\.tbpx[l\.enum{#2}]} \_expr{\.tbpy[v\.enum{#1}]}}
-\_def\itc[#1,#2]{\_expr{(\.tbpx[l\.enum{#2}]+(\.tbpx[r\.enum{#2}]))/2}
- \_expr{\.tbpy[v\.enum{#1-1}]}}
-\_def\icc[#1,#2]{\_expr{(\.tbpx[l\.enum{#2}]+(\.tbpx[r\.enum{#2}]))/2}
- \_expr{(\.tbpy[v\.enum{#1-1}]+(\.tbpy[v\.enum{#1}]))/2}}
-\_def\ibc[#1,#2]{\_expr{(\.tbpx[l\.enum{#2}]+(\.tbpx[r\.enum{#2}]))/2}
- \_expr{\.tbpy[v\.enum{#1}]}}
-\_def\itr[#1,#2]{\_expr{\.tbpx[r\.enum{#2}]} \_expr{\.tbpy[v\.enum{#1-1}]}}
-\_def\icr[#1,#2]{\_expr{\.tbpx[r\.enum{#2}]}
- \_expr{(\.tbpy[v\.enum{#1-1}]+(\.tbpy[v\.enum{#1}]))/2}}
-\_def\ibr[#1,#2]{\_expr{\.tbpx[r\.enum{#2}]} \_expr{\.tbpy[v\.enum{#1}]}}
-\_def\iwd[#1,#2]{\_expr{\.tbpx[r\.enum{#2}]-(\.tbpx[l\.enum{#2}])}}
-\_def\iht[#1,#2]{\_expr{\.tbpy[v\.enum{#1-1}]-(\.tbpy[v\.enum{#1}])}}
-
-\_def\.enum#1{\_number\_numexpr#1\_relax}
-\_def\ishift #1{\_ea\.ishifta#1} % \ishift[2,3][1pt,2.5pt]
-\_def\.ishifta \_expr#1 \_expr#2#3#4,#5]{\_expr{#1+(\_bp{#4})} \_expr{#2+(\_bp{#5})}}
-\_def\tabpos#1#2{#1\_ifx\ishift#2\_afterfi{\_ea\_ea\_ea\_ea\_ea\_ea}\_fi\_ea\.tabposA#2}
-\_def\.tabposA\_expr#1 \_expr#2{\_expr{#1}bp \_expr{#2}bp}
+ \_gdef\.putnode{\_noalign{\.putnodebt}}\_cr}
+\_def\.putnodebt{\.nup{-\_tablinespace}{\.putnodeb\_incr\.trownum \.putnodet}%
+ \.settskip \_gdef\.corrposb{\_noalign{\_advance\.trownum by-1 \.putnodeb}}}%
+\:\_def\tabnodes{\_incr\.tndnum \.trownum=0 \_let\.putnode=\.putnodelr \_everycr={\.putnode}%
+ \_foreach \crl\_crl \crll\_crll \crli\_crli \crlli\_crlli \_do ##1##2{%
+ \_def##1{\_crcr\.corrposb##2\.corrpost
+ \_noalign{\.initskip \_glet\.testskip=\_ignoresecond \_glet\.corrposb=\_empty}}}%
+ \_def\crlp##1{\_crcr\.corrposb\_crlp{##1}\.corrpost}%
+ \_addto\_tskipA {\_noalign{\_decr\.trownum \_glet\.corrposb=\_empty
+ \.testskip{\.putnodet}{\.nup\_tablinespace\.putnodet}}}%
+ \_def\.initskip{\_gdef\.settskip{\_gdef\.settskip{\_glet\.testskip=\_usesecond}}}\.initskip
+ \_def\.nup##1##2{\_kern##1 ##2\_kern-##1 }%
+ \_def\.putnodet{\_setpos[t\_the\.tndnum:t\_the\.trownum]}%
+ \_def\.putnodeb{\_setpos[t\_the\.tndnum:b\_the\.trownum]}%
+ \_def\.corrpost{\_noalign{\.putnodet}}%
+}
+\:\_def\itl[#1,#2]{\.tbpx[l#2] \.tbpy[t#1]}
+\:\_def\icl[#1,#2]{\.tbpx[l#2] \_expr{(\.tbpy[t#1]+(\.tbpy[b#1]))/2}}
+\:\_def\ibl[#1,#2]{\.tbpx[l#2] \.tbpy[b#1]}
+\:\_def\itc[#1,#2]{\_expr{(\.tbpx[l#2]+(\.tbpx[r#2]))/2} \.tbpy[t#1]}
+\:\_def\icc[#1,#2]{\_expr{(\.tbpx[l#2]+(\.tbpx[r#2]))/2} \_expr{(\.tbpy[t#1]+(\.tbpy[b#1]))/2}}
+\:\_def\ibc[#1,#2]{\_expr{(\.tbpx[l#2]+(\.tbpx[r#2]))/2} \.tbpy[b#1]}
+\:\_def\itr[#1,#2]{\_expr{\.tbpx[r#2]} \_expr{\.tbpy[t#1]}}
+\:\_def\icr[#1,#2]{\.tbpx[r#2] \_expr{(\.tbpy[t#1]+(\.tbpy[b#1]))/2}}
+\:\_def\ibr[#1,#2]{\.tbpx[r#2] \.tbpy[b#1]}
+\:\_def\iwd[#1,#2]{\_expr{\.tbpx[r#2]-(\.tbpx[l#2])}}
+\:\_def\iht[#1,#2]{\_expr{\.tbpy[t#1]-(\.tbpy[b#1])}}
+
+\:\_def\ishift #1[#2]{\_ea\.ishiftA#1[#2] } % \ishift\icc[2,3][1pt,2.5pt]
+\_def\.ishiftA #1 #2 #3#4,#5]{\_expr{#1+(\_bp{#4})} \_expr{#2+(\_bp{#5})}}
+\:\_def\tabpos#1#2{#1\_ifx\ishift#2\_ea\.tabposA \_else \_ea\.tabposB \_fi #2}
+\_def\.tabposA #1#2[#3]#4#5]{\_ea\.tabposC\_expanded{#1#2[#3][#5] }}
+\_def\.tabposB #1[#2,#3]{\_ea\.tabposC#1[#2,#3] }
+\_def\.tabposC #1 #2 {#1bp #2bp}
+
+
+\_trick 0147 0148 0149 0151 0152 \csvread \csvdecl \dbcreate ;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\_newcount\.dbcol \_newcount\.dbrow
+\:\_def\csvread#1#{\_ifcsname dbmaxrow#1\_endcsname
+ \_opwarning{\_noexpand\csvread ignored: database "#1" created already}%
+ \_ea \_ignoreit
+ \_else \_afterfi{\_par \_bgroup \_def\.dbn{#1}\.dbrow=0 \.csvreadA}\_fi}
+\_def\.csvreadA#1{\_everypar={\.readline}\_input{#1}%
+ \_decr\.dbrow \_sxdef{dbmaxrow\.dbn}{\_the\.dbrow}
+ \_decr\.dbcol \_sxdef{dbmaxcol\.dbn}{\_the\.dbcol}\_egroup}
+\:\_def\csvdecl #1#2#3{%
+ \_eoldef\.readline##1{\_setbox0=\_lastbox \_par \.dbcol=0
+ \_ifnum\.dbrow=0 \_afterfi{\.readitem\.csvsethead}\_else \_afterfi{\.readitem\.csvsetdata}\_fi ##1#3\_fin
+ \_incr\.dbrow}
+ \_def\.readitem##1##2{\_incr\.dbcol
+ \_ifx##2\_fin \_else \_afterfi{\_ifx ##2#1\_afterfi{\.readitemA##1}\_else \_afterfi{\.readitemB##1##2}\_fi}\_fi}
+ \_def\.readitemA ##1##2#2#3{##1{##2}\.readitem##1}
+ \_def\.readitemB ##1##2#3{##1{##2}\.readitem##1}
+} \csvdecl "", % " " , are default data separators
+\_def\.csvsethead#1{\_sxdef{dbcol:\.dbn(#1)}{\_the\.dbcol}\_sxdef{dbhead:\.dbn(\_the\.dbcol)}{#1}}
+\_def\.csvsetdata#1{\_global\_sdef{dbitem:\.dbn(\_the\.dbrow,\_the\.dbcol)}{#1}}
+\:\_def\dbitem#1(#2,#3){\.dbset{#1}%
+ \_ifcsname dbitem:#1(#2,#3)\_endcsname \_unexpanded\_ea\_ea\_ea{\_lastnamedcs}\_else \dbunknown\_fi}
+\_def\.dbset#1{\_immediateassignment\_edef\.dbname{#1}}
+\:\_def\colname#1){\_ifcsname dbcol:\.dbname(#1)\_endcsname \_lastnamedcs \_else 0\_fi)}
+\:\_def\dbhead#1(#2){\_ifcsname dbhead:#1(#2)\_endcsname \_lastnamedcs \_else \dbunknown \_fi}
+\:\_def\dbunknown{??}
+\_let\.dbitem=\dbitem \_let\.colname=\colname
+
+\:\_def\dbhash #1(#2){%
+ \.onlyifdb #1(#2)\dbhash {%
+ \_fornum 1..\cs{dbmaxrow#1}\_do
+ {\_edef\.tmp{\.dbitem#1(##1,#2)}\.sxadef{dbrow:#1(#2)\_detokenize\_ea{\.tmp}}{##1,}}%
+}}
+\_def\.sxadef#1#2{\_ifcsname#1\_endcsname \_sxdef{#1}{\_cs{#1}#2}\_else\_sxdef{#1}{#2}\_fi}
+\_def\.onlyifdb #1(#2)#3#4{\.dbset{#1}%
+ \_ifcsname dbhead:#1(#2)\_endcsname #4\_else
+ \_ifcsname dbmaxrow#1\_endcsname \_opwarning{\_string#3 ignored: undeclared column \.missingcol(#2) in "#1"}%
+ \_else \_opwarning{\_string#3 ignored: database "#1" isn't created}%
+ \_fi\_fi
+}
+\:\_def\dbwhere #1(#2)#3{\.dbset{#1}%
+ \_ifcsname dbrow:#1(#2)\_detokenize{#3}\_endcsname \_ea\_ea\_ea\.firstfromlist\_lastnamedcs;\_else 0\_fi}
+\_def\.missingcol (#1#2){(\_ifx#1\colname \_noexpand#1#2\_else #1#2\_fi)}
+\_def\.firstfromlist #1,#2;{#1}
+
+\:\_def\dbloop #1(#2)#3{\.onlyifdb #1(1)\dbloop {%
+ \_immediateassigned{\_def\.settinglist{}\.dbsetting #2,\_fin=\_fin,}%
+ \_ifcsname dblist:#1\_endcsname
+ \_afterfi{\_ea\_ea\_ea\_foreach\_csname dblist:#1\_endcsname \_do ##1,}%
+ \_else \_afterfi{\_fornum 1..\cs{dbmaxrow#1}\_do}\_fi
+ {\_immediateassigned{\.dbrow=##1 \.settinglist}#3}%
+}}
+\_def\.dbsetting #1#2=#3,{\_ifx#3\_fin \_else \_addto\.settinglist{\.dbdef#1{#3}}\_ea\.dbsetting\_fi}
+\_def\.dbdef#1#2{\_edef#1{\.dbitem\.dbname(\_the\.dbrow,\.colname#2)}}
+\:\_def\dbsort #1(#2){\.onlyifdb #1(#2)\dbsort {% basename column exists:
+ \_def\.dblist{}%
+ \_ifcsname db:sortlist\_endcsname \_afterfi {\_ea\_ea\_ea\_foreach \_lastnamedcs \_do ##1,}%
+ \_else \_afterfi{\_fornum 1..\cs{dbmaxrow#1}\_do}\_fi {%
+ \_edef\.tmp{\.dbitem #1(##1,#2)}\_edef\.tmp{\_detokenize\_ea{\.tmp}{##1}}%
+ \_ea\_addto \_ea\.dblist \_csname +\.tmp\_endcsname
+ \_sdef{+\.tmp}{##1,}}%
+ \_ifx\.dblist \_empty \_else \_dosorting\.dblist \_fi
+ \_sxdef{dblist:#1}{\.dblist}\_global\_slet{db:sortlist}{_undefined}%
+}}
+\:\_def\dbsortfmt#1#2{\_detokenize{#1}|\.fmtnum#2;}
+\:\_def\fmtnum #1;{\_ea\_ignoreit\_the\_numexpr#1+100000\_relax}
+\_let\.fmtnum=\fmtnum
+
+\:\def\dbcreate #1({\_ifcsname dbmaxrow#1\_endcsname
+ \_opwarning{\_noexpand\dbcreate ignored: database "#1" created already}%
+ \_ea \.dbignore \_else \_afterfi {\_bgroup \_edef\.dbname{#1}\.dbcreateA \_empty}\_fi}
+\_def\.dbignore #1){}
+\_def\.dbcreateA #1){\.dbcol=0
+ \_ea \_foreach #1\_do{\_incr\.dbcol
+ \_sxdef{dbcol:\.dbname(##1)}{\_the\.dbcol}\_sxdef{dbhead:\.dbname(\_the\.dbcol)}{##1}}%
+ \_sxdef{dbmaxrow\.dbname}{0}\_sxdef{dbmaxcol\.dbname}{\_the\.dbcol}%
+ \_ifnum\.dbcol=0 \_sxdef{dbhead:\.dbname(1)}{\dbunknown}\fi
+ \_egroup
+}
+\:\_def\dbinsert #1({\.dbinsertA #1(\_empty}
+\_def\.dbinsertA #1(#2){\.onlyifdb #1(1)\dbinsert {%
+ \.dbrow=\_cs{dbmaxrow#1} \_incr\.dbrow \.dbcol=0 \_tmpnum=\cs{dbmaxcol#1}
+ \_ea \_foreach #2\_do
+ {\_incr\.dbcol \_ifnum\.dbcol>\_tmpnum\_else \_sxdef{dbitem:#1(\_the\.dbrow,\_the\.dbcol)}{##1}\_fi}%
+ \_ifnum\.dbcol>\_tmpnum
+ \_opwarning{\_string\dbinsert: data row larger than max column (\_the\.tmpnum) in "#1"}\_fi
+ \_sxdef{dbmaxrow#1}{\_the\.dbrow}%
+}}
+\:\_def\dbitemset #1(#2,#3)#4{\.onlyifdb #1(#3)\dbitemset {\_sxdef{dbitem:#1(#2,#3)}{#4}}}
+\:\_def\dbheadset #1(#2)#3{\.onlyifdb #1(1)\dbheadset{\.dbcol=\_ea\.getrownum \_expanded{#2)}\_relax
+ \_ifnum\.dbcol=0 \_opwarning{\_noexpand\dbheadset ignored: bad column \.missingcol(#2)}%
+ \_else \_sxdef{dbcol:#1(#3)}{\_the\.dbcol}\_sxdef{dbhead:#1(\_the\.dbcol)}{#3}\_fi
+}}
+\_def\.getrownum #1){#1}
+
+\:\_def\dbshow #1(#2){\.onlyifdb #1(1)\dbshow {\_immediateassignment\.dbcol=\_cs{dbmaxcol#1}
+ \_fornum 1..\.dbcol \_do {\.dbps{dbhead:#1(##1)}{#2}{##1}}\dbrowchar \dbheadchar
+ \_fornum 1..\_cs{dbmaxrow#1} \_do {\_fornum 1..\.dbcol \_do {%
+ \.dbps{dbitem:#1(##1,####1)}{#2}{####1}%
+ }\dbrowchar}
+}}
+\_def\.dbps #1#2#3{\_if\_relax\_detokenize{#2}\_relax {\_trycs{#1}{\dbunknown}}\_else \.dbpsA {#1}#2{#3}\fi}
+\_def\.dbpsA #1#2#3#4#5{#2\_trycs{#1}{\dbunknown}#3\_ifnum #5<\.dbcol #4\_fi} % cs, open, close, between, colnum
+\:\_def\dbrowchar{^^J} \:\_def\dbheadchar{}
+\:\_def\dbshowrow #1(#2)(#3){\.onlyifdb #1(1)\dbshowrow {\_immediateassignment\.dbcol=\cs{dbmaxcol#1}
+ \_fornum 1..\.dbcol \_do {\.dbps{dbitem:#1(#2,##1)}{#3}{##1}}%
+}}
+\:\_def\dbshowhead #1(#2){\.onlyifdb #1(1)\dbshowhead {\_immediateassignment\.dbcol=\_cs{dbmaxcol#1}
+ \_fornum 1..\.dbcol \_do {\.dbps{dbhead:#1(##1)}{#2}{##1}}%
+}}
+\:\_def\dbwrite #1(#2)#3{\.onlyifdb #1(1)\dbwrite {%
+ \_immediate\_openout\.dbout={#3}%
+ \_immediate\_write\.dbout{\.dbshow #1(#2)}%
+ \_immediate\_closeout\.dbout
+}}
+\_newwrite\.dbout
+\_let\.dbshow=\dbshow
+
+
+\_trick 0153 0154 \exectree \showtree \jsonread \jsoncnv ;
+%%%%%%%%%%%%%%%%%
+
+\:\_optdef\inode[]{\startinode \startedges}
+\:\_optdef\enode[]#1#2{\execenode{#1}} % #2=\stopinode, should be ignored
+\:\_def\startedges #1{\.edgetest #1\stopinode\startedges}
+\_def\.edgetest#1{\_ifx\stopinode#1\.edgefinal\_else\_ea#1\fi}
+\_def\.edgefinal#1\startedges{\fi\stopinode}
+\:\_def\exectree#1{#1\stopinode}
+
+\_ifx \startinode\_undefined \_def\startinode{} \_fi
+\_ifx \stopinode \_undefined \_def\stopinode{} \_fi
+\_ifx \execenode \_undefined \_def\execenode#1{(#1)} \_fi
+
+\_newcount\.treelevel
+\_let\.ima=\_immediateassignment
+\_def\.spaces{\_fornum 1..\.treelevel \_do{\_space\_space\_space}}
+\_def\.istring#1{\_ifnum\.treelevel>0 \_csstring#1\_fi}
+\_def\.showinodes{%
+ \_def\startinode{\.istring^^J\.spaces\.istring\{\_string\inode[\_the\_opt]\.ima\_incr\.treelevel}
+ \_def\stopinode{\.ima\_decr\.treelevel \.istring\}}
+ \_def\execenode##1{^^J\.spaces{\_string\enode[\_the\_opt] \_unexpanded{{##1}}}}}
+\:\_def\showtree#1{\_immediateassigned{\.treelevel=0
+ \_let\.startinodeB=\startinode \_let\.stopinodeB=\stopinode \_let\.execenodeB=\execenode \.showinodes}%
+ #1\stopinode \_immediateassigned{%
+ \_let\startinode=\.startinodeB \_let\stopinode=\.stopinodeB \_let\execenode=\.execenodeB}%
+}
+
+\_def\.isnschar#1#2#3{\_immediateassignment\_def\_isnextcharA{\_isnextcharB{#1}{#2}{#3}}%
+ \_nospacefuturelet\_next\_isnextcharA} % behaves like \isnextchar but skip spaces
+\:\_let\nonstring=\_useit % the presence of it in the value of \enode means that the value isn't string
+
+\_def\.arrayread#1[#2]#3,{{\_noexpand\inode \.eid \.aread#2,\_fin}\.isnschar\_fin{\_ignoreit}{#1}}
+\_def\.aread{\.isnschar\_bgroup{\.objread\.aread}
+ {\_isnextchar[{\.arrayread\.aread}{\_isnextchar"{\.readstr\.aread}{\.readnostr\.aread}}}}
+\_def\.objread#1#2#3,{{\_noexpand\inode \.eid \.oread#2,\_fin}\.isnschar\_fin{\_ignoreit}{#1}}
+\_def\.oread #1"#2"#3:{\_immediateassignment\_def\.idj{#2}%
+ \.isnschar\_bgroup{\.objread\.oread}
+ {\_isnextchar[{\.arrayread\.oread}{\_isnextchar"{\.readstr\.oread}{\.readnostr\.oread}}}}
+\_def\.readstr#1"#2"#3,{{\_noexpand\enode\.eid{\_unexpanded{#2}}}\.isnschar\_fin{\_ignoreit}{#1}}
+\_def\.readnostr#1#2,{{\_noexpand\enode\.eid{\_noexpand\nonstring{\.nospaces#2 }}}\.isnschar\_fin{\_ignoreit}{#1}}
+\_def\.nospaces#1 {#1\_nospaceafter\_empty}
+\_def\.eid{\_ifx\.idj\_undefined\_else [\.idj]\_immediateassignment\_let\.idj=\_undefined\_fi}
+
+\:\_optdef\jsonread[JSON]#1#2{{\_suppressoutererror=1 \_endlinechar=-1 \_edef\.idj{\_the\_opt}%
+ \_xdef#1{\_ea\.jsoncnv\_input{#2},\_fin}}}
+\:\def\jsoncnv{\.isnschar\_bgroup{\_ea\_useit\.objread\_empty}{\_ea\_useit\.arrayread\_empty}}
+\_let\.jsoncnv=\jsoncnv
+
\_trick 0031 \framedblocks ;
%%%%%%%%%%%%
@@ -716,7 +968,7 @@ end,'global') % we want to keep the meanig after group
\_ifx^#2^\_else \_global\_let\.frnext=y \_let\.printframes=\_relax \_fi
\_ea\.printframes\_fi
}
-\_def\frameslist{}
+\:\_def\frameslist{}
\_ifx\printframe\_undefined
\_def\printframe #1#2#3#4{\_edef\frameslist{\frameslist
.8 g \_bp{#1} \_bp{#2} \_bp{#3} \_bp{#4} re f }%
@@ -776,7 +1028,7 @@ end,'global') % we want to keep the meanig after group
\_def\pstart{\_par \_setbox0=\_vbox\_bgroup
\_def\_par{\_endgraf\_advance\.gprevgraf by\_prevgraf \_prevgraf=0 }}
-\_def\pend{\_par \_global\_tmpnum=\.gprevgraf \_egroup
+\:\_def\pend{\_par \_global\_tmpnum=\.gprevgraf \_egroup
\_ifnum\.firstlinenum=0 \.firstlinenum=1 \_fi
\_advance\_tmpnum by\.firstlinenum
\.firstlinenum=\_tmpnum \_advance\_tmpnum by-1
@@ -795,7 +1047,7 @@ end,'global') % we want to keep the meanig after group
\_trick 0021 \settabs ;
%%%%%%%%%%%%
-\_def\tabs #1\cr{\_setbox0=\_hbox\_bgroup \.tabA #1&\cr&}
+\:\_def\tabs #1\cr{\_setbox0=\_hbox\_bgroup \.tabA #1&\cr&}
\_def\.tabA #1&{\_ifx\cr#1\_egroup\_box0 \_else
\_egroup
\_tmpdim=\_maxdimen \_ea\.tabB \.tabsdata {}\_relax
@@ -830,9 +1082,9 @@ end,'global') % we want to keep the meanig after group
%%%%%%%%%%%%
\_openref
-\_def\thepp#1{\_trycs{pp:\_csstring#1}{?\_the#1}}
-\_def\thepplast#1#2{\_trycs{lastpp:\_csstring#1:#2}{?\_the#1}}
-\_def\truepage{?\_the\_pageno}
+\:\_def\thepp#1{\_trycs{pp:\_csstring#1}{?\_the#1}}
+\:\_def\thepplast#1#2{\_trycs{lastpp:\_csstring#1:#2}{?\_the#1}}
+\:\_def\truepage{?\_the\_pageno}
\_def\incrpp#1{\_incr#1%
\_isdefined{_pgref:pp:\_csstring#1:\_the#1}\_iftrue
\_edef\.tmp{\_cs{_pgref:pp:\_csstring#1:\_the#1}}%
@@ -847,6 +1099,7 @@ end,'global') % we want to keep the meanig after group
}
\_trick 0115 \ispageodd ;
+%%%%%%%%%%%%
\_def\ispageodd#1{%
\_incr\_mnotenum
@@ -859,6 +1112,7 @@ end,'global') % we want to keep the meanig after group
}
\_trick 0033 \iniseccc \seccc ;
+%%%%%%%%%%%%
\_newcount \_secccnum
\_def \_thesecccnum {\_othe\_chapnum.\_the\_secnum.\_the\_seccnum.\_the\_secccnum}
@@ -872,7 +1126,7 @@ end,'global') % we want to keep the meanig after group
\_printseccc{\_scantextokens{#1}}%
\_resetnonumnotoc
}
-\public \seccc ;
+\:\public \seccc ;
\_def \_seccx {\_secccx \_secccnum=0 }
\_def \_secccx {}
@@ -884,23 +1138,23 @@ end,'global') % we want to keep the meanig after group
\_firstnoindent
}
-\_def\iniseccc{} % use it for autoloading the OpTeX trick code before \maketoc
+\:\_def\iniseccc{} % use it for autoloading the OpTeX trick code before \maketoc
\_sdef{_tocl:4}#1#2#3{\_advance\_leftskip by2\_iindent \_cs{_tocl:2}{#1}{#2}{#3}}
\_trick 0066 \makeLOF \makeLOT \captionT \captionF ;
%%%%%%%%%%%%
-\_def\captionT [#1]#2{\_caption/t[#1]\_ewref\.Xtab{{#1}{\_thetnum}{#2}}\_ignorespaces}
-\_def\captionF [#1]#2{\_caption/f[#1]\_ewref\.Xfig{{#1}{\_thefnum}{#2}}\_ignorespaces}
+\:\_def\captionT [#1]#2{\_caption/t[#1]\_ewref\.Xtab{{#1}{\_thetnum}{#2}}\_ignorespaces}
+\:\_def\captionF [#1]#2{\_caption/f[#1]\_ewref\.Xfig{{#1}{\_thefnum}{#2}}\_ignorespaces}
-\_def\.lline#1#2#3#4#5{\_line{\_hskip2em\_llap{\_bf#2 } #3 \_tocdotfill\ \_ilink[pg:#4]{#5}}}
+\_def\.lline#1#2#3#4#5{\_line{\_hskip2em\_llap{\_bf#2\_enspace}#3 \_tocdotfill\ \_ilink[pg:#4]{#5}}}
\_def\.makell#1#2{\_par
- \_ifx#1\_undefined \_opwarning{no data for list of #2, try to run TeX again}\_openref
+ \_ifx#1\_undefined \_opwarning{no data for #2, try to run TeX again}\_openref
\_else #1\_fi
}
-\_def\makeLOF{\.makell\.loflist{figures}}
-\_def\makeLOT{\.makell\.lotlist{tables}}
+\:\_def\makeLOF{\.makell\.loflist{LOF}}
+\:\_def\makeLOT{\.makell\.lotlist{LOT}}
\_globaldefs=0 % \refdecl needs to be processed when \localdefs=0
\_refdecl{%
@@ -921,7 +1175,7 @@ end,'global') % we want to keep the meanig after group
\_trick 0129 \pgforeground ;
%%%%%%%%%%%%
-\_newtoks \pgforeground
+\:\_newtoks \pgforeground
\_addto\_makefootline{
\_istoksempty\pgforeground \_iffalse
@@ -934,6 +1188,17 @@ end,'global') % we want to keep the meanig after group
\_fi
}
+\_trick 0144 \xparshape ;
+%%%%%%%%%%%%
+
+\_newcount\.xprevgraf
+\_def\xparshape{%
+ \.xprevgraf=0
+ \_def\_par{{\_prevgraf=\.xprevgraf\_endgraf}\.xprevgraf=\_prevgraf}%
+ \_parshape}
+\:\_def\endxparshape{\_par \_let\_par=\_endgraf}
+
+
\_trick 0130 \onlyifnew ;
%%%%%%%%%%%%
@@ -950,11 +1215,45 @@ end,'global') % we want to keep the meanig after group
\_def\.onlyifnewA{#1#2}\_fi
\_fi\_ea\_endgroup\.onlyifnewA}
+\_trick 0142 \ismatch \isinmacro ;
+%%%%%%%%%%%%
+
+\_def\.ismatch#1#2{\_ea\.ismatchA\_directlua{
+ tex.sprint("{")
+ tex.sprint(-2,"\_luaescapestring{\_unexpanded{#1}}")
+ tex.sprint("}{")
+ tex.sprint(-2,"\_luaescapestring{\_unexpanded{#2}}")
+ tex.sprint{"}"}
+}}
+\_def\.ismatchA#1#2{\_immediateassignment
+ \_def\.ismatchB##1#2##2\_relax{\_ifx^##2^\_ea\_unless\_fi}%
+ \.ismatchB #1\_sep\_sep#2\_relax
+}
+\:\_def\isinmacro#1{%
+ \_isinlist{\_meaning#1}{->}\_iffalse \_ea\_ignoresecond \_else \_ea\_usesecond \_fi
+ {\_ignoresecond\_unless}{\_ea\.isinmacroA\_meaning#1\_relax}%
+}
+\_def\.isinmacroA #1->#2\_relax{\.ismatch{#2}}
+
+\_nspublic \ismatch ;
+
%%%%%%%%%%%%
\_trick end ;
\_endcode
+2024-12-09 \exectree: bug in default macros fixed
+2024-11-26 \exectree, \jsonread etc. implemented
+2024-11-23 \dbcreate etc. implemented
+2024-11-22 \dbloop etc. implemented
+2024-11-21 \: introduced for warning if a macro is re-defined
+2024-11-21 \csvread added
+2024-11-05 \algolnum added
+2024-11-04 \algolcap, \makeLOA added
+2024-10-31 \xparshape added
+2024-10-27 \mathinexpr added
+2024-10-22 \ismatch, \isinmacro added
+2024-09-10 \clipbox added
2024-05-07 \replmacro added
2024-05-02 \xreplstring added
2024-04-15 \directchar added
diff --git a/Master/texmf-dist/tex/optex/base/optex.ini b/Master/texmf-dist/tex/optex/base/optex.ini
index 0c037d6f4c6..67492d1cdce 100644
--- a/Master/texmf-dist/tex/optex/base/optex.ini
+++ b/Master/texmf-dist/tex/optex/base/optex.ini
@@ -21,7 +21,7 @@
% OpTeX version
-\def\optexversion{1.15 Jun 2024}
+\def\optexversion{1.16 Dec 2024}
\def\fmtname{OpTeX}
\let\fmtversion=\optexversion
diff --git a/Master/texmf-dist/tex/optex/base/optex.lua b/Master/texmf-dist/tex/optex/base/optex.lua
index 71834a56aa9..a0ce7c38554 100644
--- a/Master/texmf-dist/tex/optex/base/optex.lua
+++ b/Master/texmf-dist/tex/optex/base/optex.lua
@@ -34,6 +34,30 @@ function optex.mdfive(file)
tex.print(md5.sumhexa(data))
end
end
+
+-- The `optex.raw_ht ()` function measures the height plus depth of given
+-- `\vbox` saved by `\setbox`. It solves \"dimension too large" problem with big boxes.
+-- It is used in the \^`\_rawht` macro.
+
+function optex.raw_ht()
+ local nod = tex.box[token.scan_int()] -- read head node of the given box
+ local ht = 0
+ if not(nod==nil) and nod.id==1 then -- given box must be \vbox
+ for n in node.traverse(nod.head) do
+ if n.id==0 or n.id==1 or n.id==2 then -- hbox or vbox or rule
+ ht = ht + n.height + n.depth
+ end
+ if n.id==12 then -- glue
+ ht = ht + n.width
+ end
+ if n.id==13 then -- kern
+ ht = ht + n.kern
+ end
+ end
+ end
+ tex.print(string.format('%.0f',ht/65536))
+end
+
--
-- \medskip\secc[lua-alloc] Allocators^^M
local alloc = _ENV.alloc or {}
@@ -314,7 +338,7 @@ function callback.call_callback(name, ...)
if cbtype == nil then
err("cannot call callback '%s' - no such callback exists", name)
elseif cbtype == "exclusive" then
- -- only one function, atleast default function is guaranteed by
+ -- only one function, at least default function is guaranteed by
-- create_callback
return functions[1](...)
elseif cbtype == "simple" then
@@ -360,7 +384,7 @@ call_callback = callback.call_callback
--
-- Create \"virtual" callbacks `pre/post_mlist_to_hlist_filter` by setting
-- `mlist_to_hlist` callback. The default behaviour of `mlist_to_hlist` is kept by
--- using a default function, but it can still be overriden by using
+-- using a default function, but it can still be overridden by using
-- `add_to_callback`.
default_functions["mlist_to_hlist"] = node.mlist_to_hlist
callback.create_callback("pre_mlist_to_hlist_filter", "list")
@@ -392,7 +416,7 @@ end)
-- is used for coloring based on attributes.
-- There is however a challenge - how to call this callback? We could redefine
-- `\shipout` and `\pdfxform` (which both run `ship_out` procedure internally),
--- but they would lose their primtive meaning – i.e. `\immediate` wouldn't work
+-- but they would lose their primitive meaning – i.e. `\immediate` wouldn't work
-- with `\pdfxform`. The compromise is to require anyone to run
-- \`\_preshipout``<destination box number><box specification>` just before
-- `\shipout` or `\pdfxform` if they want to call `pre_shipout_filter` (and
@@ -441,7 +465,7 @@ end, "_tracingmacros")
-- Traditionally, pdf\TeX/ allowed managing PDF page resources (graphics
-- states, patterns, shadings, etc.) using a single toks register,
-- `\pdfpageresources`. This is insufficient due to the expected PDF object
--- structer and also because many \"packages" want to add page resources and
+-- structure and also because many \"packages" want to add page resources and
-- thus fight for the access to that register. We add a finer alternative,
-- which allows adding different kinds of resources to a global page resources
-- dictionary. Note that some resource types (fonts and XObjects) are already
@@ -559,7 +583,7 @@ optex.directpdfliteral = pdfliteral
-- The function {\Red`colorize`}`(head, current, current_stroke, current_tr)`
-- goes through a node list and injects PDF literals according to attributes.
-- Its arguments are the head of the list to be colored and the current color
--- for fills and strokes and the current trasparency attribute.
+-- for fills and strokes and the current transparency attribute.
-- It is a recursive function – nested
-- horizontal and vertical lists are handled in the same way. Only the
-- attributes of “content” nodes (glyphs, rules, etc.) matter. Users drawing
@@ -743,6 +767,7 @@ define_lua_command("_beglocalcontrol", function()
end)
-- History:
+ -- 2024-09-06 raw_ht() implemented
-- 2024-06-02 more checking in add_to_callback and remove_from_callback
-- 2024-02-18 \_beglocalcontrol added
-- 2022-08-25 expose some useful functions in `optex` namespace
diff --git a/Master/texmf-dist/tex/optex/base/others.opm b/Master/texmf-dist/tex/optex/base/others.opm
index b7ad0556fc4..6d9eb001177 100644
--- a/Master/texmf-dist/tex/optex/base/others.opm
+++ b/Master/texmf-dist/tex/optex/base/others.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \uv {Miscenaleous <2024-06-27>} % preloaded in format
+\_codedecl \uv {Miscenaleous <2024-11-21>} % preloaded in format
\_doc ----------------------------
\`\useOpTeX` and \`\useoptex` are declared as `\relax`.
@@ -110,12 +110,13 @@
\_def\_lipsumA #1.#2]#3{\_ifx^#2^\_lipsumB #1\_empty-\_empty\_fin \_else \_lipsumdot[#1].\_fi}
\_def\_lipsumB #1-#2\_empty#3\_fin{%
\_fornum #1..\_ifx^#2^#1\_else#2\_fi \_do {\_lipsumtext[##1]\_par}}
+\_def\_lipsumfile{lipsum.ltd.tex}
\_def\_lipsumload{\_beglocalcontrol
{\_setbox\_nonebox=\_vpack{\_tmpnum=0 % vertical mode during \input lipsum.ltd.tex
\_def\ProvidesFile##1[##2]{}%
\_def\SetLipsumLanguage##1{}%
\_def\NewLipsumPar{\_incr\_tmpnum \_sxdef{_lip:\_the\_tmpnum}}%
- \_opinput {lipsum.ltd.tex}%
+ \_opinput\_lipsumfile
\_glet\_lipsumload=\_empty
}}%
\_endlocalcontrol}
@@ -141,7 +142,7 @@
in user name space.\nl
You can load a code chunk by \^`\loadtrick` `<cs-name>`. This
command doesn't run the `<cs-name>`, only loads the appropriate code. It
- should be usable if you want to load the code before the fisrt usage of
+ should be usable if you want to load the code before the first usage of
the `<cs-name>`.
\_cod -----------------------------
@@ -152,7 +153,8 @@
\_savecatcodetable\_tmpcatcodes \_catcodetable\_tmpcatcodes
\_long\_def\_loadtrickA ##1\_trick##2#1##3;{##1}%
\_wlog{Loading trick macros for \_string#1}%
- \_setbox\_nonebox=\_vpack{\_globaldefs=1 \_ea\_loadtrickA \_input {optex-tricks.opm}}%
+ \_setbox\_nonebox=\_vpack{\_let\:=\_trickprefix \_def\_trickseq{#1}%
+ \_globaldefs=1 \_ea\_loadtrickA \_input {optex-tricks.opm}}%
\_restorectable \_endnamespace
\_endlocalcontrol
}
@@ -161,19 +163,33 @@
\_xargs \_regtrick \begfile \createfile \beglua \begLUA \logginglua
\sethours \setminutes \setseconds \setweekday \showpglists \shownodes \runsystem
- \directoutput \algol \scaleto \scaletof \ttlineref \easylist \keepstyle \fcread
- \shadedframe \roundframe \cancel \ignoreinspic \keystroke
+ \directoutput \algol \algolkw \algolcap \algolnum \makeLOA \scaleto \scaletof \ttlineref \lref
+ \easylist \keepstyle \fcread \shadedframe \roundframe \cancel \ignoreinspic \keystroke
\colortab \crx \crtop \crbot \crmid \longtable \vcent \vbot \tnote \tabnodes \tablebefore
\framedblocks \twoblocks \pstart \settabs \import \incrpp \ispageodd
\iniseccc \seccc \makeLOF \makeLOT \captionF \captionT \correctvsize \pgforeground
\onlyifnew \thedimen \rebox \leftfill \rightfill \lrfill \directchar
- \xreplstring \replmacro \tdnum ;
+ \xreplstring \replmacro \tdnum \clipbox \ismatch \isinmacro \mathinexpr \xparshape
+ \csvread \csvdecl \dbcreate \exectree \showtree \jsonread \jsoncnv ;
\_sdef{_item:m}{\_loadtrick{\style m}\_cs{_item:m}}
+ \_doc
+ The `\:` is used as a prefix before `\def` etc. in the file `optex-tricks.opm`
+ if the declared control sequence is from user namespace. It checks if a user
+ have defined it before the trick is loaded and prints warning in this case.
+ The `\:` is set to \`\_trickprefix` in the group before trick loading.
+ If a trick includes only one autoloaded control sequence then it
+ needs not to be prefixed by `\:` because if a user redefines it then
+ the usage of it doesn't run autoloading.
+ \_cod
+
+\_def\_trickprefix #1#2{\_ifx#2\_undefined \_else \_def\_tmp{\_loadtrickD#2}\_ifx\_tmp#2\_else
+ \_opwarning{trick by \_ea\_string\_trickseq\_space loaded: \_string#2 redefined}\_fi\_fi #1#2}
+
\_doc -----------------------------
Lua\TeX/ version 1.14 and newer provides `\partokenname` which allows to
specify something different than `\par` at empty lines. We set `\_par`
- (see bellow) in \OpTeX/ version 1.04+ and newer. Some macros were rewritten
+ (see below) in \OpTeX/ version 1.04+ and newer. Some macros were rewritten
due to this change. And we copy old versions of these changed macros here
in order to allow to use older Lua\TeX/ versions where `\partokenname` is
not provided.\nl
@@ -184,13 +200,6 @@
\_ifx\_partokenname\_undefined % LuaTeX 1.13 or older:
- \_def\_begmulti #1 {\_par\_bgroup\_wipeepar\_multiskip\_penalty0 \_def\_Ncols{#1}
- \_setbox6=\_vbox\_bgroup\_bgroup \_let\_setxhsize=\_relax \_penalty-99
- \_advance\_hsize by\_colsep
- \_divide\_hsize by\_Ncols \_advance\_hsize by-\_colsep
- \_mullines=0
- \_def\par{\_ifhmode\_endgraf\_global\_advance\_mullines by\_prevgraf\_fi}%
- }
\_def\_incaption {\_bgroup
\_ifcsname _\_tmpa num\_endcsname \_ea\_incr \_csname _\_tmpa num\_endcsname
\_else \_opwarning{Unknown caption /\_tmpa}\_fi
@@ -218,7 +227,7 @@
\_nopagenumbers
}
\_def\_printverbline#1{\_putttpenalty \_indent \_printverblinenum \_kern\_ttshift #1\par}
- \_public \begmulti \boxlines \letter ;
+ \_public \boxlines \letter ;
\_else % LuaTeX 1.14 or newer:
@@ -244,6 +253,8 @@
\_endcode
+2024-11-21 \_trickprefix introduced
+2024-09-09 for old LuaTeX 1.13: \_def\_bemulti removed
2024-06-27 \_loadtrickD introduced in order to save format size.
2024-03-11 \_lipsumload+\_loadtrick: \vpack used instead \vbox.
2024-03-04 \_beglocalcontrol used in \_lipsumload.
diff --git a/Master/texmf-dist/tex/optex/base/output.opm b/Master/texmf-dist/tex/optex/base/output.opm
index e5bca3157e2..bd7e52543a8 100644
--- a/Master/texmf-dist/tex/optex/base/output.opm
+++ b/Master/texmf-dist/tex/optex/base/output.opm
@@ -50,7 +50,7 @@
This macro destroys itself, so the value is set only once. Typically it is
done in \^`\margins` macro or
when first \^`\_optexoutput` routine is called (see \^`\_begoutput`).
- Or it is called at the begining of the \^`\begtt`...`\endtt` environment before
+ Or it is called at the beginning of the \^`\begtt`...`\endtt` environment before
`\hsize` value is eventually changed by the user in this environment.
\_cod -----------------------------
@@ -107,7 +107,7 @@
}
\_doc -----------------------------
- The \`\_pagecontents` is similar as in plain \TeX/. The only differnece is
+ The \`\_pagecontents` is similar as in plain \TeX/. The only difference is
that the \`\_pagedest` is inserted at the top of `\_pagecontents`.\nl
The \`\_footnoterule` is defined here.
\_cod -----------------------------
diff --git a/Master/texmf-dist/tex/optex/base/parameters.opm b/Master/texmf-dist/tex/optex/base/parameters.opm
index c53508d3c1c..a61f4a0006c 100644
--- a/Master/texmf-dist/tex/optex/base/parameters.opm
+++ b/Master/texmf-dist/tex/optex/base/parameters.opm
@@ -331,7 +331,7 @@
if `\ilevel=1`.\nl
The \`\ilistskipamount` is vertical skip above and below the items list
if `\ilevel>1`.\nl
- The \`\itemskipamount` is vertical skip between list items, but not above the firts
+ The \`\itemskipamount` is vertical skip between list items, but not above the first
and below the last.
\_cod -----------------------------
@@ -604,7 +604,7 @@
The behavior of document processing by \OpTeX/ is
controlled by {\em parameters}. The parameters are
\begitems
-* primitive registers used in build-in algorithms of \TeX/,
+* primitive registers used in built-in algorithms of \TeX/,
* registers declared and used by \OpTeX/ macros.
\enditems
Both groups of registers have their type: number, dimension, skip, token
@@ -612,7 +612,7 @@ list.
The registers are represented by their names (control sequences). If the user
re-defines this control sequence then the appropriate register exists
-steadily and build-in algorithms are using it without change. But user
+steadily and built-in algorithms are using it without change. But user
cannot access its value in this case. \OpTeX/ declares two control sequences
for each register: prefixed (private) and unprefixed (public). \OpTeX/ macros use only
prefixed variants of control sequences. The user should use the unprefixed variant
diff --git a/Master/texmf-dist/tex/optex/base/pdfuni-string.opm b/Master/texmf-dist/tex/optex/base/pdfuni-string.opm
index 4e5a29e9db4..8a4eb7b4353 100644
--- a/Master/texmf-dist/tex/optex/base/pdfuni-string.opm
+++ b/Master/texmf-dist/tex/optex/base/pdfuni-string.opm
@@ -27,7 +27,7 @@
Big Endian UTF-16 and enclosed to \code{<>}. Example of usage:
`\pdfunidef\infoauthor{Petr Olšák} \pdfinfo{/Author \infoauthor}`.\nl
\^`\pdfunidef` does more things than only converting to hexadecimal PDF string.
- The <text> can be scanned in verbatim mode (it is true becuase \^`\_Xtoc`
+ The <text> can be scanned in verbatim mode (it is true because \^`\_Xtoc`
reads the <text> in verbatim mode). First `\edef` do
`\_scantextokens\unexpanded` and second `\edef` expands the parameter
according to current values on selected macros from `\_regoul`. Then
@@ -118,7 +118,7 @@ This encoding is \TeX/-discomfortable because it looks like
This example shows a hexadecimal PDF string (enclosed in \code{<>} as opposed
to the literal PDF string enclosed in `()`). In these strings each byte is
represented by two hexadecimal characters (`0-9`, `A-F`). You can tell the
-encoding is UTF-16BE, becuase it starts with \"Byte order mark" `FEFF`. Each
+encoding is UTF-16BE, because it starts with \"Byte order mark" `FEFF`. Each
unicode character is then encoded in one or two byte pairs. The example string
corresponds to the text \"Cvičení je zátěž a ${\rm x} ∈ 𝕄$". Notice the 4 bytes
for the last character, $𝕄$. (Even the whitespace would be OK in a PDF file,
diff --git a/Master/texmf-dist/tex/optex/base/prefixed.opm b/Master/texmf-dist/tex/optex/base/prefixed.opm
index 89aa0b4966a..9aca2367e42 100644
--- a/Master/texmf-dist/tex/optex/base/prefixed.opm
+++ b/Master/texmf-dist/tex/optex/base/prefixed.opm
@@ -39,7 +39,7 @@
does `<what><sequence>` for each sequences.
\_cod -----------------
-\_let\_ea =\_expandafter % usefull shortcut
+\_let\_ea =\_expandafter % useful shortcut
\_long\_def \_xargs #1#2{\_ifx #2;\_else \_ea#1\_ea#2\_ea\_xargs \_ea #1\_fi}
diff --git a/Master/texmf-dist/tex/optex/base/ref-file.opm b/Master/texmf-dist/tex/optex/base/ref-file.opm
index 922150f9f5d..2e475f0c500 100644
--- a/Master/texmf-dist/tex/optex/base/ref-file.opm
+++ b/Master/texmf-dist/tex/optex/base/ref-file.opm
@@ -103,7 +103,7 @@
We must read `<definitions of your ref macros>` while `#` has the catcode 12,
because we don't want to duplicate each `#` in the `.ref` file.\nl
`\refdecl` appends its data to the \`\_refdecldata` macro. It is
- pushed to the `.ref` file immediatelly only if the file is opened
+ pushed to the `.ref` file immediately only if the file is opened
already. Otherwise we are waiting to `\openref` because we don't want
to open the `.ref` file if it is unnecessary.
\_cod \_fin -----------------
diff --git a/Master/texmf-dist/tex/optex/base/sections.opm b/Master/texmf-dist/tex/optex/base/sections.opm
index de647475efd..01a0d4bd30a 100644
--- a/Master/texmf-dist/tex/optex/base/sections.opm
+++ b/Master/texmf-dist/tex/optex/base/sections.opm
@@ -179,7 +179,7 @@
\_optdef\_secc[]{\_trylabel \_scantoeol\_insecc}
\_def\_trylabel{\_istoksempty\_opt\_iffalse \_label[\_the\_opt]\_fi}
-\_sdef{_eol:chap}{\_inchap} % enebles \bracedparam\chap{title}
+\_sdef{_eol:chap}{\_inchap} % enables \bracedparam\chap{title}
\_sdef{_eol:sec}{\_insec} % enables \bracedparam\sec{title}
\_sdef{_eol:secc}{\_insecc} % enables \bracedparam\secc{title}
@@ -292,7 +292,7 @@
The \`\_insertmark``{<title text>}` saves `\mark` in the format
`{<title-num>} {<title-text>}`, so it can be printed \"as is" in
- `\headline` (see the space between them), or you can define a formating
+ `\headline` (see the space between them), or you can define a formatting
macro with two parameters for processing these data, if you need it.
\_cod -----------------------------
@@ -378,12 +378,12 @@
* \^`\_thecapnum` ... expands to `\the<letter>num` (caption number).
\enditems
The macro \^`\_printcaptiont` (or `f`) is processed inside group and the
- `\_par` can be run after this group. If you want to re-define formating
+ `\_par` can be run after this group. If you want to re-define formatting
parameters for `\_par`, do this in the macro \^`\_captionformat`.
The \`\_captionsep` inserts a separator between auto-generated
caption number and the following caption text. Default separator
is `\_enspace` but if the caption text starts with dot or colon, then
- the space is not inserted. A user can wite `\caption/t: My table`
+ the space is not inserted. A user can write `\caption/t: My table`
and \"{\bf Table 1.1:} My table" is printed. You can re-define
the \^`\_captionsep` macro if you want to use another separator.
\_cod -----------------------------
@@ -479,7 +479,7 @@
\_endcode % -------------------------------------
-2024-01-19 \bracedparam\secl enalbed
+2024-01-19 \bracedparam\secl enabled
2024-01-18 \tit, \chap, \sec, \secc: added cooperation with new \bracedparam
2023-05-02 \_numprint used
2022-10-19 More robust \caption (two opened groups, \_printcaption introduced)
@@ -489,7 +489,7 @@
2021-02-09 \thisoutline implemented
2021-01-26 \_nl: \unskip added
2021-01-11 \secl introduced
-2021-01-05 \_thednum printed in text mode in its both occurences.
+2021-01-05 \_thednum printed in text mode in its both occurrences.
2020-04-28 \_secfonts etc: \_boldify is last.
2020-04-22 \_chapx, \_secx, \_seccx rewritten
2020-03-14 introduced
diff --git a/Master/texmf-dist/tex/optex/base/slides.opm b/Master/texmf-dist/tex/optex/base/slides.opm
index 84cf6f5db30..857d9283629 100644
--- a/Master/texmf-dist/tex/optex/base/slides.opm
+++ b/Master/texmf-dist/tex/optex/base/slides.opm
@@ -85,7 +85,7 @@
\_doc -----------------------------
The default values of \`\pg`, i.\,e.\ `\pg;`, `\pg+` and `\pg.` are very simple.
- They are used when `\showslides` is not specified.
+ They are used when `\slideshow` is not specified.
\_cod -----------------------------
\_def\_pg#1{\_cs{_spg:#1}}
@@ -94,7 +94,7 @@
\_sdef{_spg:+}{\_par}
\_doc -----------------------------
- The \`\_endslides` is defined as `\_end` primitive (preceeded by `\_byehook`), but
+ The \`\_endslides` is defined as `\_end` primitive (preceded by `\_byehook`), but
slide-designer can redefine it. For example,
\ulink[http://petr.olsak.net/optex/optex-tricks.html\#slider]{OpTeX trick 0029}
shows how to define clickable navigation to the pages and how to check
diff --git a/Master/texmf-dist/tex/optex/base/styles.opm b/Master/texmf-dist/tex/optex/base/styles.opm
index 1c37339d029..d04e248e79b 100644
--- a/Master/texmf-dist/tex/optex/base/styles.opm
+++ b/Master/texmf-dist/tex/optex/base/styles.opm
@@ -9,7 +9,7 @@
returns to the outer vertical mode a box with `<line-1>`, next box with
`<line-2>` etc. Each box has its natural width. This is reason why we cannot
use paragraph mode where each resulting box has the width `\hsize`.
- The `<eol>` is set active and `\everypar` starts `\hbox{` and acive <eol>
+ The `<eol>` is set active and `\everypar` starts `\hbox{` and active <eol>
closes this `\hbox` by `}`.
\_cod -----------------------------
diff --git a/Master/texmf-dist/tex/optex/base/table.opm b/Master/texmf-dist/tex/optex/base/table.opm
index 8da087386ab..3108434d66f 100644
--- a/Master/texmf-dist/tex/optex/base/table.opm
+++ b/Master/texmf-dist/tex/optex/base/table.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \table {Basic macros for OpTeX <2023-06-27>} % preloaded in format
+\_codedecl \table {Macros for tables <2024-11-21>} % preloaded in format
\_doc -----------------------------
The result of the \`\table``{<declaration>}{<data>}` macro is inserted into
@@ -37,8 +37,6 @@
between them) have normal baseline distance.\nl
The \`\_tableA``{<declaration>}` macro scans the `<declaration>` by
`\_scantabdata#1\_relax` and continues by processing `{<data>}` by \^`\_tableB`.
- The trick `\_tmptoks={<data>}\_edef\_tmpb{\_the\_tmptoks}`
- is used here in order to keep the hash marks in the <data> unchanged.
\_cod -----------------------------
\_def\_tableA#1{\_egroup
@@ -53,13 +51,14 @@
\_fi
\_colnum=0 \_let\_addtabitem=\_addtabitemx
\_def\_tmpa{}\_tabdata={\_colnum1\_relax}\_scantabdata#1\_relax
- \_the\_everytable \_bgroup \_catcode`\#=12 \_tableB
+ \_the\_everytable \_tableB
}
\_doc -----------------------------
- The \`\_tableB` saves `<data>` to `\_tmpb`
- and does \^`\replstring`s to prefix each macro \^`\crl` (etc.)
- by `\_crcr`. See \^`\_tabreplstrings`.
+ The \`\_tableB` saves `<data>` to `\_tmpb`. The `#1` parameter is
+ re-scanned in order to set potential `#` characters inside it as others.
+ This is needed because of `\gdef\_tmpb` and next \^`\replstring`s.
+ They prefix each macro \^`\crl` (etc.) by `\_crcr`. See \^`\_tabreplstrings`.
The whole `\_tableB` macro is hidden in `{...}` in order to
there may be `\table` in `\table` and we want to manipulate with
`&` and `\cr` as with normal tokens in the `\_tabreplstrings`, not as
@@ -76,10 +75,10 @@
If `pxto` keyword was used, then we set the virtual unit \^`\tsize` to
`-\hsize` first. Then the first attempt of the table is created in box 0.
- All collums where `p{..\tsize}` is used, are created as empty in this first
+ All columns where `p{..\tsize}` is used, are created as empty in this first
pass. So, the `\wd0` is the width of all other columns.
The \^`\_tsizesum` includes the sum of \^`\tsize`'s in `\hsize` units
- after firts pass. The desired table width is stored in the `\_tmpdim`, so
+ after first pass. The desired table width is stored in the `\_tmpdim`, so
`\_tmpdim-\_wd0` is the rest which have to be filled by \^`\tsize`s.
Then the \^`\tsize` is re-calculated and the real table is
printed by `\halign` in the second pass.
@@ -92,9 +91,10 @@
work in special cases here like \code{`\{`} for example.
\_cod -----------------------------
-\_long\_def\_tableB #1{\_egroup
- {\_def\_tmpb{#1}\_tablereplstrings
- \_edef\_tabskipmid{\_the\_tabskip}\_tabskip=\_tabskipl
+\_long\_def\_tableB #1{%
+ {{\_catcode`\#=12 % see OpTeX trick 0117:
+ \_directlua{tex.sprint(-1,"\_luaescapestring{\_unexpanded{\_gdef\_tmpb{#1}}}")}}%
+ \_tablereplstrings \_edef\_tabskipmid{\_the\_tabskip}\_tabskip=\_tabskipl
\_ifpxto
\_edef\_tsizes{\_global\_tsizesum=\_the\_tsizesum \_gdef\_noexpand\_tsizelast{\_tsizelast}}%
\_tsizesum=\_zo \_def\_tsizelast{0}%
@@ -103,11 +103,12 @@
\_ifdim \_tmpdim >\_zo \_else \_tsizesum=\_zo \_fi
\_ifdim \_tsizesum >\_zo \_tsize =\_expr{\_number\_hsize/\_number\_tsizesum}\_tmpdim
\_else \_tsize=\_zo \_fi
- \_tsizes % retoring values if there is a \table pxto inside a \table pxto.
+ \_tsizes % restoring values if there is a \table pxto inside a \table pxto.
\_setbox0=\_null \_halign \_tableC
\_else
\_halign\_tablew \_tableC
\_fi
+ \_glet\_tmpb\_undefined
}\_egroup % \_tablebox\_bgroup is in the \_table macro
}
\_def\_tableC{\_ea{\_the\_tabdata\_tabskip=\_tabskipr\_cr \_scantextokens\_ea{\_tmpb\_crcr}}}
@@ -305,7 +306,7 @@
\_doc -----------------------------
The \`\fS` macro is more tricky. The \^`\_tableparbox` isn't printed
- immediatelly, but `\setbox2=` is prefixed by the macro \`\_tableparA`,
+ immediately, but `\setbox2=` is prefixed by the macro \`\_tableparA`,
which is empty by default (used in \^`\_tablepar`). The \`\_tableparD`
is processed after the box is set: it checks if there is only one line
and prints `\hbox to\hsize{\hfil<this line>\hfil}` in this case. In other
@@ -591,6 +592,7 @@ after the second one.
\_endinput
+2024-11-21 \_tableB improved (rescan its parameter by \directlua)
2023-06-27 \frame: argument in group
2023-05-19 \_tableparB,C: no strut when \tskip is processed (bug fixed).
2022-12-26 \tabdeclare: use {##} in order to allow a\over b in table items
diff --git a/Master/texmf-dist/tex/optex/base/uni-lcuc.opm b/Master/texmf-dist/tex/optex/base/uni-lcuc.opm
index 0cd8bfe6e50..317cec43741 100644
--- a/Master/texmf-dist/tex/optex/base/uni-lcuc.opm
+++ b/Master/texmf-dist/tex/optex/base/uni-lcuc.opm
@@ -15945,11 +15945,11 @@ The file `UnicodeData.txt` is read if this file exists in your \TeX/
distribution. The format is specified
at \url{http://www.unicode.org/L2/L1999/UnicodeData.html}. We read only `Ll`
(lowercase letters), `Lu` (upperase letters) and `Lo` (other letters) and
-set appopriate codes. The scanner of `UnicodeData.txt` is implemented here
+set appropriate codes. The scanner of `UnicodeData.txt` is implemented here
in the group (lines 6 to 15). After the group is closed then
the file `uni-lcuc.opm` is leaved by `\endinput`.
-If the file `UnicodeData.txt` does not exsists then internal data are used.
+If the file `UnicodeData.txt` does not exist then internal data are used.
They follow to the end of the file `uni-lcuc.opm`.
{\everytt={\typosize[8/10]\_let\_printverbline=\_printcodeline \medskip}\ttline=-1
diff --git a/Master/texmf-dist/tex/optex/base/unimath-codes.opm b/Master/texmf-dist/tex/optex/base/unimath-codes.opm
index d2b7e0e1e31..e2436d277f7 100644
--- a/Master/texmf-dist/tex/optex/base/unimath-codes.opm
+++ b/Master/texmf-dist/tex/optex/base/unimath-codes.opm
@@ -301,7 +301,7 @@
of the <int-character> to `\_int:<int-character>` using `\Umathchardef` and
declare <int-character> as math-active and define it
as `\_int:<int-character> \_nolimits`. Moreover, we define `\intop` as
- `\_int:<int-character>` (it is the itegral with limits like in plain \TeX).
+ `\_int:<int-character>` (it is the integral with limits like in plain \TeX).
We do this with other int-like operators listed below too.
\_cod -----------------------------
@@ -321,7 +321,7 @@
\_cod -----------------------------
\_global\_Udelcode`<=1 "027E8 % these characters have different meaning
-\_global\_Udelcode`>=1 "027E9 % as normal and as delimeter
+\_global\_Udelcode`>=1 "027E9 % as normal and as delimiter
\_mit % default math alphabets setting
@@ -501,7 +501,7 @@
\_negationof \Rightarrow \nRightarrow
\_negationof \exists \nexists
\_negationof \ni \nni
-\_negationof \paralel \nparalel
+\_negationof \parallel \nparallel
\_negationof \sim \nsim
\_negationof \approx \napprox
\_negationof \equiv \nequiv
diff --git a/Master/texmf-dist/tex/optex/base/unimath-macros.opm b/Master/texmf-dist/tex/optex/base/unimath-macros.opm
index ac926b5e89e..b5774aac5e9 100644
--- a/Master/texmf-dist/tex/optex/base/unimath-macros.opm
+++ b/Master/texmf-dist/tex/optex/base/unimath-macros.opm
@@ -122,7 +122,7 @@
\`\_mfontfeatures` and to the size-dependent features `ssty=1`
if script size is asked or `ssty=2` if scriptscriptsize is asked.\nl
\`\_mparams` can insert additional font features
- dependig on the current `\_mfam`.\nl
+ depending on the current `\_mfam`.\nl
The \^`\_mfactor` `<family><space>` sets scaling factor,
see section~\ref[math-preload] for more information.\nl
The \`\_textmff`, \`\_scriptmff` and \`\_sscriptmff` are font
@@ -251,7 +251,7 @@ size of the text font. It can be used if the used text font and loaded math font
incompatible ex height. If missing then the scaling factor is 1.
\^`\loadboldmath` `{<bold-font>} \to {<normal-font>}` loads bold variant only
-if `<normal-font>` was sucessully loaded by the previous `\loadmath`. For example:
+if `<normal-font>` was sucessfully loaded by the previous `\loadmath`. For example:
\begtt
\loadmath {[xitsmath-regular]}
@@ -293,7 +293,7 @@ example:
sets the characters `\stareq`, `\triangleq`, `\veeeq`, `\wedgeq` from
the `\xits` additional font. The <list of sequences> can include
control sequences from the `unicode-table.tex`, but no math
-accents. These contol sequences can be printed by `\input print-unimath.opm`.
+accents. These control sequences can be printed by `\input print-unimath.opm`.
The \^`\mathchars` macro keeps the class and slot of declared math objects
and re-declares only family of them. It is applied to all control
diff --git a/Master/texmf-dist/tex/optex/base/usebib.opm b/Master/texmf-dist/tex/optex/base/usebib.opm
index dcacbb0ebcd..0b4d7bd270c 100644
--- a/Master/texmf-dist/tex/optex/base/usebib.opm
+++ b/Master/texmf-dist/tex/optex/base/usebib.opm
@@ -27,7 +27,7 @@
\_doc -----------------------------
The \`\_nextat` macro skips the text in the `.bib` file to the next `@`, and starts
the \`\_bibentry` macro which reads `@<entry type>{<data>}` from the `.bib` file.
- Each reference entry is conveted to the \`\_entrydata`
+ Each reference entry is converted to the \`\_entrydata`
macro and then `\_glet \_be:<bib-part>/<label> = \_entrydata` is done.
The \^`\_entrydata` includes key-value pairs, as described in the
section~\ref[readbibs].
@@ -299,7 +299,7 @@
\_getfield[#3]\_bibfield
\_getfield[#3num]\_namecount % total persons in the author/editor fields
\_ifx\_bibfield\_empty\_else
- \_def\_bibfield{\_loopauthors{#3}}% read author/edior field in a loop
+ \_def\_bibfield{\_loopauthors{#3}}% read author/editor field in a loop
\_fi
\_else
\_getfield[#2#3]\_bibfield
@@ -331,7 +331,7 @@
\_doc -----------------------------
\`\_loopauthors``{<field-name>}` does a loop over all authors/editors in
the `author` or `editor` field. The \`\_namecount`
- (total nuber of authors/editors) was defined in
+ (total number of authors/editors) was defined in
\^`\_bprintb`. Then for each author/edtor it do:
\begitems
* Set \`\_NameCount` to the position number of the currently processed author/editor.
@@ -361,7 +361,7 @@
\_doc -----------------------------
\`\_AbbreviateFirstname`, \`\_RetrieveFieldIn`, \`\_RetrieveField` are here only for
- backward comaptibility with previous macros based on the librarian package.
+ backward compatibility with previous macros based on the librarian package.
The \`\_CreateField`, \`\_SortingOrder`, and \`\_SpecialSort` are dummy
macros because the sorting is implemented by a slightly different way
than in librarian package.
@@ -551,7 +551,7 @@ Such \"bibmark" is saved to the `.ref` file and used in next \TeX/ run as
Moreover, the bib-style writer must declare the format of
special fields `author` and `editor`. These fields include a
-list of names, each name is precessed individually in a loop. The
+list of names, each name is processed individually in a loop. The
\^`\_authorname` or \^`\_editorname` is called for each name on the list.
The bib-style writer must define
the \`\_authorname` and \`\_editorname` commands
@@ -626,7 +626,7 @@ If you do `\slet{tmp}{_be:/tbn}` then you can print the data (for example) by:
\ea\foreach \tmp \do [#1]#2{\wterm{field-name: "#1", data: "#2"}}
\endtt
or you can do `\ea\foreach \tmp \do [#1]#2{\sdef{bib-field:#1}{#2}}` to enable
-direct acces to the scanned data.
+direct access to the scanned data.
Note that entry type and field names are converted lower-case by the `\readbibs` macro.
diff --git a/Master/texmf-dist/tex/optex/base/verbatim.opm b/Master/texmf-dist/tex/optex/base/verbatim.opm
index 3f486f83339..3fd1434e2f8 100644
--- a/Master/texmf-dist/tex/optex/base/verbatim.opm
+++ b/Master/texmf-dist/tex/optex/base/verbatim.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \begtt {Verbatim <2022-04-23>} % preloaded in format
+\_codedecl \begtt {Verbatim <2024-11-05>} % preloaded in format
\_doc ----------------------------
The internal parameters
@@ -94,6 +94,11 @@
same line where `\begtt` is. This `#1` parameter is used after \^`\everytt`
parameters settings, so users can change them locally.
+ A user can write `\begtt \ttline=0` and we want to interpret this setting
+ locally too. This is the reason of creating the \`\_restorettline` macro
+ before the argument `#1` of `\_begtti` is processed and using the trick
+ `\ifnum\ttline=\maxdimen` after this processing. See the code below.
+
The \^`\_begtti` macro does \^`\_setverb` and another preprocessing, sets
`\endlinechar` to `^^J` and reads the following text in verbatim mode
until \`\endtt` occurs. This scanning is done by \`\_startverb` macro which is
@@ -127,13 +132,15 @@
\_eoldef \_begtti#1{\_wipeepar \_setxhsize
\_vskip\_parskip \_ttskip
\_setverb
- \_ifnum\_ttline<0 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi
\_adef{ }{\_dsp}\_adef\^^I{\t}\_parindent=\_ttindent \_parskip=0pt
\_def\t{\_hskip \_dimexpr\_tabspaces em/2\_relax}%
\_protrudechars=0 % disable protrusion
- \_the\_everytt \_relax #1\_relax \_ttfont
+ \_xdef\_restorettline{\_global\_ttline=\_the\_ttline\_relax}\_ttline=\_maxdimen
+ \_the\_everytt \_relax #1\_relax
+ \_ifnum\_ttline=\_maxdimen \_restorettline \_else \_aftergroup\_restorettline \_fi
+ \_ifnum\_ttline<0 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi
\_def\_testcommentchars##1\_iftrue{\_iffalse}\_let\_hicomments=\_relax
- \_savemathsb \_endlinechar=`^^J
+ \_ttfont \_savemathsb \_endlinechar=`^^J
\_startverb
}
\_ea\_def\_ea\_startverb \_ea#\_ea1\_csstring\\endtt#2^^J{%
@@ -176,7 +183,7 @@
\_else
\_ifx\_vcomments\_empty\_else \_printcomments \_def\_vcomments{}\_fi
\_ifx\_fin#2%
- \_bgroup \_adef{ }{}\_def\t{}% if the last line is emtpy, we don't print it
+ \_bgroup \_adef{ }{}\_def\t{}% if the last line is empty, we don't print it
\_ifcat&#1&\_egroup \_ifx\_printverblinenum\_relax \_else \_decr\_ttline \_fi
\_else\_egroup \_printverbline{#1}\_fi
\_else
@@ -253,12 +260,14 @@
\_fi
\_vskip\_parskip \_ttskip \_wipeepar \_setxhsize
\_begingroup
- \_ifnum\_ttline<-1 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi
\_setverb \_adef{ }{\_dsp}\_adef\^^I{\t}\_parindent=\_ttindent \_parskip=0pt
\_def\t{\_hskip \_dimexpr\_tabspaces em/2\_relax}%
\_protrudechars=0 % disable protrusion
- \_the\_everytt\_relax \_tmpb\_relax \_ttfont
- \_savemathsb \_endlinechar=`^^J \_tmpnum=0
+ \_xdef\_restorettline{\_global\_ttline=\_the\_ttline\_relax}\_ttline=\_maxdimen
+ \_the\_everytt\_relax \_tmpb\_relax
+ \_ifnum\_ttline=\_maxdimen \_restorettline \_else \_aftergroup\_restorettline \_fi
+ \_ifnum\_ttline<-1 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi
+ \_ttfont \_savemathsb \_endlinechar=`^^J \_tmpnum=0
\_loop \_ifeof\_vifile \_tmpnum=\_vinolines\_space \_fi
\_ifnum\_tmpnum<\_vinolines\_space
\_vireadline \_advance\_tmpnum by1 \_repeat %% skip lines
@@ -385,6 +394,7 @@
\_endinput
History:
+2024-11-05 ... \ttline=0 is local in \begtt, \verbinput, \everytt parameters
2022-04-23 ... \_ttline counting: bug fixed
2022-02-22 ... \_reloading removed due to changes in font-select
2021-04-18 ... \_protrudechars=0 added