From 277c704145fc53d03e29c11ca1f20c6de294897e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 4 Aug 2022 20:34:18 +0000 Subject: optex (4aug22) git-svn-id: svn://tug.org/texlive/trunk@64050 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/optex/base/alloc.opm | 5 +- Master/texmf-dist/tex/optex/base/doc.opm | 48 +++-- Master/texmf-dist/tex/optex/base/f-montserrat.opm | 34 ++++ Master/texmf-dist/tex/optex/base/f-overlock.opm | 27 +++ Master/texmf-dist/tex/optex/base/f-stix.opm | 24 +++ Master/texmf-dist/tex/optex/base/f-stixtwo.opm | 28 +++ Master/texmf-dist/tex/optex/base/f-xits.opm | 25 +++ Master/texmf-dist/tex/optex/base/fams-ini.opm | 22 +++ Master/texmf-dist/tex/optex/base/fonts-catalog.opm | 4 +- Master/texmf-dist/tex/optex/base/if-macros.opm | 5 +- Master/texmf-dist/tex/optex/base/lang-data.opm | 78 ++++++-- Master/texmf-dist/tex/optex/base/lang-decl.opm | 2 + Master/texmf-dist/tex/optex/base/makeindex.opm | 214 +++++++++++++++------ Master/texmf-dist/tex/optex/base/math-preload.opm | 30 ++- Master/texmf-dist/tex/optex/base/math-unicode.opm | 106 ++++++++-- Master/texmf-dist/tex/optex/base/more-macros.opm | 13 +- Master/texmf-dist/tex/optex/base/optex.ini | 2 +- Master/texmf-dist/tex/optex/base/parameters.opm | 4 +- Master/texmf-dist/tex/optex/base/pdfuni-string.opm | 7 +- Master/texmf-dist/tex/optex/base/print-unimath.opm | 3 + Master/texmf-dist/tex/optex/base/sections.opm | 18 +- Master/texmf-dist/tex/optex/base/unimath-codes.opm | 5 +- 22 files changed, 571 insertions(+), 133 deletions(-) create mode 100644 Master/texmf-dist/tex/optex/base/f-montserrat.opm create mode 100644 Master/texmf-dist/tex/optex/base/f-overlock.opm create mode 100644 Master/texmf-dist/tex/optex/base/f-stix.opm create mode 100644 Master/texmf-dist/tex/optex/base/f-stixtwo.opm create mode 100644 Master/texmf-dist/tex/optex/base/f-xits.opm (limited to 'Master/texmf-dist/tex/optex/base') diff --git a/Master/texmf-dist/tex/optex/base/alloc.opm b/Master/texmf-dist/tex/optex/base/alloc.opm index 51bd2579623..ae77d3074e8 100644 --- a/Master/texmf-dist/tex/optex/base/alloc.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/doc.opm b/Master/texmf-dist/tex/optex/base/doc.opm index 82c6bde8c63..bde1dcc848f 100644 --- a/Master/texmf-dist/tex/optex/base/doc.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/f-montserrat.opm b/Master/texmf-dist/tex/optex/base/f-montserrat.opm new file mode 100644 index 00000000000..df570ac0344 --- /dev/null +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/f-overlock.opm b/Master/texmf-dist/tex/optex/base/f-overlock.opm new file mode 100644 index 00000000000..e20a32cfd0d --- /dev/null +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/f-stix.opm b/Master/texmf-dist/tex/optex/base/f-stix.opm new file mode 100644 index 00000000000..ab4d8b7e637 --- /dev/null +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/f-stixtwo.opm b/Master/texmf-dist/tex/optex/base/f-stixtwo.opm new file mode 100644 index 00000000000..629b57a7416 --- /dev/null +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/f-xits.opm b/Master/texmf-dist/tex/optex/base/f-xits.opm new file mode 100644 index 00000000000..eac2ee6b08c --- /dev/null +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/fams-ini.opm b/Master/texmf-dist/tex/optex/base/fams-ini.opm index ba334ef86aa..ad3ace24f3e 100644 --- a/Master/texmf-dist/tex/optex/base/fams-ini.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/fonts-catalog.opm b/Master/texmf-dist/tex/optex/base/fonts-catalog.opm index 6576e5fb116..cdd77359f12 100644 --- a/Master/texmf-dist/tex/optex/base/fonts-catalog.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/if-macros.opm b/Master/texmf-dist/tex/optex/base/if-macros.opm index cf28f3dccfa..8f6082a27a9 100644 --- a/Master/texmf-dist/tex/optex/base/if-macros.opm +++ b/Master/texmf-dist/tex/optex/base/if-macros.opm @@ -77,8 +77,9 @@ Note that `\foreach \do {}` is equivalent to `\foreach \do #1{}`. 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/Master/texmf-dist/tex/optex/base/lang-data.opm b/Master/texmf-dist/tex/optex/base/lang-data.opm index df6f43d90f1..6e11f8bd9a8 100644 --- a/Master/texmf-dist/tex/optex/base/lang-data.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/lang-decl.opm b/Master/texmf-dist/tex/optex/base/lang-decl.opm index 87a13b88ce8..3b9f9e727d2 100644 --- a/Master/texmf-dist/tex/optex/base/lang-decl.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/makeindex.opm b/Master/texmf-dist/tex/optex/base/makeindex.opm index e0e7d7ad6cc..ba503525591 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 <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``` implements these rules for the language - given by . The 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` (commas are ignored). The order of letters - in the `\_sortingdata` 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```. - 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``` 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```, 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```, \`\_ignoredchars``` + and \`\_compoundchars``` declare these rules. + The `` 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``` 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``` 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``` 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``` 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 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` `\,` converts `` 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}% \, -> + \_edef \_tmpb {\_ea\_ignoreit\_csstring #1}% \, -> \_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` `\, \,` returns the result of comparison @@ -160,7 +226,7 @@ comparison. \nl The macro - \`\_testAleB` `&\_relax\_relax \,\,`\nl + \`\_testAleB` `&\_relax&\_relax \,\,`\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` `\, \,` 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` + `0\_relax1\_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/Master/texmf-dist/tex/optex/base/math-preload.opm b/Master/texmf-dist/tex/optex/base/math-preload.opm index fde73e7e657..9f73ef24d12 100644 --- a/Master/texmf-dist/tex/optex/base/math-preload.opm +++ b/Master/texmf-dist/tex/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 ----------------------------- @@ -170,17 +168,37 @@ \_public \setmathsizes \ptunit \ptmunit ; + \_doc ----------------------------- + \`\_setmathparam`` {}` sets + (like `\Umathspaceafterscript`) to values dependent + on `1em` of textfont, scriptfont, scriptscriptfont. The 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/Master/texmf-dist/tex/optex/base/math-unicode.opm b/Master/texmf-dist/tex/optex/base/math-unicode.opm index a092d081c27..22db1d095e1 100644 --- a/Master/texmf-dist/tex/optex/base/math-unicode.opm +++ b/Master/texmf-dist/tex/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` `{}` 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 @@ `\+1`, `\+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 `-` clause includes normal letters like `A-Z`. + The `-` clause includes characters like~`A-Z`. \nl \`\_umahrangegreek` `\` is the same as `\_umathrange {-}\`. @@ -203,6 +204,53 @@ \_ea\_greekdef \_fi } + \_doc ----------------------------- + \`\addUmathfont` ` {[]}{} {[]}{} {}` + allocates new 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` ` ;` + saves to \`\_mafam` and applies \`\_resetmathcharsX` + to each sequence from . + 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 + \Umathcode + \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 `` 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 {[]}{} {[]}{} {} +\endtt +The `\famname` is a control sequence declared by \^`\addUmathfont` for later +use. It gets math family number. The `` is decimal number for size +corrections in view of the main math font. If it is empty then =1. +If is empty, the \"faked bold" derived from 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 ;`. 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/Master/texmf-dist/tex/optex/base/more-macros.opm b/Master/texmf-dist/tex/optex/base/more-macros.opm index 17e9bdd1e21..f2564581840 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 <2021-04-25>} % preloaded in format +\_codedecl \eoldef {OpTeX useful macros <2022-05-24>} % preloaded in format \_doc ----------------------------- We define \`\opinput` `{}` 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/Master/texmf-dist/tex/optex/base/optex.ini b/Master/texmf-dist/tex/optex/base/optex.ini index ad6c1f408b1..05e052f82b1 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.07 May 2022} +\def\optexversion{1.08 Aug 2022} \def\fmtname{OpTeX} \let\fmtversion=\optexversion diff --git a/Master/texmf-dist/tex/optex/base/parameters.opm b/Master/texmf-dist/tex/optex/base/parameters.opm index 600fe66f152..499aee8d45c 100644 --- a/Master/texmf-dist/tex/optex/base/parameters.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/pdfuni-string.opm b/Master/texmf-dist/tex/optex/base/pdfuni-string.opm index 25781ddfb4f..89a479895ae 100644 --- a/Master/texmf-dist/tex/optex/base/pdfuni-string.opm +++ b/Master/texmf-dist/tex/optex/base/pdfuni-string.opm @@ -23,7 +23,10 @@ \egroup \_doc ----------------------------- - \`\pdfunidef``\macro{}` does more things than only converting to hexadecimal PDF string. + \`\pdfunidef``\macro{}` defines `\macro` as 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 can be scanned in verbatim mode (it is true becuase \^`\_Xtoc` reads the 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/Master/texmf-dist/tex/optex/base/print-unimath.opm b/Master/texmf-dist/tex/optex/base/print-unimath.opm index 2b1a07f30ab..4ae761be25a 100644 --- a/Master/texmf-dist/tex/optex/base/print-unimath.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/sections.opm b/Master/texmf-dist/tex/optex/base/sections.opm index 25d31cabaa2..9ff2c2d4367 100644 --- a/Master/texmf-dist/tex/optex/base/sections.opm +++ b/Master/texmf-dist/tex/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/Master/texmf-dist/tex/optex/base/unimath-codes.opm b/Master/texmf-dist/tex/optex/base/unimath-codes.opm index ec0067890e4..229ea4575d5 100644 --- a/Master/texmf-dist/tex/optex/base/unimath-codes.opm +++ b/Master/texmf-dist/tex/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 -- cgit v1.2.3