From a4c1d1a1e418ee73c93150594d94bb80c5455ec8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 14 Feb 2024 21:31:38 +0000 Subject: optex (14feb24) git-svn-id: svn://tug.org/texlive/trunk@69861 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/optex/base/README | 5 + Master/texmf-dist/doc/optex/base/optex-doc.pdf | Bin 1585608 -> 1907216 bytes Master/texmf-dist/doc/optex/base/optex-doc.tex | 29 +- Master/texmf-dist/doc/optex/base/optex-techdoc.tex | 1 + Master/texmf-dist/doc/optex/base/optex-userdoc.tex | 18 +- Master/texmf-dist/doc/optex/base/primitives.tex | 387 +++++++++++++++++++++ Master/texmf-dist/tex/optex/base/alloc.opm | 13 +- Master/texmf-dist/tex/optex/base/doc.opm | 10 +- Master/texmf-dist/tex/optex/base/f-fbb.opm | 26 ++ Master/texmf-dist/tex/optex/base/f-gentium.opm | 26 ++ Master/texmf-dist/tex/optex/base/fams-ini.opm | 10 + Master/texmf-dist/tex/optex/base/fonts-opmac.opm | 9 +- Master/texmf-dist/tex/optex/base/fonts-preload.opm | 6 +- Master/texmf-dist/tex/optex/base/fonts-resize.opm | 5 +- Master/texmf-dist/tex/optex/base/hyperlinks.opm | 7 +- Master/texmf-dist/tex/optex/base/if-macros.opm | 7 +- Master/texmf-dist/tex/optex/base/keyval.opm | 25 +- Master/texmf-dist/tex/optex/base/logos.opm | 17 +- Master/texmf-dist/tex/optex/base/margins.opm | 4 +- Master/texmf-dist/tex/optex/base/math-macros.opm | 5 +- Master/texmf-dist/tex/optex/base/more-macros.opm | 50 ++- Master/texmf-dist/tex/optex/base/optex-tricks.opm | 50 ++- Master/texmf-dist/tex/optex/base/optex.ini | 2 +- Master/texmf-dist/tex/optex/base/others.opm | 11 +- Master/texmf-dist/tex/optex/base/parameters.opm | 10 +- Master/texmf-dist/tex/optex/base/plain-macros.opm | 18 +- Master/texmf-dist/tex/optex/base/prefixed.opm | 6 +- Master/texmf-dist/tex/optex/base/sections.opm | 20 +- Master/texmf-dist/tex/optex/base/unimath-codes.opm | 5 +- .../texmf-dist/tex/optex/base/unimath-macros.opm | 4 +- Master/texmf-dist/tex/optex/demo/op-mathalign.tex | 2 +- Master/texmf-dist/tex/optex/pkg/mte.opm | 2 +- 32 files changed, 696 insertions(+), 94 deletions(-) create mode 100644 Master/texmf-dist/doc/optex/base/primitives.tex create mode 100644 Master/texmf-dist/tex/optex/base/f-fbb.opm create mode 100644 Master/texmf-dist/tex/optex/base/f-gentium.opm diff --git a/Master/texmf-dist/doc/optex/base/README b/Master/texmf-dist/doc/optex/base/README index 3dab8b68f15..aa84d46627b 100644 --- a/Master/texmf-dist/doc/optex/base/README +++ b/Master/texmf-dist/doc/optex/base/README @@ -22,6 +22,11 @@ doc/ ... PDF version of the OpTeX documentation and sources. History: +<1.14> Feb 2024: + More links in doc: TeX primitives linked to TeX in a Nutshell. + \trykv returns unexpanded value of the key=value pair. + \bracedparam reimplemented, improved. + \optdef can create an expandable macro. <1.13> Nov 2023: \usebib completely reimplemented, libranian package not needed from now. Selected OpTeX tricks are automatically loaded when a relevant macro is used. diff --git a/Master/texmf-dist/doc/optex/base/optex-doc.pdf b/Master/texmf-dist/doc/optex/base/optex-doc.pdf index aebe78c6343..731b1ab1795 100644 Binary files a/Master/texmf-dist/doc/optex/base/optex-doc.pdf and b/Master/texmf-dist/doc/optex/base/optex-doc.pdf differ diff --git a/Master/texmf-dist/doc/optex/base/optex-doc.tex b/Master/texmf-dist/doc/optex/base/optex-doc.tex index d780ceeeefb..eb0fcc56825 100644 --- a/Master/texmf-dist/doc/optex/base/optex-doc.tex +++ b/Master/texmf-dist/doc/optex/base/optex-doc.tex @@ -21,9 +21,9 @@ \tit Format Based on Plain \TeX/ and OPmac\fnotemark1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\hfill Version 1.13 +\hfill Version 1.14 -\centerline{\it Petr Olšák, 2020, 2021, 2022, 2023} +\centerline{\it Petr Olšák, 2020, 2021, 2022, 2023, 2024} \bigskip \centerline{\url{http://petr.olsak.net/optex}} @@ -65,7 +65,7 @@ The main goal of \OpTeX/ is: If you need to customize your document or you need to use something very specific, then you can copy relevant parts of \OpTeX/ macros into your macro file and do changes to these macros here. This is a significant difference from -\LaTeX/ or ConTeXt, which is an attempt to create a new user level with a +\LaTeX/ or \ConTeXt/, which is an attempt to create a new user level with a plenty of non-primitive parameters and syntax hiding \TeX/ internals. The macros from \OpTeX/ are simple and straightforward because they solve only what is explicitly needed, they do not create a new user level for @@ -113,13 +113,28 @@ document \ulink[http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf] \nonum\chap Index \noindent -There are all control sequences used in \OpTeX/ except \TeX/ primitives. -If you want to know something about \TeX/ primitives then you can use another index from -\ulink[http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf\#ref:index]{\TeX/ in a Nutshell}. +Control sequences declared by \OpTeX/ have page list here and they are +internal links to their main documentation point. \TeX/ primitives used by +\OpTeX/ have no page list here and they are external links to +\ulink[http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf]{\TeX/ in a Nutshell} +to the place where the primitive is briefly described. +%Only primitives used in \OpTeX/ macros are listed here. There are much more +%primitives implemented in \LuaTeX/, see +%\ulink[https://www.pragma-ade.com/general/manuals/luatex.pdf]{\LuaTeX/ manual}, +%section \"primitives". % active links directly to the main documentation point but not to the pages: -\def\_printii #1&{\noindent\hskip-\iindent \link[cs:#1]\Blue{\bslash #1} } +\def\_printii #1&{% + \noindent\hskip-\iindent + \ea\ifx \csname,#1\endcsname \empty % primitive + \_dest[cs:#1]% main documentation point for primitives is in the Index + \ulink[http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf\#cs:#1]{\bslash#1} + \ea\ea\ea\nopages + \else \link[cs:#1]\Blue{\bslash #1} % OpTeX macro + \fi +} \def\_pgprintA #1{#1} +\def\nopages#1&{*\_par} \begmulti 3 \tt \makeindex \endmulti \bye diff --git a/Master/texmf-dist/doc/optex/base/optex-techdoc.tex b/Master/texmf-dist/doc/optex/base/optex-techdoc.tex index 78156194047..894f2d8cd3f 100644 --- a/Master/texmf-dist/doc/optex/base/optex-techdoc.tex +++ b/Master/texmf-dist/doc/optex/base/optex-techdoc.tex @@ -5,6 +5,7 @@ % (three times) to create whole documentation including all references and the index. \load [doc.opm] +\input primitives \thisoutline {TECHNICAL DOCUMENTATION} diff --git a/Master/texmf-dist/doc/optex/base/optex-userdoc.tex b/Master/texmf-dist/doc/optex/base/optex-userdoc.tex index 61157b0d31d..c99e63c21d0 100644 --- a/Master/texmf-dist/doc/optex/base/optex-userdoc.tex +++ b/Master/texmf-dist/doc/optex/base/optex-userdoc.tex @@ -1896,7 +1896,7 @@ tests, if the current point is at odd page regardless of asynchronous processing \tpg[perpage]\t\incrpp. \t\thepp, \t\thepplast, \t\truepage\ does per-page counting of objects. -\tpg[keystrokes]\t\keystoke\ +\tpg[keystrokes]\t\keystroke\ prints given text in a keystroke-like frame. \tpg[longtable]\t\longtable\ @@ -1905,15 +1905,21 @@ alows to break a table to more pages and repeates header. \tpg[lot]\t\makeLOF, \t\makeLOT, \t\captionF, \t\captionT\ create list of tables and list of figures similar to \^`\maketoc`. +\tpg[onlyifnew]\t\onlyifnew\ +only define a macro if it is not already defined. + +\tpg[pgforeground]\t\pgforeground\ +adds material to the foreground of each page. + \tpg[linnum]\t\pstart, \t\pend\ dispalys line numbers of the marked text in the margin. -\tpg[shadedframe]\t\shadedframe\ -colored rectangular frames with simple shadows. - \tpg[roundframe]\t\roundframe\ colored frames with rounded corners and many options. +\tpg[shadedframe]\t\shadedframe\ +colored rectangular frames with simple shadows. + \tpg[scaleto]\t\scaleto, \t\scaletof\ text font size changed to the desired width. @@ -2072,8 +2078,8 @@ documentation. Example: \~`\isinlist\list{}\iftrue` does `\iftrue` if is in `\list`.\nl \^`\isnextchar`` {}{}` performs if next character is , else .\nl -\~`\kv` `{}` expands to value when key-value parameters are used. - See also \~`\iskv`, \~`\readkv`, \~`\kvx`, \~`\nokvx`.\nl +\~`\kv` `{}` expands to a value given by key=value. + See also \~`\trykv`, \~`\iskv`, \~`\readkv`, \~`\kvx`, \~`\nokvx`.\nl \^`\loop` `...` \^`\repeat` is classical Plain \TeX/ loop.\nl \^`\mathstyles`` {}` enables to create macros dependent on current math style.\nl \~`\_namespace`` {}` declares name space used by package writers.\nl diff --git a/Master/texmf-dist/doc/optex/base/primitives.tex b/Master/texmf-dist/doc/optex/base/primitives.tex new file mode 100644 index 00000000000..11ced8bca16 --- /dev/null +++ b/Master/texmf-dist/doc/optex/base/primitives.tex @@ -0,0 +1,387 @@ +%% This is part of the OpTeX project, see http://petr.olsak.net/optex + +% There is a list of TeX primitives used by OpTeX, they are printed in the Index. + +\def\addprimitive#1{\_ea\addprimitiveA \_csname,\_csstring#1\_endcsname} +\def\addprimitiveA#1{\ifx#1\relax\_addto\_iilist#1\fi \_gdef#1{}} +\def\_intlink{\_link[cs:\_tmpa]{\choosecolor}{\_csstring\\\_tmpb}} +\def\choosecolor{\_ea\ifx\csname,\_tmpa\endcsname\empty \primcolor\else\ulinkcolor\fi} +\def\primcolor{\setcmykcolor{.7 0 .7 .5}} + +\xargs\addprimitive +%\above +\abovedisplayshortskip +\abovedisplayskip +%\abovewithdelims +\accent +\adjdemerits +\advance +\afterassignment +\aftergroup +\atop +\atopwithdelims +\attributedef +\baselineskip +%\batchmode +\begingroup +\belowdisplayshortskip +\belowdisplayskip +\binoppenalty +%\botmark +\box +\boxmaxdepth +\breakafterdirmode +\brokenpenalty +%\catcode +\catcodetable +\char +\chardef +\cleaders +\closein +\closeout +\clubpenalty +\copy +\countdef +\cr +\crampeddisplaystyle +\crampedscriptstyle +\crampedscriptscriptstyle +\crampedtextstyle +\crcr +\csname +\csstring +\day +\def +\defaulthyphenchar +\defaultskewchar +\delcode +\delimiter +\delimiterfactor +\delimitershortfall +\detokenize +\dimen +\dimendef +\dimexpr +\directlua +\discretionary +%\displaylimits +\displaystyle +\displaywidowpenalty +\displaywidth +\divide +\doublehyphendemerits +\dump +\edef +%\efcode +\else +\emergencystretch +\end +\endcsname +\endgroup +\endinput +\endlinechar +\eqno +\errmessage +\errorcontextlines +%\errorstopmode +\escapechar +\everycr +\everydisplay +\everyeof +%\everyhbox +\everyjob +\everymath +\everypar +%\everyvbox +\exhyphenpenalty +\expandafter +\expanded +\fi +\finalhyphendemerits +\firstmark +\floatingpenalty +\font +\fontdimen +\fontname +\futurelet +\gdef +\glet +\global +\globaldefs +\halign +\hangafter +\hangindent +\hbadness +\hbox +\hfil +\hfill +%\hfilneg +\hfuzz +\hoffset +\hrule +\hsize +\hskip +\hss +\hyphenation +\hyphenchar +\hyphenpenalty +\if +\ifcase +\ifcat +\ifcsname +\ifdim +\ifeof +\iffalse +%\ifhbox +\ifhmode +\ifinner +\ifmmode +\ifnum +\ifodd +\iftrue +%\ifvbox +\ifvmode +\ifvoid +\ifx +\ignorespaces +\immediate +\immediateassigned +\immediateassignment +\indent +\input +\inputlineno +\interlinepenalty +\jobname +\kern +%\knaccode +%\knbccode +%\knbscode +\language +\lastbox +\lastnamedcs +\lastpenalty +\lastskip +\lccode +\leaders +\left +\lefthyphenmin +\leftskip +\leqno +\let +%\letterspacefont +\limits +\linepenalty +\lineskip +\lineskiplimit +\long +%\looseness +\lower +\lowercase +%\lpcode +\luaescapestring +\mag +\mark +\mathaccent +\mathbin +\mathchar +\mathchardef +\mathchoice +\mathclose +\mathcode +\matheqdirmode +\mathop +\mathopen +\mathord +\mathpunct +\mathrel +\mathsurround +\maxdepth +\meaning +\medmuskip +\message +\middle +\mkern +\month +\moveleft +\moveright +\mskip +\multiply +\muskip +\muskipdef +\newlinechar +\noalign +\noexpand +\noindent +\nolimits +\nonscript +%\nonstopmode +\nulldelimiterspace +\nullfont +\number +\numexpr +\omit +\openin +\openout +\outer +\output +\outputmode +\outputpenalty +\over +\overfullrule +%\overwithdelims +\par +\parfillskip +\parindent +%\parshape +\parskip +\patterns +%\pdfadjustinterwordglue +%\pdfadjustspacing +\pdfcatalog +%\pdfcolorstack +\pdfdest +\pdfendlink +\pdfextension +\pdffeedback +%\pdffontexpand +\pdfhorigin +\pdfinfo +\pdflastximage +\pdflastxpos +\pdflastypos +\pdfliteral +%\pdfnormaldeviate +\pdfoutline +\pdfpageheight +\pdfpagewidth +%\pdfprotrudechars +\pdfrefximage +\pdfrestore +\pdfsave +\pdfsavepos +\pdfsetmatrix +%\pdfsetrandomseed +\pdfstartlink +%\pdfstrcmp +%\pdfuniformdeviate +\pdfvariable +\pdfvorigin +\pdfximage +\penalty +\postdisplaypenalty +\predisplaypenalty +\pretolerance +\prevdepth +\prevgraph +\protected +\protrudechars +\radical +\raise +\read +\relax +\relpenalty +\right +\righthyphenmin +\rightskip +\romannumeral +\root +%\rpcode +\savecatcodetable +\scantextokens +\scantokens +\scriptfont +\scriptscriptfont +\scriptscriptstyle +\scriptstyle +%\scrollmode +\setbox +\sfcode +%\shbscode +\shipout +\show +\showbox +\showboxbreadth +\showboxdepth +\showlists +\showthe +\skewchar +\skip +\skipdef +\spacefactor +\spaceskip +\span +%\special +\splitmaxdepth +\splittopskip +\sqrt +%\stbscode +\string +\suppressfontnotfounderror +\tabskip +\textfont +\textstyle +\the +\thickmuskip +\thinmuskip +\time +\toks +\toksdef +\tolerance +%\topmark +\topskip +\tracingassigns +\tracingcommands +\tracinggroups +\tracingifs +\tracinglostchars +\tracingmacros +\tracingonline +\tracingoutput +\tracingpages +\tracingparagraphs +\tracingrestores +\tracingscantokens +\tracingstats +\uccode +\Uchar +\uchyph +\Udelcode +\Udelimiter +\Umathaccent +\Umathchar +\Umathchardef +\Umathcode +\unexpanded +\unhbox +\unhcopy +\unless +\unpenalty +\unskip +\unvbox +\unvcopy +\uppercase +\Uradical +\vadjust +\valign +\vbadness +\vbox +\vcenter +\vfil +\vfill +\vfilneg +\vfuzz +\voffset +\vrule +\vsize +\vskip +\vsplit +\vss +\vtop +\wd +\widowpenalty +\write +\xdef +%\xleaders +\xspaceskip +\year +; diff --git a/Master/texmf-dist/tex/optex/base/alloc.opm b/Master/texmf-dist/tex/optex/base/alloc.opm index fae88d286ed..180adddeff4 100644 --- a/Master/texmf-dist/tex/optex/base/alloc.opm +++ b/Master/texmf-dist/tex/optex/base/alloc.opm @@ -120,19 +120,18 @@ \_newdimen \tmpdim \_newdimen \_tmpdim \_doc ----------------------------- - A few registers are initialized like in plain\TeX/. We absolutely + A few registers: \`\maxdimen`, \`\hideskip` and + \`\centering` are initialized like in plain\TeX/. We absolutely don't support the `@`category dance, so `\z@skip` - `\z@`, `\p@` etc. are defined but not recommended in \OpTeX/. - - The \`\_zo` and \`\_zoskip` (equivalents to `\z@` and `\z@skip`) - are declared here and used in some internal macros of \OpTeX/ - for improving speed. + `\z@`, `\p@` etc. are defined but not recommended. + The \`\_zo`, \`\_zoskip` and \`\voidbox` (equivalents to + `\z@`, `\z@skip` and `\voidb@x`) are preferred in \OpTeX. \_cod ----------------------------- \_newdimen\_maxdimen \_maxdimen=16383.99999pt % the largest legal -\_newdimen\_zo \_zo=0pt \_newskip\_hideskip \_hideskip=-1000pt plus 1fill % negative but can grow \_newskip\_centering \_centering=0pt plus 1000pt minus 1000pt +\_newdimen\_zo \_zo=0pt \_newskip\_zoskip \_zoskip=0pt plus0pt minus0pt \_newbox\_voidbox % permanently void box register diff --git a/Master/texmf-dist/tex/optex/base/doc.opm b/Master/texmf-dist/tex/optex/base/doc.opm index fb96d35007e..c334019de29 100644 --- a/Master/texmf-dist/tex/optex/base/doc.opm +++ b/Master/texmf-dist/tex/optex/base/doc.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \printdoc {Macros for documentation printing <2022-12-11>} % loaded on demand by \load[doc] +\_codedecl \printdoc {Macros for documentation printing <2023-12-10>} % loaded on demand by \load[doc] \_doc ----------------------------- General decalarations. @@ -41,8 +41,6 @@ \_doc ----------------------------- The listing mode is implemented here. The \`\maxlines` is maximal lines of code printed in the listing mode. - The \code{\\catcode`\\.=11} sets dot as letter in listngs (for package - documentation where `\.foo` sequeces exist). \_cod ----------------------------- \_newcount \_maxlines \_maxlines=100000 @@ -54,7 +52,7 @@ \_typosize[8/10] \_let\_printverbline=\_printcodeline \_ttline=\_inputlineno - \_setverb \_catcode`\.=11 + \_setverb \_ifnum\_ttline<0 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi \_adef{ }{\ }\_adef\^^I{\t}\_parindent=\_ttindent \_parskip=0pt \_def\t{\_hskip \_dimexpr\_tabspaces em/2\_relax}% @@ -88,7 +86,8 @@ the first `_` or `.` is removed from `\_tmpa` and the test is repeated. \_cod ----------------------------- -\_def\_makecs{\_def\_tmpa{}\_futurelet\_next\_makecsA} +\_def\_makecs{\_def\_tmpa{}\_futurelet\_next\_makecsD} +\_def\_makecsD{\_if.\_next \_ea\_makecsB \_else \_ea\_makecsA \_fi} % \.foo is accepted \_def\_makecsA{\_ifcat a\_noexpand\_next \_ea\_makecsB \_else \_ea\_makecsF \_fi} \_def\_makecsB#1{\_addto\_tmpa{#1}\_futurelet\_next\_makecsA} \_def\_makecsF{\_let\_tmpb=\_tmpa @@ -363,6 +362,7 @@ have the same meaning: `\optexdoclink` in this example. And \endinput +2023-12-10 \catcode`.=11 removed, issue solved by \_makecsD. 2022-12-11 \_opwaning "Second main documentation point" introduced. 2022-12-11 \_docrefcodes added (bug due to 2022-11-13 fixed). 2022-11-21 magenta color for internal links instead green. diff --git a/Master/texmf-dist/tex/optex/base/f-fbb.opm b/Master/texmf-dist/tex/optex/base/f-fbb.opm new file mode 100644 index 00000000000..ac69a89a992 --- /dev/null +++ b/Master/texmf-dist/tex/optex/base/f-fbb.opm @@ -0,0 +1,26 @@ +%% This is part of the OpTeX project, see http://petr.olsak.net/optex + +\_famdecl [fbb] \FBembo {Bembo–like fonts derived from Cardo} + {\caps \swash} {\rm \bf \it \bi} {} + {[fbb-Regular]} + {\_def\_fontnamegen {[fbb-\_currV]:script=latn;\_capsV\_swaV\_fontfeatures}} + +\_wlog{\_detokenize{% +Modifier:^^J + \caps ...... caps & small caps + old digits^^J + \swash ..... alternative Q letter and some other characters^^J +}} + +\_moddef \resetmod {\_fsetV caps={},swa={} \_fvars Regular Bold Italic BoldItalic } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } +\_moddef \swash {\_fsetV swa=+swsh;+salt; } + +\_initfontfamily % new font family must be initialized + +\_endcode + +See historical notice in texdoc fbb. + +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-gentium.opm b/Master/texmf-dist/tex/optex/base/f-gentium.opm new file mode 100644 index 00000000000..e6775695c23 --- /dev/null +++ b/Master/texmf-dist/tex/optex/base/f-gentium.opm @@ -0,0 +1,26 @@ +%% This is part of the OpTeX project, see http://petr.olsak.net/optex + +\_famdecl [Gentium] \Gentium {Serif free fonts, support Greek, Cyrillic, IPA} + {\caps} {\rm \bf \it \bi} {Termes} + {[GentiumPlus-Regular]} + {\_def\_fontnamegen {[Gentium\_bkV Plus-\_currV]:\_capsV\_fontfeatures}} + +\_wlog{\_detokenize{% +Modifiers:^^J + \caps ...... caps & small caps^^J + \book ...... Book variants (a little bolder)^^J +}} + +\_moddef \resetmod {\_fsetV caps={} \_fsetV bk={} \_fvars Regular Bold Italic BoldItalic } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } +\_moddef \book {\_fsetV bk=Book } + +\_initfontfamily % new font family must be initialized + +\_loadmath {[texgyretermes-math]} + +\_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 6dc19ca9b1f..7d3f0332a83 100644 --- a/Master/texmf-dist/tex/optex/base/fams-ini.opm +++ b/Master/texmf-dist/tex/optex/base/fams-ini.opm @@ -107,6 +107,11 @@ \caps: {\rm\bf\it\bi} \caps\semibold: {\bf\bi} \caps\sans: {\rm\bf\it} -: {\mono\initials\displ\keybr} } +\_famfrom{Victor Gaultney} +\_faminfo [Gentium] {Serif free fonts, support Greek, Cyrrilic, IPA} {f-gentium} + { -,\caps,\book,\book\caps: {\rm\bf\it\bi} } +\_famalias [GentiumPro] + \_famfrom {Daniel Flipo} \_faminfo [KP fonts] {KP fonts -- Johannes Kepler project} {f-kpfonts} { -,\light,\sans,\mono, \caps, \caps\light, \caps\sans,\caps\mono,\swash: {\rm\bf\it\bi} } @@ -249,6 +254,11 @@ \_faminfo [GFSBodoni] {Based on Bodoni with greek letters} {f-gfsbodoni} { -: {\rm\bf\it\bi} \caps: {\rm} } +\_famfrom {David J. Perry, Michael Sharpe} +\_faminfo [fbb] {Bembo–like fonts derived from Cardo} {f-fbb} + { -,\caps: {\rm\bf\it\bi} \swash: {\rm} } +\_famalias [Bembo] \_famalias [FBembo] + \_famfrom {bBox Type GmbH, Carrois Corporate GbR, Edenspiekermann AG} \_faminfo [Fira] {Humanist sans-serif, originally designed for Firefox OS} {f-fira} { \thin,\light,\book,-,\medium,\mono,\mono\medium,% diff --git a/Master/texmf-dist/tex/optex/base/fonts-opmac.opm b/Master/texmf-dist/tex/optex/base/fonts-opmac.opm index 158f19299ea..ca4d38b4ce1 100644 --- a/Master/texmf-dist/tex/optex/base/fonts-opmac.opm +++ b/Master/texmf-dist/tex/optex/base/fonts-opmac.opm @@ -171,10 +171,12 @@ \_ea\_ifx \_the\_font \_tenbi \_additcorr \_bf \_else \_it \_aftergroup\_afteritcorr\_fi\_fi\_fi } -\_def\_additcorr{\_ifdim\_lastskip>\_zo - \_skip0=\_lastskip \_unskip\_italcorr \_hskip\_skip0 \_else\_italcorr \_fi} +\_def\_additcorr{\_ifhmode \_ifdim\_lastskip>\_zo + \_skip0=\_lastskip \_unskip \_additcorrA \_hskip\_skip0 \_else \_additcorrA \_fi\_fi} +\_def\_additcorrA{\_ifnum\_lastpenalty=\_zo \_italcorr \_else + \_ea\_unpenalty \_ea\_italcorr \_ea\_penalty \_the\_lastpenalty \_relax \_fi} \_def\_afteritcorr{\_futurelet\_next\_afteritcorrA} -\_def\_afteritcorrA{\_ifx\_next.\_else\_ifx\_next,\_else \_italcorr \_fi\_fi} +\_def\_afteritcorrA{\_ifhmode \_ifx\_next.\_else\_ifx\_next,\_else \_italcorr \_fi\_fi\_fi} \_let\_italcorr=\/ \_doc ----------------------------- @@ -218,6 +220,7 @@ \_endcode % ------------------------------------- History: +2024-01-25 \em: \_additcorr reimplemented to be more robust 2022-02-22 \_setmainvalues: only \rm initialized 2021-03-10 \boldify corrected 2021-03-09 \mfontsrule and \_setmathfonts introduced diff --git a/Master/texmf-dist/tex/optex/base/fonts-preload.opm b/Master/texmf-dist/tex/optex/base/fonts-preload.opm index 8562da786c6..82387970e68 100644 --- a/Master/texmf-dist/tex/optex/base/fonts-preload.opm +++ b/Master/texmf-dist/tex/optex/base/fonts-preload.opm @@ -24,14 +24,14 @@ \_endcode %--------------------------------------------------- The format in Lua\TeX/ can download only non-Unicode fonts. Latin Modern EC is -loaded here. These fonts are totally unusable in LuaTeX when languages with out +loaded here. These fonts are totally unusable in \LuaTeX/ when languages with out of ASCII or ISO-8859-1 alphabets are used (for example Czech). We load only a few 8bit fonts here especially for simple testing of the format. But, if the user needs to do more serious work, he/she can -use `\fontfam` macro to load a selected font family of Unicode fonts. +use \^`\fontfam` macro to load a selected font family of Unicode fonts. We have a dilemma: when the Unicode fonts cannot be preloaded in the format then the basic -font set can be loaded by `\everyjob`. But why to load a set of fonts at the +font set can be loaded by \^`\everyjob`. But why to load a set of fonts at the beginning of every job when it is highly likely that the user will load something completely different. Our decision is: there is a basic 8bit font set in the format (for testing purposes only) and the user should load diff --git a/Master/texmf-dist/tex/optex/base/fonts-resize.opm b/Master/texmf-dist/tex/optex/base/fonts-resize.opm index 323e1d72a0c..f4dd3c40339 100644 --- a/Master/texmf-dist/tex/optex/base/fonts-resize.opm +++ b/Master/texmf-dist/tex/optex/base/fonts-resize.opm @@ -5,7 +5,7 @@ \_doc ----------------------------- \`\initunifonts` macro extends \LuaTeX's font capabilities, in order to be able to load Unicode fonts. Unfortunately, this part of - \OpTeX/ depends on the `luaotfload` package, which adapts Con\TeX/t's generic + \OpTeX/ depends on the `luaotfload` package, which adapts \ConTeXt's generic font loader for plain \TeX/ and \LaTeX. `luaotfload` uses Lua functions from \LaTeX's `luatexbase` namespace, we provide our own replacements. \^`\initunifonts` sets itself to relax because we don't want to do @@ -62,7 +62,8 @@ The `\fontname` primitive returns the optionally followed by . The \`\xfontname` macro expands to without . We need to remove the part `at` from - `\fontname` output. The letters `at` have category 12. + `\fontname` output. The letters `at` have category 12 in the \`\_stringat` + macro. \_cod ----------------------------- \_edef\_stringat{\_string a\_string t} diff --git a/Master/texmf-dist/tex/optex/base/hyperlinks.opm b/Master/texmf-dist/tex/optex/base/hyperlinks.opm index 1d15b5e7341..7c3e78635aa 100644 --- a/Master/texmf-dist/tex/optex/base/hyperlinks.opm +++ b/Master/texmf-dist/tex/optex/base/hyperlinks.opm @@ -6,11 +6,12 @@ \`\dest``[:]` creates a destination of internal links. The destination is declared in the format `:`. If the \^`\hyperlinks` command in not used, then `\dest` does nothing else it is set to `\_destactive`. - The \`\_destactive` is implemented by `\_pdfdest` primitive. It creates a box + The \`\_destactive` is implemented by `\_pdfdest` primitive. It creates a + box using \`\_destbox``[:]` in which the destination is shifted by \`\_destheight`. The reason is that the destination is exactly at the top border of the PDF viewer but we want to see - the line where the destination is. The destination box is positioned by a - different way dependent on the current vertical or horizontal mode. + the line where the destination is. The destination box is positioned + differently dependent on the current vertical or horizontal mode. \_cod ---------------------------- \_def\_destheight{1.4em} diff --git a/Master/texmf-dist/tex/optex/base/if-macros.opm b/Master/texmf-dist/tex/optex/base/if-macros.opm index 415b2c01c88..eae011ae260 100644 --- a/Master/texmf-dist/tex/optex/base/if-macros.opm +++ b/Master/texmf-dist/tex/optex/base/if-macros.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \newif {Special if-macros, is-macros and loops <2023-10-17>} % preloaded in format +\_codedecl \newif {Special if-macros, is-macros and loops <2023-12-07>} % preloaded in format \_doc ---------------------------- \secc Classical \code{\\newif} @@ -95,8 +95,8 @@ \_immediateassignment \_long\_gdef\_fbody#2{\_testparam##1..\_iftrue #3\_ea\_fbody\_fi}% \_fbody #1#2\_finbody\_getforstack } -\_def\_testparam#1#2#3\_iftrue{\_ifx###1\_empty\_ea\_finbody\_else} -\_def\_finbody#1\_finbody{} +\_long\_def\_testparam#1#2#3\_iftrue{\_ifx###1\_empty\_ea\_finbody\_else} +\_long\_def\_finbody#1\_finbody{} \_long\_def\foreach #1\do#2#{\_isempty{#2}\_iftrue \_afterfi{\_foreachA{#1}{##1}}\_else\_afterfi{\_foreachA{#1}{#2}}\_fi} @@ -376,6 +376,7 @@ \_endcode +2023-12-07 \_testparam define \long (big fixed) 2023-10-17 \qcasesof introduced, \xcasesof reimplemented. 2023-01-16 \isnextchar created expandable. 2022-12-02 \xcasesof: its first parameter is \long too. diff --git a/Master/texmf-dist/tex/optex/base/keyval.opm b/Master/texmf-dist/tex/optex/base/keyval.opm index 68f3fea5369..645a3b33a56 100644 --- a/Master/texmf-dist/tex/optex/base/keyval.opm +++ b/Master/texmf-dist/tex/optex/base/keyval.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \readkv {Key-value dictionaries <2023-10-23>} % preloaded in format +\_codedecl \readkv {Key-value dictionaries <2023-11-24>} % preloaded in format \_doc ---------------------------- {\bf Implementation.}\nl @@ -12,8 +12,10 @@ after it.\nl The \`\kvx``{}{}` defines the `\_kvx::#1` macro and \`\nokvx``{}` defines the `\_nokvx::` macro.\nl - The \`\kv``{}` expands the `\_kv::` macro. If this macro isn't - defined then \`\_kvunknown` is processed. You can re-define it if you want.\nl + The \`\trykv``{}{}` + returns unexpanded value of if declared, else it runs .\nl + The \`\kv``{}` returns expanded value of if declared, + else returns expanded value of `.notdef` key else expands \`\_kvunknown`.\nl The \`\iskv``{}\iftrue` (or `\iffalse`) is the test, if the `` is defined in current . \_cod ---------------------------- @@ -28,12 +30,14 @@ {\_trycs{_nokvx:\_the\_kvdict}{\_ea\_ignoreit}{#1}\_ea\_ignoreit}{#2}} \_def\_kvx#1#2{\_sdef{_kvx:\_the\_kvdict:#1}##1{#2}} \_def\_nokvx#1{\_sdef{_nokvx:\_the\_kvdict}##1\_ea\_ignoreit##2{#1}} -\_def\_kv#1{\_trycs{\_kvcs#1}{\_kvunknown}} +\_def\_trykv#1{\_ea\_trykvA \_begincsname\_kvcs#1\_endcsname \_ignoreit} +\_def\_trykvA#1{\_ifx #1\_ignoreit \_ea\_useit\_else \_unexpanded\_ea{#1}\_fi} +\_def\_kv#1{\_expanded{\_trykv{#1}{\_trykv{.\_csstring\notdef}{\_kvunknown}}}} \_def\_iskv#1#2{#2\_else\_ea\_unless\_fi \_ifcsname\_kvcs#1\_endcsname} \_def\_kvcs{_kv:\_the\_kvdict:} \_def\_kvunknown{???} -\public \readkv \kvx \nokvx \kv \iskv ; +\public \readkv \kvx \nokvx \kv \trykv \iskv ; \_endcode @@ -75,7 +79,13 @@ register. First: we read default parameters by \^`\readkv\myframedefaults` and secondly the actual parameters are read by \^`\readkv{\the\opt}`. The last setting wins. Third: the values can be used by the expandable \^`\kv{}` macro. -The \^`\kv{}` returns `???` if such key is not declared. +The \^`\kv{}` returns `???` if such a isn't declared +but if `.notdef` key is declared then its value is returned in this case. + +The \^`\kv{}` macro fully expands the value of key. If you don't want to expand +the value, use \^`\trykv``{}{}`. It returns unexpanded value of if +declared else returns expanded . For example +`\edef\macro{\trykv{key}{}}` defines `\macro` as the unexpanded value of the `key`. You can use keys without values in the parameters list too. Then you can ask if the key is declared by \^`\iskv``{}\iftrue` @@ -114,7 +124,7 @@ for undeclared . Example: `\nokvx{\opwarning{Unknown option "#1"}}`. The default dictionary name (where key-value pairs are processed) is empty. You can use your specific dictionary by -\^`\kvdict``={}`. Then `\redakv`, `\kv`, `\iskv`, `\kvx` and `\nokvx` +\^`\kvdict``={}`. Then `\redakv`, `\kv`, `\trykv`, `\iskv`, `\kvx` and `\nokvx` macros use this named dictionary of / pairs. Package options can be processed when `\kvdict={pkg:}`, example is the `\mathset` macro in @@ -128,6 +138,7 @@ A more extensive example can be found in \_endinput +2023-11-24 \trykv introduced. 2023-10-23 minor changes in \readkv, empty key isn't processed. 2023-03-11 \nokvx: \fi bug (due to \afterfi in \trycs) fixed. 2023-01-13 \kvx parameter added, \nokvx introduced. diff --git a/Master/texmf-dist/tex/optex/base/logos.opm b/Master/texmf-dist/tex/optex/base/logos.opm index a510a74a304..1168c25b58f 100644 --- a/Master/texmf-dist/tex/optex/base/logos.opm +++ b/Master/texmf-dist/tex/optex/base/logos.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \TeX {Logos TeX, LuaTeX, etc. <2020-02-28>} % preloaded in format +\_codedecl \TeX {Logos TeX, LuaTeX, etc. <2024-02-12>} % preloaded in format \_doc ---------------------------- Despite plain \TeX/ each macro for logos ends by \`\ignoreslash`. @@ -20,6 +20,18 @@ \_public \TeX \OpTeX \LuaTeX \XeTeX \ignoreslash ; + \_doc ---------------------------- + The \`\ConTeXt` logo is implemented as in the \ConTeXt/ format itself. + The kerning between \"Con" and \"\TeX/t" is calculated by measuring the kerning + between the letters \"T" and \"e". + \_cod ---------------------------- + +\_protected\_def \_ConTeXt{\_begingroup + Con\_setbox0=\_hbox{T\_kern\_zo e}\_setbox1=\_hbox{Te}{\_kern\_dimexpr\_wd1 -\_wd0}% + \_TeX t\_endgroup\_ignoreslash} + +\_public \ConTeXt ; + \_doc ----------------------------- The \`\_slantcorr` macro expands to the slant-correction of the current font. It is used to shifting A if the \`\LaTeX` logo is in italic. @@ -53,9 +65,12 @@ \_def\TeX{TeX\_ignslash}\_def\OpTeX{OpTeX\_ignslash}% \_def\LuaTeX{LuaTeX\_ignslash}\_def\XeTeX{XeTeX\_ignslash}% \_def\LaTeX{LaTeX\_ignslash}\_def\OPmac{OPmac\_ignslash}% + \_def\ConTeXt{ConTeXt\_ignslash}% \_def\CS{CS}\_def\csplain{csplain\_ignslash}% } \_public \ignslash ; \_endcode +2024-02-12 ConTeXt logo added. +2020-02-28 Released. diff --git a/Master/texmf-dist/tex/optex/base/margins.opm b/Master/texmf-dist/tex/optex/base/margins.opm index 0f544fc5dd6..c77926f9ad1 100644 --- a/Master/texmf-dist/tex/optex/base/margins.opm +++ b/Master/texmf-dist/tex/optex/base/margins.opm @@ -64,7 +64,9 @@ \_doc ---------------------------- \`\magscale` `[]` does `\mag=` and recalculates page - dimensions to their true values. + dimensions to their true values.\nl + \`\_truedimen``` retunrs true value of + regardless of `\mag`. \_cod ---------------------------- \_def\_trueunit{} diff --git a/Master/texmf-dist/tex/optex/base/math-macros.opm b/Master/texmf-dist/tex/optex/base/math-macros.opm index 00adc9f1aaf..fa4317f25ae 100644 --- a/Master/texmf-dist/tex/optex/base/math-macros.opm +++ b/Master/texmf-dist/tex/optex/base/math-macros.opm @@ -347,7 +347,10 @@ names from plain\TeX/ with `@` character are re-written in a more readable form.\nl \`\sp` is an alternative for `^`. The \`\sb` alternative for `_` was defined - at line 27 of the file `math-macros.opm`. + at line 27 of the file `math-macros.opm`.\nl + \`\_thinsk`, \`\_medsk`, \`\_thicksk` and \`\_thinneg` should be used + instead `\,`, `\>`, `\;` and `\!` in macros because a user can re-define + these single-letter sequences. \_cod ----------------------------- \_let\_sp=^ \public \sp ; diff --git a/Master/texmf-dist/tex/optex/base/more-macros.opm b/Master/texmf-dist/tex/optex/base/more-macros.opm index 8c622432340..3f4916a9c3d 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 <2023-01-18>} % preloaded in format +\_codedecl \eoldef {OpTeX useful macros <2024-02-10>} % preloaded in format \_doc ----------------------------- We define \`\opinput` `{}` macro which @@ -119,8 +119,9 @@ \_newtoks\_opt \_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}}% + \_def#1{\_isnextchar[{\_cs{_oA:\_csstring#1}}{\_cs{_oA:\_csstring#1}[#2]}}% + \_sdef{_oA:\_csstring#1}[##1]{% + \_immediateassignment\_opt={##1}\_cs{_oB:\_csstring#1\_nospaceafter}}% \_sdef{_oB:\_csstring#1\_nospaceafter}% } \_def\_nospaceafter#1{\_ea#1\_romannumeral-`\.\_noexpand} @@ -129,13 +130,22 @@ \_public \opt \optdef \nospaceafter \nospacefuturelet ; + \_doc ----------------------------- + \`\_noprefix` `` works like `\csstring` ``, but ignores not only + the first backlash but the second~\"`_`" ignores too (if it follows the + backslash). + \_cod ----------------------------- + +\_def\_noprefix#1{\_ea\_noprefixA \_csstring#1\_empty\_fin} +\_def\_noprefixA #1#2\_fin{\_if _#1\_else #1\_fi #2} + \_doc ----------------------------- The declarator \`\eoldef``\macro #1{}` defines a `\macro` which scans its parameter to the end of the current line. This is the parameter `#1` which can be used in the ``. The catcode of the `\endlinechar` is reset temporarily when the parameter is scanned. - The macro defined by `\eoldef` cannot be used with its parameter inside + The macro defined by \^`\eoldef` cannot be used with its parameter inside other macros because the catcode dancing is not possible here. But the \`\bracedparam``\macro{}` can be used here. The `\bracedparam` is a prefix that re-sets temporarily the `\macro` to a `\macro` with @@ -146,15 +156,16 @@ \_cod ----------------------------- \_def\_eoldef #1{\_def #1{\_begingroup \_catcode`\^^M=12 \_eoldefA #1}% - \_ea\_def\_csname _\_csstring #1:M\_endcsname} + \_ea\_def\_csname _eol:\_noprefix #1\_endcsname} \_catcode`\^^M=12 % -\_def\_eoldefA #1#2^^M{\_endgroup\_csname _\_csstring #1:M\_endcsname{#2}}% +\_def\_eoldefA #1#2^^M{\_endgroup\_csname _eol:\_noprefix #1\_endcsname{#2}}% \_normalcatcodes % \_eoldef\_skiptoeol#1{} -\_def\_bracedparam#1{\_ifcsname _\_csstring #1:M\_endcsname - \_csname _\_csstring #1:M\_ea \_endcsname - \_else \_csname _in\_csstring #1\_ea \_endcsname \_fi + +\_def\_bracedparam#1{% + \_trycs{_eol:\_noprefix#1}% + {\_errmessage{\_string\bracedparam: \_string#1 isn't defined by \_string\eoldef}}% } \_public \eoldef \skiptoeol \bracedparam ; @@ -270,7 +281,8 @@ \endtt You can use expandable \`\expr``{}` for analogical purposes. It expands to the value of the `` at expand processor level. - The `` can include `+-*/()` and decimal numbers in common syntax. + The `` can include `+-*/^()` and decimal numbers in common syntax. + Moreover, `a//b` means integer division and `a\%b` is remainder. The math functions (and pi constant) have to be prefixed by `math.`, because it is processed by Lua interpreter. For example `\expr{math.pi*math.sqrt(2)}`. @@ -298,6 +310,21 @@ \_public \expr \bp ; + \_doc ----------------------------- + The \^`\expr` and \^`\bp` macros return their results with given number of decimal + digits even if there are trailing zeros. There is the \^`\nnum` macro to + \"normalize" such decimal numbers. \`\nnum``{}` expands its parameter + and removes trailing zeros after decimal point and removes the decimal point + if nothing follows. For example, use `\nnum{\expr[10]{}}`. + The `\nnum` macro is fully expandable. + \_cod ----------------------------- + +\_def\_nnum #1{\_ea\_nnumA\_expanded{#1}.\_fin} +\_def\_nnumA #1.#2\_fin{#1\_ifx~#2~\_else \_nnumB #20.\_fin \_fi} +\_def\_nnumB #10.#2\_fin{\_ifx~#2~\_nnumC#1\_else \_nnumB #1.0.\_fin \_fi} +\_def\_nnumC #1.{\_ifx~#1~\_else .#1\_fi} +\_public \nnum ; + \_doc ------------------ You can write \^`\setpos``[