summaryrefslogtreecommitdiff
path: root/macros/optex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-08-05 03:01:02 +0000
committerNorbert Preining <norbert@preining.info>2022-08-05 03:01:02 +0000
commit572dc806dd00d29ab418ec6deaa36762d1d59ae6 (patch)
tree0e2e600cc1d97a77661ee9976baa119ea8206854 /macros/optex
parent6cb109095c2e8fd355cda8b1996dee2f9e12d8a0 (diff)
CTAN sync 202208050301
Diffstat (limited to 'macros/optex')
-rw-r--r--macros/optex/README4
-rw-r--r--macros/optex/base/alloc.opm5
-rw-r--r--macros/optex/base/doc.opm48
-rw-r--r--macros/optex/base/f-montserrat.opm34
-rw-r--r--macros/optex/base/f-overlock.opm27
-rw-r--r--macros/optex/base/f-stix.opm24
-rw-r--r--macros/optex/base/f-stixtwo.opm28
-rw-r--r--macros/optex/base/f-xits.opm25
-rw-r--r--macros/optex/base/fams-ini.opm22
-rw-r--r--macros/optex/base/fonts-catalog.opm4
-rw-r--r--macros/optex/base/if-macros.opm5
-rw-r--r--macros/optex/base/lang-data.opm78
-rw-r--r--macros/optex/base/lang-decl.opm2
-rw-r--r--macros/optex/base/makeindex.opm214
-rw-r--r--macros/optex/base/math-preload.opm30
-rw-r--r--macros/optex/base/math-unicode.opm106
-rw-r--r--macros/optex/base/more-macros.opm13
-rw-r--r--macros/optex/base/optex.ini2
-rw-r--r--macros/optex/base/parameters.opm4
-rw-r--r--macros/optex/base/pdfuni-string.opm7
-rw-r--r--macros/optex/base/print-unimath.opm3
-rw-r--r--macros/optex/base/sections.opm18
-rw-r--r--macros/optex/base/unimath-codes.opm5
-rw-r--r--macros/optex/doc/optex-doc.pdfbin1415023 -> 1437685 bytes
-rw-r--r--macros/optex/doc/optex-doc.tex2
-rw-r--r--macros/optex/doc/optex-math.tex46
-rw-r--r--macros/optex/doc/optex-userdoc.tex21
27 files changed, 624 insertions, 153 deletions
diff --git a/macros/optex/README b/macros/optex/README
index 866708c535..0cd39b8770 100644
--- a/macros/optex/README
+++ b/macros/optex/README
@@ -22,6 +22,10 @@ doc/ ... PDF version of the OpTeX documentation and sources.
History:
+<1.08> Aug 2022:
+ Sorting rules for German, French, Polish, Hungarian, ... added.
+ Font files for Montserrat, STIX, XITS, STIXtwo, Overlock added.
+ Minor improvements and bug fixing.
<1.07> May 2022:
Tikz's \foreach works only in its environment.
\lipsum syntax enlarged by dot after paragraph num, example: \lipusm[3.].
diff --git a/macros/optex/base/alloc.opm b/macros/optex/base/alloc.opm
index 51bd257962..ae77d3074e 100644
--- a/macros/optex/base/alloc.opm
+++ b/macros/optex/base/alloc.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \newdimen {Allocators for registers <2022-03-07>} % preloaded in format
+\_codedecl \newdimen {Allocators for registers <2022-06-10>} % preloaded in format
\_doc -----------------------------
The limits are set first.
@@ -29,7 +29,7 @@
\_countdef\_toksalloc=15 \_toksalloc=255
\_countdef\_readalloc=16 \_readalloc=-1
\_countdef\_writealloc=17 \_writealloc=0 % should be -1 but there is bug in new luatex
-\_countdef\_famalloc=18 \_famalloc=3
+\_countdef\_famalloc=18 \_famalloc=42 % \newfam are 43, 44, 45, ...
\_countdef\_languagealloc=19 \_languagealloc=0
\_doc -----------------------------
@@ -178,6 +178,7 @@ the array-like declarator of counters.
\_endinput
+2022-06-10 \_famalloc set to 42 (answer to the biggest fundamental question)
2022-03-07 \_noattr allocated
2022-02-19 \_newlanguage introduced
2021-02-15 \_advance -> \_incr, \_decr
diff --git a/macros/optex/base/doc.opm b/macros/optex/base/doc.opm
index 82c6bde8c6..bde1dcc848 100644
--- a/macros/optex/base/doc.opm
+++ b/macros/optex/base/doc.opm
@@ -1,12 +1,17 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \printdoc {Macros for documentation printing <2021-05-15>} % loaded on demand by \load[doc]
+\_codedecl \printdoc {Macros for documentation printing <2022-07-01>} % loaded on demand by \load[doc]
\_doc -----------------------------
General decalarations.
\_cod -----------------------------
\_fontfam[lmfonts]
+
+\_let \mlinkcolor=\Red % main doc. points
+\_let \ulinkcolor=\Blue % user doc. points
+\_let \fnamecolor=\Brown % file names in listing headers
+\_def \bgverbcolor {\_setcmykcolor{0 0 .3 .03}} % background for listings
\_hyperlinks \Green \Green
\_enlang
\_enquotes
@@ -121,32 +126,30 @@
example at the beginning of this section.
\_cod -----------------------------
-\_def\_intlink{\_link[cs:\_tmpa]{\Blue}{\_csstring\\\_tmpb}}
+\_def\_intlink{\_link[cs:\_tmpa]{\ulinkcolor}{\_csstring\\\_tmpb}}
\_doc -----------------------------
The lines in the listing mode have a yellow background.
\_cod -----------------------------
-\_def\Yellow{\_setcmykcolor{0 0 .3 .03}}
-
\_def\_printcodeline#1{\_advance \_maxlines by-1
\_ifnum \_maxlines<0 \_ea \_endverbprinting \_fi
\_ifx\_printfilename\_relax \_penalty \_ttpenalty \_fi \_vskip-4pt
- \_noindent\_rlap{\Yellow \_vrule height8pt depth5pt width\_hsize}%
+ \_noindent\_rlap{\bgverbcolor \_vrule height8pt depth5pt width\_hsize}%
\_printfilename
\_indent \_printverblinenum #1\_par}
\_def\_printfilename{\_hbox to0pt{%
- \_hskip\_hsize\_vbox to0pt{\_vss\_llap{\Brown\docfile}\_kern7.5pt}\_hss}%
+ \_hskip\_hsize\_vbox to0pt{\_vss\_llap{\fnamecolor\docfile}\_kern7.5pt}\_hss}%
\_let\_printfilename=\_relax
}
\_everytt={\_let\_printverblinenum=\_relax}
\_long\_def\_endverbprinting#1\_end#2\_end{\_fi\_fi \_global\_maxlines=100000
- \_noindent\_typosize[8/]\_dots etc. (see {\_tt\Brown\docfile})}
+ \_noindent\_typosize[8/]\_dots etc. (see {\_tt\fnamecolor\docfile})}
\_doc -----------------------------
- `\docfile` is currently documented file.\nl
+ \`\docfile` is currently documented file.\nl
\`\printdoc` and \`\printdoctail` macros are defined here.
\_cod -----------------------------
@@ -174,15 +177,23 @@
\_public \vitt ;
\_doc -----------------------------
- The Index entries are without the trailing backslash. We must add it
- when printing Index.
+ The Index entries are without the trailing backslash in `.ref` file.
+ 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
+ without backslash.
\_cod -----------------------------
\_addto \_ignoredcharsen {_} % \foo, \_foo is the same in the fist pass of sorting
-\_def\_printii #1#2&{%
- \_ismacro\_lastii{#1}\_iffalse \_newiiletter{#1}{#2}\_def\_lastii{#1}\_fi
- \_gdef\_currii{#1#2}\_the\_everyii\_noindent
- \_hskip-\_iindent \_ignorespaces\_printiiA\bslash#1#2//}
+\_let\_optexprintii=\_printii % original \_printii used for other Index entries
+\_def\_printii #1&{%
+ \_ifcsname cs:#1\_endcsname
+ \_noindent \_hskip-\_iindent {\_tt \_link[cs:#1]\ulinkcolor{\_bslash#1} }\_else
+ \_ifcsname cs:^#1\_endcsname \_noindent \_hskip-\_iindent {\_tt\_bslash#1 }\_else
+ \_afterfi{\_afterfi{\_optexprintii #1&}}\_fi\_fi
+}
+\_def\_pgprintA #1{#1} % no hyperlinks from page numbers
\_def\_printiipages#1&{\_let\_pgtype=\_undefined \_tmpnum=0
{\_rm\_printpages #1,:,\_par}}
@@ -224,18 +235,18 @@
\_ifcsname cs:\_tmp\_endcsname\_else \_dest[cs:\_tmp]\_fi
\_sxdef{cs:\_tmp}{}%
\_hbox{\_ifcsname cs:^\_tmp\_endcsname
- \_link[cs:^\_tmp]{\Red}{\_tt\_csstring\\\_tmp}\_else
- {\_tt\Red\_csstring\\\_tmp}\_fi}%
+ \_link[cs:^\_tmp]{\mlinkcolor}{\_tt\_csstring\\\_tmp}\_else
+ {\_tt\mlinkcolor\_csstring\\\_tmp}\_fi}%
}
\_def\^`#1{\_leavevmode\_edef\_tmp{\_csstring#1}\_iindex{\_tmp}%
\_hbox{\_ifcsname cs:^\_tmp\_endcsname \_else \_dest[cs:^\_tmp]\_sxdef{cs:^\_tmp}{}\_fi
- \_link[cs:\_tmp]{\Blue}{\_tt\_string#1}}%
+ \_link[cs:\_tmp]{\ulinkcolor}{\_tt\_string#1}}%
\_futurelet\_next\_cslinkA
}
\_def\_cslinkA{\_ifx\_next`\_ea\_ignoreit \_else \_ea\_ea\_ea`\_ea\_string\_fi}
\_def\~`#1{\_leavevmode\_edef\_tmp{\_csstring#1}\_iindex{\_tmp}%
- \_hbox{\_link[cs:^\_tmp]{\Blue}{\_tt\_string#1}}%
+ \_hbox{\_link[cs:^\_tmp]{\ulinkcolor}{\_tt\_string#1}}%
\_futurelet\_next\_cslinkA
}
@@ -346,6 +357,7 @@ have the same meaning: `\optexdoclink` in this example. And
\endinput
+2022-07-01 \_printii improved, colors declaration part added.
2021-05-15 \_endinput shifted after \_processinput when \_endcode is scanned.
2021-05-14 \_catcodedot, \_Doctab introduced.
2021-05-13 \def\t added, bug fixed.
diff --git a/macros/optex/base/f-montserrat.opm b/macros/optex/base/f-montserrat.opm
new file mode 100644
index 0000000000..df570ac034
--- /dev/null
+++ b/macros/optex/base/f-montserrat.opm
@@ -0,0 +1,34 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [Montserrat] \Montserrat {Inspired from old posters in Montserat in Buenos Aires}
+ {\caps \alter \light \elight \xlight \medium \semibold} {\rm \bf \it \bi} {}
+ {[Montserrat-Regular]}
+ {\_def\_fontnamegen {[Montserrat\_alterV-\_currV]:\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifiers:^^J
+ \caps ...... caps & small caps^^J
+ \alter ..... alternative characters^^J
+ \medium .... \rm \it Medium, \bf \bi ExtraBold^^J
+ \semibold .. \rm \it SemiBold, \bf \bi Black^^J
+ \light ..... \rm \it Light, \bf \bi SemiBold^^J
+ \elight .... \rm \it ExtraLight, \bf \bi Medium^^J
+ \xlight .... \rm \it Thin, \bf \bi Regular^^J
+}}
+
+\_moddef \resetmod {\_fsetV caps={},alter={} \_fvars Regular Bold Italic BoldItalic }
+\_moddef \alter {\_fsetV alter=Alternates }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
+\_moddef \xlight {\_fvars Thin Regular ThinItalic Italic }
+\_moddef \elight {\_fvars ExtraLight Medium ExtraLightItalic MediumItalic }
+\_moddef \light {\_fvars Light SemiBold LightItalic SemiBoldItalic }
+\_moddef \medium {\_fvars Medium ExtraBold MediumItalic ExtraBoldItalic }
+\_moddef \semibold {\_fvars SemiBold Black SemiboldItalic BlackItalic }
+
+\_initfontfamily % new font family must be initialized
+
+\_endcode
+
+See the file `f-heros.opm` for information about principles of such
+font-macro-files.
+
diff --git a/macros/optex/base/f-overlock.opm b/macros/optex/base/f-overlock.opm
new file mode 100644
index 0000000000..e20a32cfd0
--- /dev/null
+++ b/macros/optex/base/f-overlock.opm
@@ -0,0 +1,27 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [Overlock] \Overlock {fonts simulate Overlock sewing technique}
+ {\caps} {\rm \bf \it \bi \kf \ki} {}
+ {[Overlock-Regular-OTF]}
+ {\_def\_fontnamegen {[Overlock-\_currV-OTF]:\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifier:^^J
+ \bolder ...... \rm=Bold \bf=Black^^J
+ Warning: latin characters like Čč unavailable.^^J
+}}
+
+\_moddef \resetmod {\_fsetV caps={} \_fvars Regular Bold Italic BoldItalic }
+\_moddef \bolder {\_fvars Bold Black BoldItalic BlackItalic }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } % does not work ??
+
+\_famvardef \kf {\_fsetV curr=Black \_rm}
+\_famvardef \ki {\_fsetV curr=BlackItalic \_rm}
+
+\_initfontfamily % new font family must be initialized
+
+\_endcode
+
+See the file `f-heros.opm` for information about principles of such
+font-macro-files.
+
diff --git a/macros/optex/base/f-stix.opm b/macros/optex/base/f-stix.opm
new file mode 100644
index 0000000000..ab4d8b7e63
--- /dev/null
+++ b/macros/optex/base/f-stix.opm
@@ -0,0 +1,24 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [STIX] \Stix {Scientific and Technical Information Exchange fonts}
+ {} {\rm \bf \it \bi} {STIXMath}
+ {[STIX-Regular]}
+ {\_def\_fontnamegen {[STIX-\_currV]:\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifier:^^J
+ \caps ...... caps & small caps (does not work)^^J
+}}
+
+\_moddef \resetmod {\_fsetV caps={} \_fvars Regular Bold Italic BoldItalic }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
+
+\_initfontfamily % new font family must be initialized
+
+\_loadmath {[STIXMath-Regular]}
+
+\_endcode
+
+See the file `f-heros.opm` for information about principles of such
+font-macro-files.
+
diff --git a/macros/optex/base/f-stixtwo.opm b/macros/optex/base/f-stixtwo.opm
new file mode 100644
index 0000000000..629b57a741
--- /dev/null
+++ b/macros/optex/base/f-stixtwo.opm
@@ -0,0 +1,28 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [STIXTwo] \StixTwo {Second version of STIX}
+ {\caps} {\rm \bf \it \bi} {STIXTwoMath}
+ {[STIXTwoText-Regular]}
+ {\_def\_fontnamegen {[STIXTwoText-\_currV]:\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifiers:^^J
+ \caps ...... caps & small caps,^^J
+ \medium .... \rm,\it medium,^^J
+ \bolder .... \rm,\it semibold (between medium and \bf)^^J
+}}
+
+\_moddef \resetmod {\_fsetV caps={} \_fvars Regular Bold Italic BoldItalic }
+\_moddef \medium {\_fvars Medium Bold MediumItalic BoldItalic }
+\_moddef \bolder {\_fvars SemiBold Bold SemiBoldItalic BoldItalic }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
+
+\_initfontfamily % new font family must be initialized
+
+\_loadmath {[STIXTwoMath-Regular]}
+
+\_endcode
+
+See the file `f-heros.opm` for information about principles of such
+font-macro-files.
+
diff --git a/macros/optex/base/f-xits.opm b/macros/optex/base/f-xits.opm
new file mode 100644
index 0000000000..eac2ee6b08
--- /dev/null
+++ b/macros/optex/base/f-xits.opm
@@ -0,0 +1,25 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [XITS] \Xits {A fork of STIX with Bold Math variant}
+ {\caps} {\rm \bf \it \bi} {XITSMath}
+ {[XITS-Regular]}
+ {\_def\_fontnamegen {[XITS-\_currV]:\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifier:^^J
+ \caps ...... caps & small caps (works only for \rm)^^J
+}}
+
+\_moddef \resetmod {\_fsetV caps={} \_fvars Regular Bold Italic BoldItalic }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
+
+\_initfontfamily % new font family must be initialized
+
+\_loadmath {[XITSMath-Regular]}
+\_loadboldmath {[XITSMath-Bold]} \to {[XITSMath-Regular]}
+
+\_endcode
+
+See the file `f-heros.opm` for information about principles of such
+font-macro-files.
+
diff --git a/macros/optex/base/fams-ini.opm b/macros/optex/base/fams-ini.opm
index ba334ef86a..ad3ace24f3 100644
--- a/macros/optex/base/fams-ini.opm
+++ b/macros/optex/base/fams-ini.opm
@@ -56,6 +56,19 @@
\caps: {\rm\bf} \book\caps: {\rm} }
\_famalias [NewCM] \_famalias [NewCMfonts]
+\_famfrom{STI Pub group, MicroPress Inc., Coen Hoffman}
+\_faminfo [STIX] {Scientific and Technical Information Exchange fonts} {f-stix}
+ { -: {\rm\bf\it\bi} }
+
+\_faminfo [XITS] {A fork of STIX with Bold Math variant} {f-xits}
+ { -: {\rm\bf\it\bi} \caps: {\rm} }
+
+\_famfrom{Tiro Typeworks Ltd., R. Mills, J. Hudson, P. Hanslow, C. Hoffman}
+\_faminfo [STIXTwo] {Second version of STIX} {f-stixtwo}
+ { -,\caps: {\rm\it} \medium,\caps\medium: {\rm\it} \bolder,\caps\bolder: {\rm\it}
+ -,\caps: {\bf\bi} }
+\_famalias [STIX2]
+
\_famfrom {Philipp H. Poll}
\_faminfo [Linux Libertine] {Free fonts typically installed on systems} {f-libertine}
{ -: {\rm\bf\it\bi} \semibold: {\bf\bi}
@@ -139,6 +152,10 @@
\_faminfo [ComicNeue] {Comic Neue sans serif} {f-comicneue}
{ -,\angular: {\lf\li\rm\it\bf\bi} }
+\_famfrom {tipo, Dario Manuel Muhafara}
+\_faminfo [Overlock] {fonts simulate Overlock sewing technique} {f-overlock}
+ { -: {\rm\it\bf\bi\kf\ki} }
+
\_famfrom {Eben Sorkin}
\_faminfo [Merriweather] {Modern shapes, sharp serifs} {f-merriweather}
{ -,\sans: {\lf\li\rm\it\bf\bi\kf\ki} \caps,\sans\caps: {\rm\it} }
@@ -152,6 +169,11 @@
\caps, \caps\cond: {\rm\bf\it\bi} \caps\ttset: {\rm\bf}
}
+\_famfrom {Julieta Ulanovsky, http://www.zkysky.com.ar}
+\_faminfo [Montserrat] {Inspired from old posters in Montserat in Buenos Aires} {f-montserrat}
+ { -,\caps,\alter: {\rm\bf\it\bi} \xlight,\elight,\light,-,\medium,\semibold: {\rm\it}
+ -,\medium,\semibold: {\bf\bi} }
+
\_famfrom {CTU in Prague, Roman Cernohous}
\_faminfo [Technika] {Fonts from visual style of CTU in Prague} {f-technika}
{ -,\light,\book, \caps, \caps\book: {\rm\bf\it\bi} -:{\stencil} }
diff --git a/macros/optex/base/fonts-catalog.opm b/macros/optex/base/fonts-catalog.opm
index 6576e5fb11..cdd77359f1 100644
--- a/macros/optex/base/fonts-catalog.opm
+++ b/macros/optex/base/fonts-catalog.opm
@@ -1,9 +1,10 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_undefined {Font catalogue <2022-02-22>} % loaded on demand by \fontfam[catalog]
+\_codedecl \_undefined {Font catalogue <2022-07-11>} % loaded on demand by \fontfam[catalog]
\_tracinglostchars=1 % only to log file
\_initunifonts
+\_raggedbottom
\_begingroup
\_istoksempty\_catalogmathsample \_iftrue \_noloadmath \_fi
@@ -133,5 +134,6 @@ described in the \code{fams-ini.opm} file.
\_endcode % -------------------------------------
+2022-07-11 \_raggedbottom added
2022-02-22 \_ttfixed, \footline set as global, bug fixed
2020-02-26 released
diff --git a/macros/optex/base/if-macros.opm b/macros/optex/base/if-macros.opm
index cf28f3dccf..8f6082a27a 100644
--- a/macros/optex/base/if-macros.opm
+++ b/macros/optex/base/if-macros.opm
@@ -77,8 +77,9 @@
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! The
- private variants use \`\_do` separator instead `\do` separator.
+ When the user writes `\input tikz` then `\foreach` macro is redefined in
+ each TikZ environment.
+ The private variants use \`\_do` separator instead `\do` separator.
\_cod -----------------------------
\_newcount\_frnum % the numeric variable used in \fornum
diff --git a/macros/optex/base/lang-data.opm b/macros/optex/base/lang-data.opm
index df6f43d90f..6e11f8bd9a 100644
--- a/macros/optex/base/lang-data.opm
+++ b/macros/optex/base/lang-data.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_langdata {Language dependent data <2022-02-19>} % only en, cs preloaded in format
+\_codedecl \_langdata {Language dependent data <2022-06-28>} % only en, cs preloaded in format
\_langdata en {English} % -----------------------------------------------
\_langw en Chapter Table Figure Subject
@@ -12,9 +12,9 @@
\_sdef{_mt:today:en}{\_mtext{m\_the\_month} \_the\_day, \_the\_year}
\_quotationmarks en {“”‘’}
-\_let \_sortingdataen = \_sortingdatacs % it can be shared with Czech
-\_let \_ignoredcharsen = \_ignoredcharscs
-\_def \_compoundcharsen {}
+%\_let \_sortingdataen = \_sortingdatalatin % set already, see section 2.33, makeindex.opm
+%\_let \_ignoredcharsen = \_ignoredcharsgeneric
+%\_def \_compoundcharsen {}
\_langdata cs {Czech} % ------------------------------------------------
% Chapter Table Figure Subject
@@ -32,14 +32,20 @@
\_sdef{_mt:today:cs}{\_the\_day.~\_mtext{m\_the\_month} \_the\_year} % date format
\_quotationmarks cs {„“‚‘}
-%\_def\_sortingdatacs {...} % all these macros are preloaded in the format,
-%\_def\_compoundcharscs {...} % see section 2.33 or file makeindex.tex.
-%\_def\_ignoredcharscs {...}
+\_let \_sortingdatacs = \_sortingdatalatin
+\_let \_ignoredcharscs = \_ignoredcharsgeneric
+\_def \_compoundcharscs {ch:^^T Ch:^^U CH:^^V} % see \_compoundchars in section 2.33
+
\_langdata de {German} % ------------------------------------------------
\_langw de Kapitel Tabelle Abbildung Betreff
\_quotationmarks de {„“‚‘}
-% todo
+%todo
+\_let \_sortingdatade = \_sortingdatalatin
+\_let \_ignoredcharsde = \_ignoredcharsgeneric
+\_def \_compoundcharsde {ß:ss}
+\_def \_xcompoundcharsde {} % ß is interpreted in second pass of sorting
+%\_def \_compoundcharsde {ß:ss Ä:AE Ö:OE Ü:UE ä:ae ö:oe ü:ue} % alternative sorting
\_langdata it {Italian} % ------------------------------------------------
\_langw it Capitolo Tabella Fig. Oggetto
@@ -52,16 +58,57 @@
\_langw es Capítulo Tabla Figura Sujeto
\_quotationmarks es {“”«»}
% todo
+\_let \_sortingdataes = \_sortingdatalatin
+\_let \_ignoredcharses = \_ignoredcharsgeneric
+\_def \_compoundcharses {} % since 1994
+
\_langdata fr {French} % ------------------------------------------------
\_langw fr Chapitre Tableau Figure Matière
\_quotationmarks fr {“”«»}
-% toto
+% todo
+\_let \_sortingdatafr = \_sortingdatalatin
+\_let \_ignoredcharsfr = \_ignoredcharsgeneric
+\_def \_compoundcharsfr {}
+\_let \_secondpassfr = \_reversewords % accents in second pass are read from the end
+
\_langdata pl {Polish} % ------------------------------------------------
\_langw pl Rozdział Tabela Ilustracja Temat
\_quotationmarks pl {“”«»}
% todo
+\_let \_sortingdatapl = \_sortingdatalatin
+\_let \_ignoredcharspl = \_ignoredcharsgeneric
+\_def \_compoundcharspl {}
+
+
+\_langdata sv {Swedish} % ------------------------------------------------
+\_langw sv Kapitel Tabell Figur Föremål
+\_quotationmarks sv {””’’}
+% todo
+\_def \_sortingdatasv {% it is not a subset of \_sortingdatalatin, there is different order
+ /,{ },-,&,@,%
+ aA,bB,cC,dD,eE,fF,gG,hH,iI,jJ,kK,lL,mM,nN,oO,%
+ pP,qQ,rR,sS,tT,uU,vVwW,xX,yY,zZ,%
+ åÅ,äÄ,öÖ,%
+ 0,1,2,3,4,5,6,7,8,9,'%
+}
+\_let \_ignoredcharssv = \_ignoredcharsgeneric
+\_def \_compoundcharssv {}
+
+
+\_langdata hu {Hungarian}
+\_langw hu Fejezet Táblázat Ábra Téma
+\_quotationmarks hu {„”»«}
+%todo
+\_let \_sortingdatahu = \_sortingdatalatin
+\_let \_ignoredcharshu = \_ignoredcharsgeneric
+\_def \_compoundcharshu {cs:c^^Z Cs:C^^Z CS:C^^Z
+ dzz:d^^Z^^Z Dzz:D^^Z^^Z DZZ:D^^Z^^Z dz:d^^Z Dz:D^^Z DZ:D^^Z
+ gy:g^^Z Gy:G^^Z GY:G^^Z ly:l^^Z Ly:L^^Z LY:L^^Z ny:n^^Z Ny:N^^Z NY:N^^Z
+ sz:s^^Z Sz:S^^Z SZ:S^^Z ty:t^^Z Ty:T^^Z TY:Y^^Z
+ zs:z^^Z Zs:Z^^Z ZS:Z^^Z}
+
\_langdata el {Greek} % ------------------------------------------------
\_langw el Κεφάλαιο Πίνακας Σχήμα θέμα
@@ -75,8 +122,10 @@
\_langdata uk {Ukrainian} % -----------------------------------------------
\_langw uk Глави Таблиця Малюнок Тема
+\_quotationmarks uk {“”«»}
% todo
+
\_langdata sk {Slovak} % ------------------------------------------------
\_langw sk Kapitola Tabuľka Obrázok Vec
\_langb sk { a } { a~kol.} { vyd.} {vid.~} {ročník~} {č.~} {s.~} {~s.} {,~editor} {,~editori}
@@ -87,9 +136,10 @@
\_sdef{_mt:today:sk}{\_the\_day.~\_mtext{m\_the\_month} \_the\_year} % date format
\_quotationmarks sk {„“‚‘}
-\_let \_sortingdatask = \_sortingdatacs % it can be shared with Czech
-\_let \_compoundcharssk = \_compoundcharscs
-\_let \_ignoredcharssk = \_ignoredcharscs
+\_let \_sortingdatask = \_sortingdatalatin
+\_let \_ignoredcharssk = \_ignoredcharsgeneric
+\_let \_compoundcharssk = \_compoundcharscs % Dz Dž are sorted OK without new setting
+
\_langdata pt {Portuguese} % ------------------------------------------------
\_langw pt Capítulo Tabela Figura Assunto
@@ -100,5 +150,7 @@
\_endcode
-2022-02-19: concept finalized, but data still far of competness
+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-04: released
diff --git a/macros/optex/base/lang-decl.opm b/macros/optex/base/lang-decl.opm
index 87a13b88ce..3b9f9e727d 100644
--- a/macros/optex/base/lang-decl.opm
+++ b/macros/optex/base/lang-decl.opm
@@ -249,6 +249,8 @@
\_public \uselanguage ;
\_doc -----------------------------
+ \secc [langdata] Data for various languages
+
The \"language data" include declarations of
rules for sorting (see section~\ref[makeindex]),
language-dependent phrases and quotation marks (see section~\ref[langphrases]).
diff --git a/macros/optex/base/makeindex.opm b/macros/optex/base/makeindex.opm
index e0e7d7ad6c..ba50352559 100644
--- a/macros/optex/base/makeindex.opm
+++ b/macros/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 <2022-03-18>} % preloaded in format
+\_codedecl \makeindex {Makeindex and sorting <2022-06-28>} % preloaded in format
\_doc -----------------------------
\^`\makeindex` implements sorting algorithm at \TeX/ macro-language level.
@@ -16,95 +16,163 @@
before acute before circumflex before ring. At less priority: lowercase
letters must be before uppercase letters.
- The \`\_sortingdata``<lang-tag>` implements these rules for the language
- given by <lang-tag>. The <lang-tag> is typicaly ISO 639-1 code of the language
- and it is declared by \~`\_preplang` defined in section~\ref[langdecl].
- The \`\_sortingdatacs` for Czech rules is defined below.
+ The \`\_sortingdatalatin`
+ implements these rules for the languages with latin alphabets.
The groups between commas are not distinguished in the first
pass. The second pass distinguishes all characters mentioned in the
- `\_sortingdata<lang-tag>` (commas are ignored). The order of letters
- in the `\_sortingdata<lang-tag>` macro is significant for the sorting algorithm.
+ \^`\_sortingdatalatin` (commas are ignored). The order of letters
+ in the \^`\_sortingdatalatin` macro is significant for the sorting algorithm.
\_cod -----------------------------
-\_def \_sortingdatacs {%
+\_def \_sortingdatalatin {%
/,{ },-,&,@,%
- aAäÄáÁ,%
+ aAàÀâÂäÄáÁ,%
+ ąĄ,%
bB,%
cC,%
- čČ,%
+ ćĆčČ,%
dDďĎ,%
- eEéÉěĚ,%
+ eEèÈéÉëËêÊěĚ,%
+ ęĘ,%
fF,%
gG,%
hH,%
^^T^^U^^V,% ch Ch CH
- iIíÍ,%
+ iIíÍïÏîÎ,%
jJ,%
kK,%
lLĺĹľĽ,%
+ łŁ,%
mM,%
nNňŇ,%
+ ńŃñÑ,%
oOöÖóÓôÔ,%
pP,%
qQ,%
rRŕŔ,%
řŘ,%
- sS,%
- šŠ,%
+ sSß,%
+ śŚšŠ,%
tTťŤ,%
- uUüÜúÚůŮ,%
+ uUùÙûÛüÜúÚůŮűŰ,%
vV,%
wW,%
xX,%
- yYýÝ,%
+ yYýÝÿŸ,%
zZ,%
žŽ,%
+ źŹ,%
+ żŻ,%
+ ^^Z,% Hungarian: cz:c^^Z, etc., see \_compoundcharshu in lang-data.opm
0,1,2,3,4,5,6,7,8,9,'%
}
\_doc -----------------------------
- Characters to be ignored are declared in \`\_ignoredchars``<lang-tag>`.
- See \`\_ignoredcharscs` for Czech rules. These characters are ignored in the first pass
+ Characters to be ignored during sorting are declared in \`\_ignoredcharsgeneric`.
+ These characters are ignored in the first pass
without additional condition. All characters are taken into account in
the second pass: ASCII characters with code $\string<65$ are sorted first if they
- are not mentioned in the \^`\_sortingdata``<lang-tag>` macro.
+ are not mentioned in the `\_sortingdata...` macro.
Others not mentioned characters have undefined behavior during sorting.
+ \_cod -----------------------------
+
+\_def \_ignoredcharsgeneric {.,;?!:'"|()[]<>=+-}
- The compound characters (two or more characters interpreted as one
- character in the sorting algorithm) are mapped to single invisible characters
- in \`\_compoundchars``<lang-tag>`, see \`\_compoundcharscs` below for Czech rules,
- where ch or Ch or CH are declared as a single letter sorted between H and I.
- See \^`\_sortingdatacs` above where these declared characters are used.
+ \_doc -----------------------------
+ Sorting is always processed by rules of a given language. The macros
+ \`\_sortingdata``<lang-tag>`, \`\_ignoredchars``<lang-tag>`
+ and \`\_compoundchars``<lang-tag>` declare these rules.
+ The `<lang-tag>` is ISO code of the language: en, cs, de, pl, es for example.
+ The English language is implemented here. Other languages are implemented
+ in the `lang-data.opm` file (see section~\ref[langdata]).
\_cod -----------------------------
-\_def \_ignoredcharscs {.,;?!:'"|()[]<>=+}
-\_def \_compoundcharscs {ch:^^T Ch:^^U CH:^^V} % DZ etc. are sorted normally
+\_let \_sortingdataen = \_sortingdatalatin % English alphabet is subset of Latin
+\_let \_ignoredcharsen = \_ignoredcharsgeneric
+\_def \_compoundcharsen {} % English doesn't have compound characters like DZ
\_doc -----------------------------
+ The \^`\_compoundchars``<lang-tag>` can declare changes performed before
+ sorting. For example Czech language declares:
+ \begtt
+ \_let \_sortingdatacs = \_sortingdatalatin % Czech alphabet is subset of Latin
+ \_def \_compoundcharscs {ch:^^T Ch:^^U CH:^^V}
+ \endtt
+ It transforms two-letters `ch` to single character `^^T` because ch is
+ treated as single compound character by Czech rules and CH is sorted between H and I.
+ See \^`\_sortingdatalatin` where `^^T` is used. This declaration makes more
+ transformations of Ch and CH too. The declarations of the form `x:y` in the
+ \^`\_compoundchars``<lang-tag>` are separated by space.
+
+ You can declare a transformation from single letter to more letters too. For
+ example German rules sets ß equal to ss during sorting:
+ \begtt
+ \_let \_sortingdatade = \_sortingdatalatin % German alphabet is subset of Latin
+ \_def \_compoundcharsde {ß:ss}
+ \endtt
+ If there are two words equal after first pass of sorting: Masse (mass)
+ and Maße (measures) for example, then second pass must decide about the
+ order. DIN 5007, section 6.1 says: ss must be before ß in this case. So,
+ we want to switch off the \^`\_compoundchars` declaration for the second
+ pass and use the order of s and ß given in `\_sortingdata`. This is
+ possible if the \`\_xcompoundchars``<lang-tag>` is defined.
+ It has precedence in the second pass of sorting. We declare for German:
+ \begtt
+ \_def \_xcompoundcharsde {}
+ \endtt
+ Geman rules mention alternative sorting for phone-books or similar lists of
+ names. The letters ä ö ü should be interpreted as ae, oe and ue. So we get
+ Mueller $\lt$ Müller $\lt$ Muff. If this rule is not taken into account, we get
+ Mueller $\lt$ Muff $\lt$ Müller. The rule can be implemented by:
+ \begtt
+ \_def \_compoundcharsde {ß:ss Ä:AE Ö:OE Ü:UE ä:ae ö:oe ü:ue}
+ \endtt
+ Because u $\lt$ ü in `\_sortingdata` and because `\_xcompoundcharsde` is
+ empty, we have Mueller $\lt$ Müller after second pass of the sorting.
+
You can declare these macros for more languages if you wish to use
`\makeindex` with sorting rules with respect to your language.
Note: if you need to map compound characters to a character, don't use
`^^I`, `^^J` or `^^M` because these characters have very specific category codes.
- And use spaces to separate more mappings, like in \^`\_compoundcharscs` above.
- If you create `\_sortingdata` etc. for your language, please, send them
+ If you created `\_sortingdata` etc. for your language, please, send them
to me. I am ready to add them to the file `lang-data.opm` in a new \OpTeX/ release.
- See also section~\ref[langdecl].
-
- Preparing to primary pass is implemented by the \`\_setprimarysorting` macro.
- It is called from `\makeindex` macro and all processing of sorting is in a group.
+ See also section~\ref[langdata].
+
+ 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
+ \`\_secondpass``<lang-tag>` is set to \^`\_reversewords`.
+ For example, `lang-data.opm` declares `\_let\_secondpassfr=\_reversewords`.
+
+ \bigskip
+ 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).
+ 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
+ declares them. If not then warning will be printed using \`\_nold` macro
+ and English data are used. The `\lccode` of all characters from
+ \^`\_sortingdata` and \^`\_ignoredchars` are set. The sorted words will be converted
+ using \^`\_compoundchars` followed by `\lowercase` before first pass is run.
\_cod -----------------------------
\_def\_setprimarysorting {%
\_ea\_let \_ea\_sortingdata \_csname _sortingdata\_sortinglang\_endcsname
\_ea\_let \_ea\_compoundchars \_csname _compoundchars\_sortinglang\_endcsname
\_ea\_let \_ea\_ignoredchars \_csname _ignoredchars\_sortinglang\_endcsname
+ \_def\_nold{}%
\_ifx \_sortingdata\_relax \_addto\_nold{ sortingdata}%
\_let \_sortingdata = \_sortingdataen \_fi
\_ifx \_compoundchars\_relax \_addto\_nold{ compoundchars}%
\_let \_compoundchars = \_compoundcharsen \_fi
\_ifx \_ignoredchars\_relax \_addto\_nold{ ignoredchars}%
\_let \_ignoredchars = \_ignoredcharsen \_fi
+ \_ifx\_nold\_empty\_else \_opwarning{Missing\_nold\_space for language (\_sortinglang)}\_fi
\_ifx \_compoundchars\_empty \_else
\_edef \_compoundchars {\_detokenize\_ea{\_compoundchars} }\_fi % all must be catcode 12
\_def \_act ##1{\_ifx##1\_relax \_else
@@ -135,12 +203,11 @@
The \`\_preparesorting` `\,<string>` converts `<string>` to `\_tmpb`
with respect to the data initialized in \^`\_setprimarysorting` or
\^`\_setsecondarysorting`.\nl
- The compoud characters are converted to single characters by the
- \`\_docompound` macro.
+ The compoud characters are converted by the \`\_docompound` macro.
\_cod -----------------------------
\_def \_preparesorting #1{%
- \_edef \_tmpb {\_ea\_ignorefirst\_csstring #1}% \,<string> -> <string>
+ \_edef \_tmpb {\_ea\_ignoreit\_csstring #1}% \,<string> -> <string>
\_ea \_docompound \_compoundchars \_relax:{} % replace compound characters
\_lowercase \_ea{\_ea\_def \_ea\_tmpb \_ea{\_tmpb}}% convert in respect to \_sortingdata
\_ea\_replstring \_ea\_tmpb \_ea{\_csstring\^^I}{}% remove ignored characters
@@ -148,7 +215,6 @@
\_def \_docompound #1:#2 {%
\_ifx\_relax#1\_else \_replstring\_tmpb {#1}{#2}\_ea\_docompound \_fi
}
-\_def \_ignorefirst#1{}
\_doc -----------------------------
Macro \`\_isAleB` `\,<string1> \,<string2>` returns the result of comparison
@@ -160,7 +226,7 @@
comparison.
\nl
The macro
- \`\_testAleB` `<converted string1>&\_relax<converted-string2>\_relax \,<string1>\,<string2>`\nl
+ \`\_testAleB` `<converted-string1>&\_relax<converted-string2>&\_relax \,<string1>\,<string2>`\nl
does the real work. It reads the first character from both converted strings, compares them
and if it is equal then calls itself recursively else gives the result.
\_cod -----------------------------
@@ -178,17 +244,27 @@
\_else \_ifnum `#1<`#3 \_AleBtrue \_else \_AleBfalse \_fi
\_fi
}
+
+ \_doc -----------------------------
+ The \`\_testAleBsecondary` `\,<string1> \,<string2>` is run if the
+ 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`
+ `<converted-string1>0\_relax<converted-string2>1\_relax`
+ \_cod -----------------------------
+
+
\_def\_testAleBsecondary#1#2{%
- \_bgroup
- \_setsecondarysorting
- \_preparesorting#1\_let\_tmpa=\_tmpb \_preparesorting#2%
- \_edef\_tmpb{\_tmpa0\_relax\_tmpb1\_relax}%
- \_ea\_testAleBsecondaryX \_tmpb
- \_egroup
+ \_setsecondarysorting \_let\_setsecondarysorting=\_relax
+ \_preparesorting#1\_let\_tmpa=\_tmpb \_preparesorting#2%
+ \_prepsecondpass
+ \_edef\_tmpb{\_tmpa0\_relax\_tmpb1\_relax}%
+ \_ea\_testAleBsecondaryX \_tmpb
}
\_def\_testAleBsecondaryX #1#2\_relax #3#4\_relax {%
\_if #1#3\_testAleBsecondaryX #2\_relax #4\_relax
- \_else \_ifnum `#1<`#3 \_global\_AleBtrue \_else \_global \_AleBfalse \_fi
+ \_else \_ifnum `#1<`#3 \_AleBtrue \_else \_AleBfalse \_fi
\_fi
}
@@ -197,7 +273,7 @@
code is created by my son Miroslav.
The \`\_mergesort` macro expects that all items in `\_iilist` are separated
by a comma when it starts. It ends with sorted items in `\_iilist` without commas.
- So `\_dosorting` macro must prepare commas between items.
+ So \^`\_dosorting` macro must prepare commas between items.
\_cod -----------------------------
\_def\_mergesort #1#2,#3{% by Miroslav Olsak
@@ -249,30 +325,53 @@
\_newifi \_ifasciisorting \_asciisortingfalse
\_def\_dosorting #1{%
\_begingroup
- \_def\_nold{}%
- \_ifx\_sotringlang\_undefined \_edef\_sortinglang{\_cs{_lan:\_the\_language}}\_fi
- \_ifasciisorting
- \_edef\_sortinglang{ASCII}%
- \_def \_preparesorting##1{\_edef\_tmpb{\_ea\_ignorefirst\_csstring##1}}%
+ \_ifasciisorting \_def\_sortinglang{ASCII}\_fi
+ \_ifx\_sortinglang\_undefined \_edef\_sortinglang{\_cs{_lan:\_the\_language}}\_fi
+ \_message{OpTeX: Sorting \_string#1 (\_sortinglang) ...^^J}%
+ \_ismacro\_sortinglang{ASCII}\_iftrue
+ \_def \_preparesorting##1{\_edef\_tmpb{\_ea\_ignoreit\_csstring##1}}%
\_let \_setsecondarysorting=\_relax
\_else
\_setprimarysorting
\_fi
- \_message{OpTeX: Sorting \_string#1 (\_sortinglang) ...^^J}%
- \_ifx\_nold\_empty\_else \_opwarning{Missing\_nold\_space for language (\_sortinglang)}\_fi
\_def \_act##1{\_preparesorting ##1\_edef##1{\_tmpb}}%
- \_ea\_xargs \_ea\_act #1;%
+ \_ea\_xargs \_ea\_act #1;% \_preparesorting for first pass of sorting applied
+ \_ifcsname _xcompoundchars\_sortinglang\_endcsname
+ \_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,}}%
- \_edef #1{\_ea}\_ea\_xargs \_ea\_act #1;%
+ \_edef #1{\_ea}\_ea\_xargs \_ea\_act #1;% commas between items added, mergesort initialized
\_edef \_iilist{\_ea}\_ea\_mergesort #1\_end,\_end
\_ea\_endgroup
\_ea\_def\_ea#1\_ea{\_iilist}%
}
\_doc -----------------------------
+ French rules needs reverese 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
+ \`\_sortrevers` macro. The \^`\_prepsecondpass` macro is used in the
+ \^`\_testAleBsecondary` and it is empty by default.
+ \_cod -----------------------------
+
+\_def\_prepsecondpass{}
+\_def\_reversewords{%
+ \_addto\_prepsecondpass{\_edef\_tmpa{\_ea\_sortrevers\_tmpa\_relax}%
+ \_edef\_tmpb{\_ea\_sortrevers\_tmpb\_relax}}%
+}
+\_def\_sortrevers #1#2\_relax{\_ifx^#2^#1\_else \_sortrevers#2\_relax #1\_fi}
+
+ \_doc -----------------------------
The \`\makeindex` prints the index. First, it sorts the `\_iilist`
second, it prints the sorted `\_iilist`, each item is printed
- using \^`\_printindexitem`.
+ using \^`\_printindexitem`.\nl
+ We set `\leftskip=\iindent` and we suppose that each index entry
+ starts by `\noindent\hskip-\iindent` (see the macro \~`\_printii`).
+ Then the next lines of the same index
+ entry (if the page list is broken to more pages) is indented by
+ `\leftskip=\iindent`.
\_cod -----------------------------
\_def\_makeindex{\_par
@@ -300,7 +399,7 @@
\_ifcsname _\_csstring #1\_endcsname
\_ea\_ea\_ea \_printii \_csname _\_csstring #1\_endcsname &%
\_else
- \_ea\_ea\_ea\_printii \_ea\_ignorefirst \_csstring #1&%
+ \_ea\_ea\_ea\_printii \_ea\_ignoreit \_csstring #1&%
\_fi
\_ea\_printiipages #1&
}
@@ -450,6 +549,9 @@
\_endcode % -------------------------------------
+2022-06-28 \_reversewords for French sorting introduced
+2022-06-28 \_sortingdatalatin covers more languages
+2022-06-28 \_xcompoundchars introduced, comments upgraded (German sorting mentioned)
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
diff --git a/macros/optex/base/math-preload.opm b/macros/optex/base/math-preload.opm
index fde73e7e65..9f73ef24d1 100644
--- a/macros/optex/base/math-preload.opm
+++ b/macros/optex/base/math-preload.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \normalmath {Math fonts CM + AMS preloaded <2022-02-22>} % preloaded in format
+\_codedecl \normalmath {Math fonts CM + AMS preloaded <2022-07-22>} % preloaded in format
\_doc ------------------------------
We have two math macros \`\normalmath` for the normal shape of all math
@@ -39,8 +39,6 @@
% \_setmathfamily 11 \_tenbi
\_setmathdimens
}
-\_count18=9 % families declared by \newfam are 12, 13, ...
-
\_def \normalmath {\_normalmath} \_def\boldmath {\_boldmath}
\_doc -----------------------------
@@ -171,16 +169,36 @@
\_public \setmathsizes \ptunit \ptmunit ;
\_doc -----------------------------
+ \`\_setmathparam``<luatex-param> {<factor>}` sets
+ <luatex-param> (like `\Umathspaceafterscript`) to values dependent
+ on `1em` of textfont, scriptfont, scriptscriptfont. The <factor> is
+ scaling factor of mentioned `1em`.
+ \_cod -----------------------------
+
+\_def\_setmathparam#1#2{%
+ #1\_displaystyle =#2\_fontdimen6\_textfont1
+ #1\_textstyle =#2\_fontdimen6\_textfont1
+ #1\_scriptstyle =#2\_fontdimen6\_scriptfont1
+ #1\_scriptscriptstyle =#2\_fontdimen6\_scriptscriptfont1
+}
+
+ \_doc -----------------------------
The \`\_setmathdimens` macro is used in \^`\normalmath` or \^`\boldmath`
macros. It makes math dimensions dependent on the font size (plain \TeX/ sets
them only for 10\,pt typesetting). The `\skewchar` of some math families are
- set here too.
+ set here too.\nl
+ \^`\_setmathparam \Umathspaceafterscript` is used instead `\scriptspace`
+ setting because \LuaTeX/ ingnores `\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
+ as Plain \TeX/ `\scriptspace=0.5pt` at 10\,pt font size.
\_cod -----------------------------
\_def\_setmathdimens{% PlainTeX sets these dimens for 10pt size only:
\_delimitershortfall=0.5\_fontdimen6\_textfont3
\_nulldelimiterspace=0.12\_fontdimen6\_textfont3
- \_scriptspace=0.05\_fontdimen6\_textfont3
+ \_setmathparam\_Umathspaceafterscript \_scriptspacefactor
\_skewchar\_textfont1=127 \_skewchar\_scriptfont1=127
\_skewchar\_scriptscriptfont1=127
\_skewchar\_textfont2=48 \_skewchar\_scriptfont2=48
@@ -188,6 +206,7 @@
\_skewchar\_textfont6=127 \_skewchar\_scriptfont6=127
\_skewchar\_scriptscriptfont6=127
}
+\_def\_scriptspacefactor{.05}
\_doc -----------------------------
Finally, we preload a math fonts collection in [10/7/5] sizes
@@ -224,6 +243,7 @@ For example
\_endinput
+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)
2020-04-14: \skewchar\fam6 added
diff --git a/macros/optex/base/math-unicode.opm b/macros/optex/base/math-unicode.opm
index a092d081c2..22db1d095e 100644
--- a/macros/optex/base/math-unicode.opm
+++ b/macros/optex/base/math-unicode.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \loadmath {Unicode Math fonts <2021-08-16>} % preloaded in format
+\_codedecl \loadmath {Unicode Math fonts <2022-07-22>} % preloaded in format
\_doc -----------------------------
\`\loadmath` `{<Unicode-math font>}` loads the given font. It does:
@@ -87,6 +87,7 @@
\_def\_setunimathdimens{% PlainTeX sets these dimens for 10pt size only:
\_delimitershortfall=0.5\_fontdimen6\_textfont1
\_nulldelimiterspace=0.12\_fontdimen6\_textfont1
+ \_setmathparam\_Umathspaceafterscript \_scriptspacefactor
\_setbox0=\_hbox{\_everymath{}$\_fam1\_displaystyle{0\_atop0}$}%
\_Umathfractiondelsize\_displaystyle = \_dimexpr(\_ht0-\_Umathaxis\_displaystyle)*2\_relax
\_setbox0=\_box\_voidbox
@@ -154,11 +155,11 @@
`\<first>+1`, `\<first>+2`
etc., but \`\_umathcharholes` are skipped
(`\_umathcharholes` are parts of the Unicode table not designed for math
- alphabets but they cause that the math alphabets are
+ alphabets, they cause that the math alphabets are
not continuously spread out in the table; I mean that the
designers were under the influence of drugs when they created
this part of the Unicode table).
- The `<from>-<to>` clause includes normal letters like `A-Z`.
+ The `<from>-<to>` clause includes characters like~`A-Z`.
\nl
\`\_umahrangegreek` `\<first>` is the same as
`\_umathrange {<alpha>-<omega>}\<first>`.
@@ -203,6 +204,53 @@
\_ea\_greekdef \_fi
}
+ \_doc -----------------------------
+ \`\addUmathfont` `<fam> {[<normal-font>]}{<ffeatures>} {[<bold-font>]}{<ffeatures>} {<factor>}`
+ allocates new <fam> using \^`\newfam` and adds loading this font to the
+ \~`\normalmath` and \~`\boldmath` macros. Note that allocationos using
+ \^`\newfam` starts from 43 because numbers 1--42 are reserved for direct
+ usage without \^`\newfam`.
+ \_cod -----------------------------
+
+\_def\_addUmathfont #1#2#3#4#5#6{% #1: fam (will be set), #2#3: normal font, #4#5: bold font
+ \_ifx\_ncharrmA\_undefined \_errmessage{basic Unicode math font must be loaded first}%
+ \_else \_isfont{#2}\_iffalse \_opwarning{font #2 is unavailable}%
+ \_else
+ \_newfam#1\_relax
+ \_global\_addto\_normalmath{\_corrmsize#6 \_loadumathfamily #1 {#2}{#3} }%
+ \_ifx\_relax#4\_relax
+ \_global\_addto\_boldmath{\_corrmsize#6 \_loadumathfamily #1 {#2}{embolden=1.7;} }%
+ \_else
+ \_global\_addto\_boldmath{\_corrmsize#6 \_loadumathfamily #1 {#4}{#5} }%
+ \_fi
+ \_normalmath
+ \_wterm{add-MATH-FONT: #1=\the#1, "#2", \ifx"#4"\else bold: "#4"\fi}%
+ \_fi \_fi
+}
+
+ \_doc -----------------------------
+ \`\resetmathchars` `<fam> <list of sequences> ;`
+ saves <fam> to \`\_mafam` and applies \`\_resetmathcharsX`
+ to each sequence from <list of sequences>.
+ The `\directlua` chunk prints the 8-digits hexadecimal code of the
+ sequence followed by the sequence itself. The digts are scanned by \`\_resetmathcharsY`
+ and new `\Umathchardef` and `\Umathcode` is declared. Note that the used
+ primitives have the syntax:
+ \begtt \catcode`<=13
+ \Umathchardef <sequence> <math class> <math family> <slot number>
+ \Umathcode <code> <math class> <math family> <slot number>
+ \endtt
+ \_cod -----------------------------
+
+\_def\_resetmathchars #1{\_chardef\_mafam=#1\_relax \_xargs \_resetmathcharX}
+\_def\_resetmathcharX#1{\_ea\_resetmathcharY
+ \_directlua{tex.print(string.format("\_pcent08X", \_the#1))}#1}
+\_def\_resetmathcharY#1#2#3#4#5#6#7#8#9{% #9 is given \math-sequence
+ \_Umathchardef #9\_numexpr"#3/2\_relax \_mafam "#4#5#6#7#8
+ \_Umathcode "#4#5#6#7#8=\_numexpr"#3/2\_relax \_mafam "#4#5#6#7#8
+}
+\_public \addUmathfont \resetmathchars ;
+
\_endcode
@@ -218,25 +266,47 @@ if `<normal-font>` was sucessully loaded by the previous `\loadmath`. For exampl
\loadmath {[xitsmath-regular]}
\loadboldmath {[xitsmath-bold]} \to {[xitsmath-regular]}
\endtt
-There are very few Unicode-math fonts with full \^`\boldmath` support.
+There are very few Unicode-math fonts with full \~`\boldmath` support.
I know only XITSMath-Bold and KpMath-Bold. If \^`\loadboldmath` is not used
-then \"faked bold" created from \^`\normalmath` is used by default.
+then \"faked bold" created from \~`\normalmath` is used by default.
-The \^`\loadmath` macro was succesfully tested on:
+The {\em main math font} is loaded by \^`\loadmath` (typically indirectly using
+\^`\fontfam`) and you can load more {\em additional math fonts} by
+\^`\addUmathfont`:
+\begtt \catcode`<=13
+\addUmathfont \famname {[<normal-font>]}{<ffeatures>} {[<bold-font>]}{<ffeatures>} {<factor>}
+\endtt
+The `\famname` is a control sequence declared by \^`\addUmathfont` for later
+use. It gets math family number. The `<factor>` is decimal number for size
+corrections in view of the main math font. If it is empty then <factor>=1.
+If <bold-font> is empty, the \"faked bold" derived from <normal-font> is used.
+Example:
+\begtt
+\fontfam[lm] % does \lodmath{[latinmodern-math]}
+\addUmathfont \xits {[XITSMath-Regular]}{} {[XITSMath-Bold]}{} {}
+\endtt
+%
+declares `latinmodern-math` as main math font (its bold variant is \"faked bold")
+and the additional math font `\xits` is `XITSMath-Regular` for normal
+printing and `XITSMath-Bold` for bold printing.
+
+All characters used in math formula is printed from main math font by
+default. But you can redeclare a list of characters for printing from
+additional font by \^`\resetmathchars` `\famname <list of sequences> ;`. For
+example:
\begtt
-\loadmath{[XITSMath-Regular]} ... XITS MATH
-\loadmath{[latinmodern-math]} ... Latin Modern Math
-\loadmath{[texgyretermes-math]} ... TeXGyre Termes Math
-\loadmath{[texgyrebonum-math]} ... TeXGyre Bonum Math
-\loadmath{[texgyrepagella-math]} ... TeXGyre Pagella Math
-\loadmath{[texgyreschola-math]} ... TeXGyre Schola Math
-\loadmath{[texgyredejavu-math]} ... TeXGyre DeJaVu Math
-\loadmath{[LibertinusMath-Regular]} ... Libertinus Math
-\loadmath{[FiraMath-Regular]} ... Fira Math
-\loadmath{[Asana-Math]} ... Asana Math
-\loadmath{[KpMath-Regular]} ... KP fonts Math
+\resetmathchars \xits \stareq \triangleq \veeeq \wedgeq ;
\endtt
+%
+sets the characters `\stareq`, `\triangleq`, `\veeeq`, `\wedgeq` from
+the `\xits` additional font. You can see all possible sequences by
+`\input print-unimath.opm`.
+If you want to use whole math alphabet from additional math font, use
+`\addto\selector{\fam\famname}`, for example `\addto\cal{\fam\xits}`
+declares all `\cal` characters from the `\xits` font loaded by
+\^`\addUmathfont`.
+
\secc Unicode-math macros preloaded in the format
@@ -259,6 +329,8 @@ the section~\ref[math-macros].
\_endinput
+2022-07-22 \Umathspaceafterscript setting added.
+2022-06-10 \addUmathfont and \resetmathchars added.
2021-08-16 \_loadumathfamily simplified, used mathsize= font feature.
2021-08-16 nomathparam font feature used for families > 3 (bug fixed).
2021-08-02 ssty fontfeatures rewritten; fam2, fam3 unused, \scriptspace not set
diff --git a/macros/optex/base/more-macros.opm b/macros/optex/base/more-macros.opm
index 17e9bdd1e2..f256458184 100644
--- a/macros/optex/base/more-macros.opm
+++ b/macros/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 <2021-04-25>} % preloaded in format
+\_codedecl \eoldef {OpTeX useful macros <2022-05-24>} % preloaded in format
\_doc -----------------------------
We define \`\opinput` `{<file name>}` macro which
@@ -115,11 +115,11 @@
processor level using the negative `\romannumeral` trick.
\_cod -----------------------------
-\_def\_optdef#1[#2]{%
- \_def#1{\_opt={#2}\_isnextchar[{\_cs{_oA:\_string#1}}{\_cs{_oB:\_string#1}}}%
- \_sdef{_oA:\_string#1}[##1]{\_opt={##1}\_cs{_oB:\_string#1\_nospaceafter}}%
- \_sdef{_oB:\_string#1\_nospaceafter}%
-}
+\_def\_optdef#1[#2]{%
+ \_def#1{\_opt={#2}\_isnextchar[{\_cs{_oA:\_csstring#1}}{\_cs{_oB:\_csstring#1}}}%
+ \_sdef{_oA:\_csstring#1}[##1]{\_opt={##1}\_cs{_oB:\_csstring#1\_nospaceafter}}%
+ \_sdef{_oB:\_csstring#1\_nospaceafter}%
+}
\_def\_nospaceafter#1{\_ea#1\_romannumeral-`\.}
\_newtoks\_opt
@@ -278,6 +278,7 @@
\_endcode % -------------------------------------
+2022-05-24 \optdef: used \csstring instead \string, bug fixed.
2021-04-25 \normalcatcodes: typo fixed
2021-04-22 \the\_currctable replaced by \the\_catcodetable, bug fixed.
2020-05-22 robust \catcode newly defined in order \catcode\string.... be possible
diff --git a/macros/optex/base/optex.ini b/macros/optex/base/optex.ini
index ad6c1f408b..05e052f82b 100644
--- a/macros/optex/base/optex.ini
+++ b/macros/optex/base/optex.ini
@@ -21,7 +21,7 @@
% OpTeX version
-\def\optexversion{1.07 May 2022}
+\def\optexversion{1.08 Aug 2022}
\def\fmtname{OpTeX}
\let\fmtversion=\optexversion
diff --git a/macros/optex/base/parameters.opm b/macros/optex/base/parameters.opm
index 600fe66f15..499aee8d45 100644
--- a/macros/optex/base/parameters.opm
+++ b/macros/optex/base/parameters.opm
@@ -33,7 +33,7 @@
\_delimiterfactor=901 % parameter for scaling delimiters
\_delimitershortfall=5pt
\_nulldelimiterspace=1.2pt
-\_scriptspace=0.5pt
+%\_scriptspace=0.5pt % \Umathspaceafterscript used in \_setmathdimens, \_setunimathdimens instead
\_maxdepth=4pt
\_splitmaxdepth=\_maxdimen
\_boxmaxdepth=\_maxdimen
@@ -466,7 +466,7 @@
fonts at the beginning of your document. For example `\fontdef\rmfixed{\rm}`,
`\fontdef\itfixed{\it}`. Then use them in headline and footline:
\begtt
- \headline={\itfixed Text of headline, section: \fistmark \hss}
+ \headline={\itfixed Text of headline, section: \firstmark \hss}
\footline={\rmfixed \ifodd\pageno \hfill\fi \folio \hfil}
\endtt
\_cod -----------------------------
diff --git a/macros/optex/base/pdfuni-string.opm b/macros/optex/base/pdfuni-string.opm
index 25781ddfb4..89a479895a 100644
--- a/macros/optex/base/pdfuni-string.opm
+++ b/macros/optex/base/pdfuni-string.opm
@@ -23,7 +23,10 @@
\egroup
\_doc -----------------------------
- \`\pdfunidef``\macro{<text>}` does more things than only converting to hexadecimal PDF string.
+ \`\pdfunidef``\macro{<text>}` defines `\macro` as <text> converted to
+ 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`
reads the <text> in verbatim mode). First `\edef` do
`\_scantextokens\unexpanded` and second `\edef` expands the parameter
@@ -86,7 +89,7 @@
}
\_doc -----------------------------
- The \^`\regmacro` is used in order to sed the values of macros
+ The \^`\regmacro` is used in order to set the values of macros
`\em`, `\rm`, `\bf`, `\it`, `\bi`, `\tt`, `\/` and `~` to values usable in
PDF outlines.
\_cod -----------------------------
diff --git a/macros/optex/base/print-unimath.opm b/macros/optex/base/print-unimath.opm
index 2b1a07f30a..4ae761be25 100644
--- a/macros/optex/base/print-unimath.opm
+++ b/macros/optex/base/print-unimath.opm
@@ -2,6 +2,9 @@
\_codedecl \_undefined {Printing Unicode-math table \string<2020-06-08>}
+\_ifx\_ncharrmA\_undefined \_opwarning{No Unicode math font loaded, printing ignored}
+ \_endinput \_fi
+
\_begingroup
\_def\UnicodeMathSymbol#1#2#3#4{%
\_ifnum#1>"10000 \_endinput \_else \_printmathsymbol{#1}{#2}{#3}{#4}\_fi
diff --git a/macros/optex/base/sections.opm b/macros/optex/base/sections.opm
index 25d31cabaa..9ff2c2d436 100644
--- a/macros/optex/base/sections.opm
+++ b/macros/optex/base/sections.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \chap {Titles, chapters, sections, subsections <2021-03-03>} % preloaded in format
+\_codedecl \chap {Titles, chapters, sections, subsections <2022-08-02>} % preloaded in format
\_doc ---------------------------
We are using scaled fonts for titles
@@ -69,7 +69,7 @@
\enditems
\_cod ---------------------------
-\_def\_printchap #1{\_vfill\_supereject
+\_def\_printchap #1{\_vfill\_supereject \_prevdepth=0pt
\_vglue\_medskipamount % shifted by topkip+\medskipamount
{\_chapfont \_noindent \_mtext{chap} \_printrefnum[@]\_par
\_nobreak\_smallskip
@@ -78,13 +78,13 @@
\_firstnoindent
}
\_def\_printsec#1{\_par
- \_abovetitle{\_penalty-400}\_bigskip
+ \_abovetitle{\_penalty-151}\_bigskip
{\_secfont \_noindent \_raggedright \_printrefnum[@\_quad]#1\_nbpar}\_insertmark{#1}%
\_nobreak \_belowtitle{\_medskip}%
\_firstnoindent
}
\_def\_printsecc#1{\_par
- \_abovetitle{\_penalty-200}{\_medskip\_smallskip}
+ \_abovetitle{\_penalty-101}{\_medskip\_smallskip}
{\_seccfont \_noindent \_raggedright \_printrefnum[@\_quad]#1\_nbpar}%
\_nobreak \_belowtitle{\_medskip}%
\_firstnoindent
@@ -295,15 +295,17 @@
\_doc -----------------------------
\OpTeX/ sets `\headline={}` by default, so no running headings are printed.
- You can activate the running headings by following code, for example:
+ You can activate the running headings by following code, for example.
+ See also \ulink[https://github.com/olsak/OpTeX/issues/100]{issue 100}.
\begtt
- \addto\_chapx {\_edef\_runningchap {\_thechapnum: \_unexpanded\_ea{\_savedtitle}}}
+ \addto\_chapx {\globaldefs=0 \vfil\break % headline of previous chapter is printed
+ \xdef\_runningchap {\_thechapnum: \unexpanded\_ea{\_savedtitle}}}
\def \formathead #1#2{\isempty{#1}\iffalse #1: #2\fi}
\headline = {%
\ifodd \pageno
\hfil \ea\formathead\firstmark{}{}%
\else
- Chapter: \runningchap \hfil
+ \ifx\_runningchap\_undefined \else Chapter \_runningchap \fi \hfil
\fi
}
\endtt
@@ -459,6 +461,8 @@
\_endcode % -------------------------------------
+2022-08-02 Penalties in \_printsec, \_printsecc changed
+2022-07-11 \_printchap: \_prevdepth=0pt added, see issue 100
2021-03-03 \_captionsep introduced, \_othe used in \_thetnum, \_thefnum.
2021-02-09 \thisoutline implemented
2021-01-26 \_nl: \unskip added
diff --git a/macros/optex/base/unimath-codes.opm b/macros/optex/base/unimath-codes.opm
index ec0067890e..229ea4575d 100644
--- a/macros/optex/base/unimath-codes.opm
+++ b/macros/optex/base/unimath-codes.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_ncharrmA {Uni math codes <2022-02-22>} % preloaded on demand by \loadmath
+\_codedecl \_ncharrmA {Uni math codes <2022-07-20>} % preloaded on demand by \loadmath
\_doc -----------------------------
The control sequences for `\alpha`, `\beta` etc are redefined here.
@@ -212,6 +212,8 @@
\_Umathcode "03A2 = 7 1 "03F4 % \varTheta
+\_Umathcode `© = 0 1 `© % usage $\copyright$ can be seen in old documents
+
\_protected\_def \_sqrt {\_Uradical 1 "0221A }
\_protected\_def \_cuberoot {\_Uradical 1 "0221B }
\_protected\_def \_fourthroot {\_Uradical 1 "0221C }
@@ -449,6 +451,7 @@ for technical details about Unicode-math.
\_endinput
History:
+2022-07-20 \Umathcode for copyright declared
2022-02-22 \rm, \bf etc. moved to font-select, \_marm, \_mabf etc. introduced
2022-02-08 several wide math accents added
2022-01-06 \varTheta corrected
diff --git a/macros/optex/doc/optex-doc.pdf b/macros/optex/doc/optex-doc.pdf
index 3539a3fdfe..bf9f70a326 100644
--- a/macros/optex/doc/optex-doc.pdf
+++ b/macros/optex/doc/optex-doc.pdf
Binary files differ
diff --git a/macros/optex/doc/optex-doc.tex b/macros/optex/doc/optex-doc.tex
index 72a21336c1..785a181b1d 100644
--- a/macros/optex/doc/optex-doc.tex
+++ b/macros/optex/doc/optex-doc.tex
@@ -21,7 +21,7 @@
\tit Format Based on Plain \TeX/ and OPmac\fnotemark1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\hfill Version 1.07
+\hfill Version 1.08
\centerline{\it Petr Olšák, 2020, 2021, 2022}
diff --git a/macros/optex/doc/optex-math.tex b/macros/optex/doc/optex-math.tex
index 030a919dbf..ab127ea762 100644
--- a/macros/optex/doc/optex-math.tex
+++ b/macros/optex/doc/optex-math.tex
@@ -205,7 +205,10 @@ Ord atoms are printed without spaces between them. The spaces are not
cumulated, so the rule about spaces mentioned above is only a rough idea.
The exact rule for horizontal spaces is given for each pairs of atoms
in the table here. The symbol 0 means no space, 1 thin space, 2 medium space,
-and 3 means thick space.
+and 3 means thick space.\fnote
+{The table presented here is built into \TeX. On the other hand,
+\LuaTeX/ allows to set arbitrary spaces between arbitrary pairs,
+see section 7.5.2 in the \LuaTeX/ manual.}
\hangindent=-8.7cm \hangafter-2
The Bin atom is automatically transformed to the
@@ -714,7 +717,7 @@ previous listing of math alphabets and sets as default:
Moreover, it defines the alphabet selectors at user level (see section 1.3.3
of the \OpTeX/ manual). For example
\begtt \typosize[10/12]
-\_def\_marm {\_inmath{\_rmavariables \_rmdigits}} % \_mamrm is used in \rm
+\_def\_marm {\_inmath{\_rmavariables \_rmdigits}} % \_marm is used in \rm
\endtt
%
`\_inmath` runs its parameter only in math mode and sets the math alphabets.
@@ -750,9 +753,7 @@ And the result from `\input print-unimath.opm` looks like the following ten
pages.
Unsupported characters can be replaced by characters from other Unicode math
-font, see
-\ulink[http://petr.olsak.net/optex/optex-tricks.html\#addumathfont]{OpTeX trick 0030}
-or section~\ref[newfam].
+font, see section~\ref[newfam].
\label[listA]\wlabel{}
@@ -984,7 +985,7 @@ and `$1+2+\unicodecdots + n$`. You get $1,2,\unicodeellipsis, n$ and
$1+2+\unicodecdots + n$. If you feel that this is better, then you can set:
`\let\dots=\unicodeellipsis \let\cdots=\unicodecdots`.
-The Unicode fonts includes compact variants `\unicodevdots` $\unicodevdots$,
+The Unicode fonts include compact variants `\unicodevdots` $\unicodevdots$,
`\unicodeddots` $\unicodeddots$ and `\unicodeadots` $\unicodeadots$ too.
@@ -1574,17 +1575,28 @@ used). So, the default `\_boldmath` macro defined by \OpTeX/ looks like:
\let\_boldmath=\_boldunimath % this is done when Unicode math is initialized
\endtt
-\secc[newfam] Example of using additional math font
-
-The font `bbold10.tfm` includes double stroked characters, for example,
-double stroked plus, double stroked Greek letters and digits.
-Try to run `pdftex testfont`, then answer the question about the name of the
-font: `bbold10` and then type command `\table\end`. The `testfont.pdf` is
-printed with the table of characters of this font.
-Most of these characters cannot be found in Unicode math fonts.
+\secc[newfam] Using additional math fonts
\new \OpTeX/
-We show an example of how to add this font to the collection of used math fonts.
+The main Unicode math font is loaded by `\loadmath` and `\loadboldmath`
+(typically processed when `\fontfam[<family-name>]` is declared). Moreover,
+you can load {\em additional Unicode math fonts} and you can combine
+characters from main math font and these additional fonts. This can be
+usable if the main math font doesn't include all desired characters or you
+dislike some character shapes from main font. \OpTeX/ enables to load
+additional math fonts by `\addUmathfont` and characters from additional
+fonts can be declared by `\resetmathchars`. See the section 2.16 of \OpTeX/
+documentation for more details about this.
+
+The rest of this section includes an example which shows another task: how
+to combine main Unicode math font with old 8-bit math font `bbold10.tfm`.
+This font includes double stroked characters, for example, double stroked
+plus, double stroked Greek letters and digits. Try to run `pdftex testfont`,
+then answer the question about the name of the font: `bbold10` and then type
+command `\table\end`. The `testfont.pdf` is printed with the table of
+characters of this font. Most of these characters cannot be found in Unicode
+math fonts.
+
We can re-define the `\_normalmath` macro by:
\begtt \typosize[10/12]
\addto\_normalmath {\_loadmathfamily 5 bbold }
@@ -1660,10 +1672,6 @@ We have to settle for normal version of the font in the `\_boldmath` macro:
\addto \_boldmath {\_loadmathfamily 5 bbold }
\endtt
-Another approach of using more Unicode math fonts in a single formula is
-shown in
-\ulink[http://petr.olsak.net/optex/optex-tricks.html\#addumathfont]{OpTeX trick 0030}.
-
\sec Index
Control sequences listed at pages \pgref[listA]--\pgref[listB] are not
diff --git a/macros/optex/doc/optex-userdoc.tex b/macros/optex/doc/optex-userdoc.tex
index 92d2d970e9..23609f7bad 100644
--- a/macros/optex/doc/optex-userdoc.tex
+++ b/macros/optex/doc/optex-userdoc.tex
@@ -2018,6 +2018,27 @@ if you really need such feature.
The `\sec` macro is reserved for sections but original Plain \TeX/ declares this
control sequence for math secant\fnote{Use \code{$\\secant(x)$} to get $\secant(x)$.}.
+\sec Related documents
+
+\begitems
+* \ulink[http://petr.olsak.net/ftp/olsak/optex/optex-math.pdf]
+ {Typesetting math with \OpTeX} --
+ More details about math typesetting.
+* \ulink[http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf]
+ {\TeX/ in a Nutshell} --
+ Summary about \TeX/ principles, \TeX/ primitive commands etc.
+* \ulink[http://petr.olsak.net/ftp/olsak/optex/op-catalog.pdf]
+ {\OpTeX/ catalog} --
+ All fonts collected to `\fontfam` families are shown here.
+* \ulink[http://petr.olsak.net/ftp/olsak/optex/omls.pdf]
+ {OMLS} --
+ \OpTeX/ Markup Language Standard.
+* \ulink[http://petr.olsak.net/optex/optex-tricks.html]
+ {\OpTeX/ - tips, tricks, howto} --
+ Tips of macro codes for various purposes.
+
+\enditems
+
\enddocument