summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-09 21:13:04 +0000
committerKarl Berry <karl@freefriends.org>2023-03-09 21:13:04 +0000
commitf15b22a2d2fcca2502bb3dda7d2750fa9b9460b4 (patch)
tree21442d29825fa6f6fb8ba7480da4ac6e41363dfe
parent151111026233d8d9def310f3b1f4bbc096ca691d (diff)
optex (9mar23) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2022.final@66497 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/optex/base/README6
-rw-r--r--Master/texmf-dist/doc/optex/base/optex-doc.pdfbin1505109 -> 1510893 bytes
-rw-r--r--Master/texmf-dist/doc/optex/base/optex-doc.tex2
-rw-r--r--Master/texmf-dist/doc/optex/base/optex-userdoc.tex3
-rw-r--r--Master/texmf-dist/tex/optex/base/f-cabin.opm43
-rw-r--r--Master/texmf-dist/tex/optex/base/f-erewhon.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/f-fira.opm55
-rw-r--r--Master/texmf-dist/tex/optex/base/f-heros.opm3
-rw-r--r--Master/texmf-dist/tex/optex/base/f-inconsolata.opm18
-rw-r--r--Master/texmf-dist/tex/optex/base/f-xcharter.opm5
-rw-r--r--Master/texmf-dist/tex/optex/base/fams-ini.opm19
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-catalog.opm7
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-resize.opm30
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-select.opm48
-rw-r--r--Master/texmf-dist/tex/optex/base/graphics.opm9
-rw-r--r--Master/texmf-dist/tex/optex/base/hi-syntax.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/hisyntax-c.opm20
-rw-r--r--Master/texmf-dist/tex/optex/base/lists.opm31
-rw-r--r--Master/texmf-dist/tex/optex/base/optex.ini2
-rw-r--r--Master/texmf-dist/tex/optex/base/parameters.opm27
-rw-r--r--Master/texmf-dist/tex/optex/pkg/tikz.opm8
21 files changed, 279 insertions, 61 deletions
diff --git a/Master/texmf-dist/doc/optex/base/README b/Master/texmf-dist/doc/optex/base/README
index 36c2c98bb18..220e29fa5fb 100644
--- a/Master/texmf-dist/doc/optex/base/README
+++ b/Master/texmf-dist/doc/optex/base/README
@@ -22,7 +22,11 @@ doc/ ... PDF version of the OpTeX documentation and sources.
History:
-<1.10> Feb 2022:
+<1.11> Mar 2023:
+ \fontfamsub: the substitution of missing families introduced.
+ New font family files created.
+ Minor bugs fixed.
+<1.10> Feb 2023:
key-values improved: \iskv, \kvx, \nokvx introduced.
unimath-codes: control sequences are macros, no \chardef.
\bp, \expr: optional syntax for setting the number of digits after decimal point.
diff --git a/Master/texmf-dist/doc/optex/base/optex-doc.pdf b/Master/texmf-dist/doc/optex/base/optex-doc.pdf
index ed937d191ec..d3005140884 100644
--- a/Master/texmf-dist/doc/optex/base/optex-doc.pdf
+++ b/Master/texmf-dist/doc/optex/base/optex-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/optex/base/optex-doc.tex b/Master/texmf-dist/doc/optex/base/optex-doc.tex
index bbb19e44f2d..4b0082ee352 100644
--- a/Master/texmf-dist/doc/optex/base/optex-doc.tex
+++ b/Master/texmf-dist/doc/optex/base/optex-doc.tex
@@ -21,7 +21,7 @@
\tit Format Based on Plain \TeX/ and OPmac\fnotemark1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\hfill Version 1.10
+\hfill Version 1.11
\centerline{\it Petr Olšák, 2020, 2021, 2022, 2023}
diff --git a/Master/texmf-dist/doc/optex/base/optex-userdoc.tex b/Master/texmf-dist/doc/optex/base/optex-userdoc.tex
index 937952079af..4ae414cfbc1 100644
--- a/Master/texmf-dist/doc/optex/base/optex-userdoc.tex
+++ b/Master/texmf-dist/doc/optex/base/optex-userdoc.tex
@@ -1062,7 +1062,7 @@ The \~`\begtt`...\~`\endtt` pair or \~`\verbinput` can be used for listings of
codes. Automatic syntax highlighting is possible, for example
`\begtt` \^`\hisyntax{C}` activates colors for C programs. Or
`\verbinput` \^`\hisyntax{HTML} (-) file.html` can be used for HTML or XML codes.
-\OpTeX/ implements C, Python, \TeX/, HTML and XML syntax highlighting.
+\OpTeX/ implements C, Lua, Python, \TeX/, HTML and XML syntax highlighting.
More languages can be declared, see the section~\ref[hisyntax].
If the code is read by \^`\verbinput` and there are comment lines prefixed
@@ -1459,6 +1459,7 @@ by default, this means that the image files are searched in the
current directory. Example: \^`\picdir={img/}` supposes that image files are
in `img` subdirectory. Note: the directory name must end by `/` in
the \^`\picdir` declaration.
+More parameters can be inclued using the \^`\picparams` token list.
Inkscape\fnote
{A powerful and free Wysiwyg editor for creating vector graphics.}
diff --git a/Master/texmf-dist/tex/optex/base/f-cabin.opm b/Master/texmf-dist/tex/optex/base/f-cabin.opm
new file mode 100644
index 00000000000..d0b6e19387b
--- /dev/null
+++ b/Master/texmf-dist/tex/optex/base/f-cabin.opm
@@ -0,0 +1,43 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [Cabin] \Cabin {Inspired by Gill's typefaces + touch of a modernism}
+ {\caps \cond \medium \semibold} {\rm \bf \it \bi} {FiraMath}
+ {[Cabin-Regular]}
+ {\_def\_fontnamegen{[Cabin\_condV-\_currV\_condV]:\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifiers:^^J
+ \caps ...... caps & small caps (unavailable in condensed variants)^^J
+ \cond ...... condensed variants^^J
+ \medium .... medium weight (only \rm, \it)^^J
+ \semibold .. semibold weight (only \bf, \bi)^^J
+}}
+
+\_moddef \resetmod {\_fsetV caps={},cond={} \_fvars Regular Bold Italic BoldItalic }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
+\_moddef \nocaps {\_fsetV caps={} }
+\_moddef \cond {\_fsetV cond=Condensed }
+\_moddef \nocond {\_fsetV cond={} }
+\_moddef \medium {\_fvars Medium Bold MediumItalic BoldItalic }
+\_moddef \semibold {\_fvars Regular SemiBold Italic SemiBoldItalic }
+
+\_initfontfamily % new font family must be initialized
+
+\_ifmathloading
+ \_loadmath {[FiraMath-Regular]}
+ \_addUmathfont \_xits {[XITSMath-Regular]}{} {[XITSMath-Bold]}{} {}
+ \_addto\_frak{\_fam\_xits}\_addto\_cal{\_fam\_xits} \_public \frak \cal ;
+ % \bf, \bi from FiraMath:
+ \_let\_bsansvariables=\_bfvariables
+ \_let\_bsansGreek=\_bfGreek
+ \_let\_bsansgreek=\_bfgreek
+ \_let\_bsansdigits=\_bfdigits
+ \_let\_bisansvariables=\_bivariables
+ \_let\_bisansgreek=\_bigreek
+ % \_resetmathchars <fam-number> <list of \Umathchardef csnames> ;
+ \_mathchars \_xits {\bigtriangleup \bigblacktriangleup \blacktriangle
+ \vartriangle \smallblacktriangleright} % ... etc. you can add more
+\_fi
+
+\_endcode
+
diff --git a/Master/texmf-dist/tex/optex/base/f-erewhon.opm b/Master/texmf-dist/tex/optex/base/f-erewhon.opm
index 11fc55330e1..efc23c411e6 100644
--- a/Master/texmf-dist/tex/optex/base/f-erewhon.opm
+++ b/Master/texmf-dist/tex/optex/base/f-erewhon.opm
@@ -3,7 +3,7 @@
\_famdecl [Erewhon] \Erewhon {Derived from Heuristica with slanted variants}
{\caps} {\rm \bf \it \bi \sl \bs} {Erewhon}
{[Erewhon-Regular]}
- {\_def\_fontnamegen {[Erewhon-\_currV]:\_capsV\_fontfeatures}}
+ {\_def\_fontnamegen {[Erewhon-\_currV]:script=latn;\_capsV\_fontfeatures}}
\_wlog{\_detokenize{%
Modifiers:^^J
diff --git a/Master/texmf-dist/tex/optex/base/f-fira.opm b/Master/texmf-dist/tex/optex/base/f-fira.opm
new file mode 100644
index 00000000000..17f246e54b6
--- /dev/null
+++ b/Master/texmf-dist/tex/optex/base/f-fira.opm
@@ -0,0 +1,55 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [Fira] \Fira {FiraSans and FiraMono with FiraMath}
+ {\sans \mono \caps \allsc \nocaps \thin \light \book \medium}
+ {\rm \bf \it \bi}
+ {FiraMath}
+ {[FiraSans-Regular]}
+ {\_def \_fontnamegen {[Fira\_subV-\_currV]:\_capsV\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifiers (subfamilies):^^J
+ \mono ...... Monospaced variants [Mono]^^J
+Modifiers (face weight):^^J
+ \thin ...... \rm, \it = Thin, \bf, \bi = Regular (Sans)^^J
+ \light ..... \rm, \it = Light, \bf, \bi = Medium (Sans)^^J
+ \book ...... \rm, \it = Book, \bf, \bi = SemiBold (Sans)^^J
+ \medium .... \rm, \it = Medium, \bf, \bi = ExtraBold/Bold (Sans, Mono)^^J
+Modifiers (small caps):^^J
+ \caps ...... Caps and small caps (Sans)^^J
+ \allsc ..... Small caps only (Sans)^^J
+ \nocaps .... No small caps^^J
+}}
+
+\_moddef \resetmod {\_fsetV sub=Sans,caps={} \_fvars Regular Bold Italic BoldItalic }
+\_moddef \mono {\_fsetV sub=Mono,caps={} \_fvars Regular Bold Oblique BoldOblique }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
+\_moddef \allsc {\_fsetV caps=+smcp;+c2sc;\_ffonum; }
+\_moddef \nocaps {\_fsetV caps={} }
+
+\_moddef \thin {\_onlyif sub=Sans: {\_fvars Thin Regular ThinItalic Italic }}
+\_moddef \light {\_onlyif sub=Sans: {\_fvars Light Medium LightItalic MediumItalic }}
+\_moddef \book {\_onlyif sub=Sans: {\_fvars Book SemiBold BookItalic SemiBoldItalic }}
+\_moddef \medium {\_onlyif sub=Sans: {\_fvars Medium ExtraBold MediumItalic ExtraBoldItalic }%
+ \_onlyif sub=Mono: {\_fvars Medium Bold MediumOblique BoldOblique }}
+
+\_initfontfamily % new font family must be initialized
+
+\_ifmathloading
+ \_loadmath {[FiraMath-Regular]}
+ \_addUmathfont \_xits {[XITSMath-Regular]}{} {[XITSMath-Bold]}{} {}
+ \_addto\_frak{\_fam\_xits}\_addto\_cal{\_fam\_xits} \_public \frak \cal ;
+ % \bf, \bi from FiraMath:
+ \_let\_bsansvariables=\_bfvariables
+ \_let\_bsansGreek=\_bfGreek
+ \_let\_bsansgreek=\_bfgreek
+ \_let\_bsansdigits=\_bfdigits
+ \_let\_bisansvariables=\_bivariables
+ \_let\_bisansgreek=\_bigreek
+ % \_resetmathchars <fam-number> <list of \Umathchardef csnames> ;
+ \_mathchars \_xits {\bigtriangleup \bigblacktriangleup \blacktriangle
+ \vartriangle \smallblacktriangleright
+ \unicodevdots \unicodeadots \unicodeddots} % ... etc. you can add more
+\_fi
+
+\_endcode
diff --git a/Master/texmf-dist/tex/optex/base/f-heros.opm b/Master/texmf-dist/tex/optex/base/f-heros.opm
index d7495538826..a7aebdb4b82 100644
--- a/Master/texmf-dist/tex/optex/base/f-heros.opm
+++ b/Master/texmf-dist/tex/optex/base/f-heros.opm
@@ -32,7 +32,8 @@ Modifiers:^^J
\_let\_bisansgreek=\_bigreek
% \_resetmathchars <fam-number> <list of \Umathchardef csnames> ;
\_mathchars \_xits {\bigtriangleup \bigblacktriangleup \blacktriangle
- \vartriangle \smallblacktriangleright} % ... etc. you can add more
+ \vartriangle \smallblacktriangleright
+ \unicodevdots \unicodeadots \unicodeddots} % ... etc. you can add more
\_fi
\_endcode
diff --git a/Master/texmf-dist/tex/optex/base/f-inconsolata.opm b/Master/texmf-dist/tex/optex/base/f-inconsolata.opm
new file mode 100644
index 00000000000..732b6fd4f56
--- /dev/null
+++ b/Master/texmf-dist/tex/optex/base/f-inconsolata.opm
@@ -0,0 +1,18 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_famdecl [Inconsolata] \Inconsolata {Inconsolata monospaced fonts}
+ {\narrow} {\rm \bf} {}
+ {[Inconsolatazi4-Regular.otf]}
+ {\_def \_fontnamegen {[Inconsolata\_subV-\_currV]:\_fontfeatures}}
+
+\_wlog{\_detokenize{%
+Modifiers:^^J
+ \narrow ...... Narrow variants^^J
+}}
+
+\_moddef \resetmod {\_fsetV sub=zi4 \_fvars Regular Bold . . }
+\_moddef \narrow {\_fsetV sub=N \_fvars Regular Bold . . }
+
+\_initfontfamily % new font family must be initialized
+
+\_endcode
diff --git a/Master/texmf-dist/tex/optex/base/f-xcharter.opm b/Master/texmf-dist/tex/optex/base/f-xcharter.opm
index b776582a1cf..9cdef445ca2 100644
--- a/Master/texmf-dist/tex/optex/base/f-xcharter.opm
+++ b/Master/texmf-dist/tex/optex/base/f-xcharter.opm
@@ -1,7 +1,7 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
\_famdecl [XCharter] \XCharter {An extension of Bitstream Charter}
- {\caps \slant} {\rm \bf \it \bi} {}
+ {\caps \slant} {\rm \bf \it \bi} {XCharter}
{[XCharter-Roman]}
{\_def\_fontnamegen {[XCharter-\_currV]:script=latn;\_capsV\_fontfeatures}}
@@ -17,6 +17,9 @@ Modifiers:^^J
\_initfontfamily % new font family must be initialized
+\loadmath{[XCharter-Math]}
+\loadboldmath{[XCharter-Math-Bold]} \to {[XCharter-Math]}
+
\_endcode
See the file `f-heros.opm` for information about principles of such
diff --git a/Master/texmf-dist/tex/optex/base/fams-ini.opm b/Master/texmf-dist/tex/optex/base/fams-ini.opm
index 505887f46e7..3754cc8f6dc 100644
--- a/Master/texmf-dist/tex/optex/base/fams-ini.opm
+++ b/Master/texmf-dist/tex/optex/base/fams-ini.opm
@@ -7,6 +7,7 @@
\_faminfo [Catalogue] {Catalogue of all registered font families} {fonts-catalog} {}
\_famalias [Catalog]
+\_famsrc {TeXlive}
\_famtext {Computer Modern like family:}
\_famfrom {GUST}
@@ -132,6 +133,12 @@
{ -,\onum: {\rm\bf\it\bi} }
\_famalias [Caslon]
+\_famfrom {Pablo Impallari, Igino Marini}
+\_faminfo [Cabin] {Inspired by Gill's typefaces + touch of a modernism} {f-cabin}
+ { -,\caps: {\rm\bf\it\bi} \medium: {\rm\it} \semibold: {\bf\bi}
+ \cond: {\rm\bf\it\bi} \cond\medium: {\rm\it} \cond\semibold: {\bf\bi}
+ }
+
\_famfrom {Adobe, Paul D. Hunt}
\_faminfo [Source Pro] {Adobe SourceSerifPro, SourceSansPro, SourceCodePro} {f-sourcepro}
{ \elight,\light,-,\bolder: {\rm\it} -,\bolder: {\bf\bi}
@@ -192,10 +199,12 @@
-,\medium,\semibold: {\bf\bi} }
\_famfrom {CTU in Prague, Roman Cernohous}
+\_famsrc {non free font, used in CTU Style, see \url{https://www.cvut.cz/en/ctu-logo}}
\_faminfo [Technika] {Fonts from visual style of CTU in Prague} {f-technika}
{ -,\light,\book, \caps, \caps\book: {\rm\bf\it\bi} -:{\stencil} }
\_famalias [CTU Technika]
+\_famsrc {TeXlive}
\_famfrom {Bitstream, Andrey V. Panov, Michael Sharpe}
\_faminfo [XCharter] {An extension of Bitstream Charter} {f-xcharter}
{ -,\slant,\caps,\caps\slant: {\rm\bf\it\bi} }
@@ -204,6 +213,16 @@
\_faminfo [GFSBodoni] {Based on Bodoni with greek letters} {f-gfsbodoni}
{ -: {\rm\bf\it\bi} \caps: {\rm} }
+\_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,%
+ \thin\caps,\light\caps,\book\caps,\caps,\medium\caps,%
+ \thin\allsc,\light\allsc,\book\allsc,\allsc,\medium\allsc: {\rm\bf\it\bi} }
+
+\_famfrom {Raph Levien}
+\_faminfo [Inconsolata] {A monospaced font for code listing} {f-inconsolata}
+ { -,\narrow: {\rm\bf} }
+
\_endcode
Once you have prepared a font family file with the name `f-<famname>.opm` and
diff --git a/Master/texmf-dist/tex/optex/base/fonts-catalog.opm b/Master/texmf-dist/tex/optex/base/fonts-catalog.opm
index 347c94b1459..893c731df05 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-catalog.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-catalog.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_undefined {Font catalogue <2022-07-11>} % loaded on demand by \fontfam[catalog]
+\_codedecl \_undefined {Font catalogue <2023-03-09>} % loaded on demand by \fontfam[catalog]
\_tracinglostchars=1 % only to log file
\_initunifonts
@@ -41,7 +41,9 @@
\_iftrue {\_ttfixed \$Default math font\$: \_mathfaminfo \_par}
\_else Default math font (\_mathfaminfo): \_the\_catalogmathsample \_par
\_fi\_fi
- \_else {\_qquad\_ttfixed ... family skipped, fonts not found in your system.}
+ \_else {\_qquad\_ttfixed ... family skipped, fonts not found in your system.\_nl
+ \_null\_qquad ... where is the family from:\_nl
+ \_null\_qquad\_qquad\_the\_famsrc}
\_fi\_fi\_fi
\_egroup
}
@@ -134,6 +136,7 @@ described in the \code{fams-ini.opm} file.
\_endcode % -------------------------------------
+2023-03-09 \_famsrc introduced
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/fonts-resize.opm b/Master/texmf-dist/tex/optex/base/fonts-resize.opm
index e76596611b4..4fc8ab1e282 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-resize.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-resize.opm
@@ -186,8 +186,8 @@ gives the extended syntax:
% or
\font \<font switch> = {<font name>:<font features>} <size spec>
\endtt
-where <font file name> is name of the OpenType font file without extension
-(extensions `.otf` or `.ttf` are assumed). The braces in the syntax
+where <font file name> is name of the OpenType font file with the extension
+`.otf` or `.ttf` or without it. The braces in the syntax
are optional, use them when the <font file name> or <font name> includes spaces.
The original syntax for `tfm` files is also available. Example:
\begtt
@@ -206,14 +206,32 @@ You can use \^`\ufont` macro which runs \^`\initunifonts` followed by `\font`
primitive. And \^`\fontfam` does (among other things) \^`\initunifonts`
too. You need not to specify \^`\initunifonts` if \^`\fontfam` or \^`\ufont` is used.
-It seems that you must decide about final size of the font before it is
-loaded by the `\font` primitive. It is not exactly true; \OpTeX/ offers
-powerful possibility to resize the font already loaded on demand.
-See the example at the end of next subsection.
+When \^`\initunifonts` is declared then the `\font` primitive is ready to read
+Type1 fonts too. If you have `file.afm` and `file.pfb` then you can
+declare `\font\f=file.afm` and use `\f`. It means that you needn't to create
+`tfm` files nor `vf` files, you can use Type1 fonts directly.
+They behave as Unicode fonts if the `afm` metrics are implemented correctly
+(with correct names of all included glyphs). But we must to say that Type1
+font format is old technology, the loading of Type1 fonts is not optimized.
+Use OpenType fonts (`otf` of `ttf`) if it is possible.
+
+Let's sum it up. Suppose that \^`\initunifonts` was used.
+The `\font` primitive is able to load OpenType
+fonts (`otf` or `ttf`), Type1 fonts (`afm` and `pfb`) or classical `tfm` fonts.
+We strongly recommend to prefer OpenType format over Type1 format
+over `tfm` format. The last one desn't support Unicode. If there is nothing
+else left and you must to use `tfm`, then you must to implement re-encoding from
+Unicode to the `tfm` encoding at macro level, see the
+\ulink[http://petr.olsak.net/optex/optex-tricks.html\#nonunicode]{\OpTeX/ trick 0018}
+for example.
\secc[setfontsize] The `\setfontsize` macro
+It seems that you must decide about final size of the font before it is
+loaded by the `\font` primitive. It is not exactly true; \OpTeX/ offers
+powerful possibility to resize the font already loaded on demand.
+
The \^`\setfontsize` `{<size spec>}`
saves the information about `<size spec>`. This information is taken into
account when a variant selector (for example `\rm`, `\bf`, `\it`, `\bi`)
diff --git a/Master/texmf-dist/tex/optex/base/fonts-select.opm b/Master/texmf-dist/tex/optex/base/fonts-select.opm
index 6b10f75aff0..3b5f02c3fa8 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-select.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-select.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \fontfam {Fonts selection system <2022-12-01>} % preloaded in format
+\_codedecl \fontfam {Fonts selection system <2023-03-09>} % preloaded in format
\_doc -----------------------------
The main principle of the Font Selection System is: run one or more
@@ -130,7 +130,9 @@
\_initunifonts \_unichars \_uniaccents
\_unless\_ifcsname _f:\_csstring#2:main.fam\_endcsname
\_isfont{#7}\_iffalse
- \_opwarning{Family [#1] skipped, font "#7" not found}\_ea\_ea\_ea\_endinput \_else
+ \_opwarning{Family [#1] skipped, font "#7" not found}\_endinput
+ \_lowercase{\_ifcsname _fams:#1\_endcsname}\_famsubstitute \_fi
+ \_else
\_edef\_currfamily {\_csstring #2}\_def\_mathfaminfo{#6}%
\_wterm {FONT: [#1] -- \_string#2 \_detokenize{(#3)^^J mods:{#4} vars:{#5} math:{#6}}}%
\_unless \_ifx #2\_undefined
@@ -138,7 +140,7 @@
\_protected\_edef#2{\_def\_noexpand\_currfamily{\_csstring #2}\_unexpanded{#8\_resetfam}}%
\_ea \_let \_csname _f:\_currfamily:main.fam\_endcsname =#2%
\_fi
- \_else \_csname _f:\_csstring#2:main.fam\_endcsname \_rm \_ea \_endinput \_fi
+ \_else \_csname _f:\_csstring#2:main.fam\_endcsname \_rm \_endinput \_empty\_fi
}
\_def\_initfontfamily{%
\_csname _f:\_currfamily:main.fam\_endcsname \_rm
@@ -308,18 +310,21 @@
\_cod -----------------------------
\_protected\_def \_fontfam [#1]{%
- \_lowercase{\_edef\_famname{\_ea\_removespaces #1 {} }}%
+ \_lowercase{\_edef\_famname{\_ea\_removespaces \_expanded{#1} {} }}%
\_isfile {f-\_famname.opm}\_iftrue \_opinput {f-\_famname.opm}%
\_else
\_tryloadfamslocal
\_edef\_famfile{\_trycs{_famf:\_famname}{}}%
- \_ifx\_famfile\_empty \_listfamnames
+ \_ifx\_famfile\_empty
+ \_ifcsname _fams:\_famname \_endcsname \_famsubstitute
+ \_else \_listfamnames
+ \_fi
\_else \_opinput {\_famfile.opm}%
- \_fi\_fi
+ \_fi\_empty\_fi
}
\_def\_tryloadfamslocal{%
\_isfile {fams-local.opm}\_iftrue
- \_opinput {fams-local.opm}\_famfrom={}%
+ \_opinput {fams-local.opm}\_famfrom={}\_famsrc={}%
\_fi
\_let \_tryloadfamslocal=\_relax % need not to load fams-local.opm twice
}
@@ -341,6 +346,27 @@
\_public \fontfam ;
\_doc -----------------------------
+ \`\fontfamsub` `[<Family>][<byFamily>]` declares automatic substitution of
+ <Family> by <byFamily> which is done when <Family> is not installed. I.e.
+ if there is no `f-<family>.opm` file or there is no regular font of the
+ family installed.
+ \`\_famsubstitute` is internal macro used in \^`\fontfam` and \^`\_famdecl` macros.
+ It consumes the rest of the macro, runs \^`\nospacefuturelet` in order to
+ do `\endpinput` to the current `f-file` and runs \^`\fontfam` again.
+ The table of such substutitions are saved in the macros `\_fams:<family>`.
+ \_cod -----------------------------
+
+\_def \_fontfamsub [#1]#2[#3]{\_lowercase{\_sxdef{_fams:#1}{#3}}}
+
+\_def\_famsubstitute #1\_empty\_fi{\_fi\_fi\_fi
+ \_wterm {FONT: Family [\_famname] not found, substituted by [\_cs{_fams:\_famname}]}%
+ \_nospacefuturelet\_tmp\_famsubstituteA % we want to \endinput current f-file
+}
+\_def\_famsubstituteA{\_fontfam[\_cs{_fams:\_famname}]}
+
+\_public \fontfamsub ;
+
+ \_doc -----------------------------
When the `fams-ini.opm` or `fams-local.opm` files are read then we need
to save only a mapping from family names or alias names to the font family file
names. All other information is ignored in this case. But if these files
@@ -360,6 +386,9 @@
\`\_famfrom` declares type foundry or owner or designer of the font family.
It can be used in `fams-ini.opm` or `fams-local.opm` and it is printed
in the font catalog.
+ \nl
+ \`\_famsrc` declares the source, where is the font family from (used in `fams-ini.opm`
+ and if the font isn't found when the fonts catalog is printed).
\_cod -----------------------------
\_def\_famtext #1{}
@@ -372,10 +401,10 @@
\_lowercase{\_edef\_tmpa{\_ea\_removespaces #1 {} }}%
\_sdef{_famf:\_tmpa\_ea}\_ea{\_famfile}%
}
-\_newtoks\_famfrom
+\_newtoks\_famfrom \_newtoks\_famsrc
\_input fams-ini.opm
\_let\_famfile=\_undefined
-\_famfrom={}
+\_famfrom={} \_famsrc={}
\_doc -----------------------------
When the \^`\fontfam``[catalog]` is used then the file
@@ -899,6 +928,7 @@ with Unicode fonts loaded by \^`\fontfam`.
\endinput
+2023-03-09 \_famsrc, \fontfamsub introduced
2022-12-01 \faminfo saves f-<filename> to the format only when needed
2022-11-08 \protected: \fontdef, \famvardef, \fontfam
2022-02-22 Font Selection System reimplemented, \fontsel introduced
diff --git a/Master/texmf-dist/tex/optex/base/graphics.opm b/Master/texmf-dist/tex/optex/base/graphics.opm
index 77e78cef237..6a095343d65 100644
--- a/Master/texmf-dist/tex/optex/base/graphics.opm
+++ b/Master/texmf-dist/tex/optex/base/graphics.opm
@@ -7,9 +7,6 @@
or new syntax `\inspic{<filename>}`. So, we need to define
two auxiliary macros \`\_inspicA` and \`\_inspicB`.
- You can include more `\pdfximage` parameters (like `page<number>`)
- in the \`\_picparams` macro.
-
All `\inspic` macros are surrounded in `\hbox` in order user can
write `\moveright\inspic ...` or something similar.
\_cod -----------------------------
@@ -19,11 +16,9 @@
\_def\_inspicB #1{%
\_pdfximage \_ifdim\_picwidth=\_zo \_else width\_picwidth\_fi
\_ifdim\_picheight=\_zo \_else height\_picheight\_fi
- \_picparams {\_the\_picdir#1}%
+ \_the\_picparams {\_the\_picdir#1}%
\_pdfrefximage\_pdflastximage\_egroup}
-\_def\_picparams{}
-
\_public \inspic ;
\_doc -----------------------------
@@ -48,7 +43,7 @@
\_newtoks\_inkdefs \_inkdefs={%
\_def\makeatletter#1\makeatother{}%
\_def\includegraphics[#1]#2{\_inkscanpage#1,page=,\_fin \_inspic{\_the\_tmptoks}\_hss}%
- \_def\_inkscanpage#1page=#2,#3\_fin{\_ifx,#2,\_else\_def\_picparams{page#2}\_fi}%
+ \_def\_inkscanpage#1page=#2,#3\_fin{\_ifx,#2,\_else\_picparams{page#2}\_fi}%
\_def\put(#1,#2)#3{\_nointerlineskip\_vbox to\_zo{\_vss\_hbox to\_zo{\_kern#1\_picwidth
\_pdfsave\_hbox to\_zo{#3}\_pdfrestore\_hss}\_kern#2\_picwidth}}%
\_def\begin#1{\_csname _begin#1\_endcsname}%
diff --git a/Master/texmf-dist/tex/optex/base/hi-syntax.opm b/Master/texmf-dist/tex/optex/base/hi-syntax.opm
index c708be05636..7e5b77b8264 100644
--- a/Master/texmf-dist/tex/optex/base/hi-syntax.opm
+++ b/Master/texmf-dist/tex/optex/base/hi-syntax.opm
@@ -144,7 +144,7 @@ file name must include it in lowercase letters. For example, the file
\printdoc hisyntax-c.opm
-\OpTeX/ provides `hisyntax-{c,python,tex,html}.opm` files.
+\OpTeX/ provides `hisyntax-{c,lua,python,tex,html}.opm` files.
You can take inspiration from these files and declare more languages.
Users can re-declare default colors by \^`\hicolors``={<list of color declarations>}`.
diff --git a/Master/texmf-dist/tex/optex/base/hisyntax-c.opm b/Master/texmf-dist/tex/optex/base/hisyntax-c.opm
index d0a4217b31e..07d6a6570ce 100644
--- a/Master/texmf-dist/tex/optex/base/hisyntax-c.opm
+++ b/Master/texmf-dist/tex/optex/base/hisyntax-c.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_hisyntaxc {Syntax highlighting for C sources <2020-04-03>}
+\_codedecl \_hisyntaxc {Syntax highlighting for C sources <2023-03-02>}
\_newtoks \_hisyntaxc \_newtoks \_hicolorsc
@@ -25,10 +25,15 @@
\_ea \_foreach \_tmpa
\_do {\_replthis{#1}{\n\o#1\n}}
\_foreach % keywords
- {auto}{break}{case}{char}{continue}{default}{do}{double}%
- {else}{entry}{enum}{extern}{float}{for}{goto}{if}{int}{long}{register}%
- {return}{short}{sizeof}{static}{struct}{switch}{typedef}{union}%
- {unsigned}{void}{while}
+ {alignas}{alignof}{auto}{bool}{break}{case}{char}{const}%
+ {constexpr}{continue}{default}{do}{double}{else}{enum}{extern}%
+ {false}{float}{for}{goto}{if}{inline}{int}{long}{nullptr}%
+ {register}{restrict}{return}{short}{signed}{sizeof}{static}%
+ {static_assert}{struct}{switch}{thread_local}{true}{typedef}%
+ {typeof}{typeof_unqual}{union}{unsigned}{void}{volatile}{while}%
+ {_Alignas}{_Alignof}{_Atomic}{_BitInt}{_Bool}{_Complex}%
+ {_Decimal128}{_Decimal32}{_Decimal64}{_Generic}{_Imaginary}%
+ {_Noreturn}{_Static_assert}{_Thread_local}
\_do {\_replthis{\n#1\n}{\z K{#1}}}
\_replthis{.}{\n.\n} % numbers
\_foreach 0123456789
@@ -64,3 +69,8 @@ keyword is applied in the `\foreach` loop too.
See `hi-sytax.opm` for more information about `\hicolor`, `\replfromto` and
`\replthis` macros.
+
+\endinput
+
+2023-03-02: more C keywords added
+2020-04-03: released
diff --git a/Master/texmf-dist/tex/optex/base/lists.opm b/Master/texmf-dist/tex/optex/base/lists.opm
index 57b057d6c8c..e7785678dd9 100644
--- a/Master/texmf-dist/tex/optex/base/lists.opm
+++ b/Master/texmf-dist/tex/optex/base/lists.opm
@@ -1,25 +1,21 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \begitems {Lists: begitems, enditems <2021-03-10>} % preloaded in format
+\_codedecl \begitems {Lists: begitems, enditems <2022-02-25>} % preloaded in format
\_doc -----------------------------
\`\_aboveliskip` is used above the list of items,\nl
- \`\_belowliskip` is used below the list of items and\nl
- \`\_interliskip` is used between items.\nl
- \`\_listskipA` is used as `\listskipamount` at level 1 of items.\nl
- \`\_listskipB` is used as `\listskipamount` at other levels.\nl
- \`\_setlistskip` sets the skip dependent on the current level of items
+ \`\_belowliskip` is used below the list of items,\nl
+ \`\_setlistskip` sets the skip dependent on the current level of items,\nl
+ \`\_listskipab` is \^`\ilistskipamount` or \^`\olistskipamount`.
\_cod -----------------------------
-\_def\_aboveliskip {\_removelastskip \_penalty-100 \_vskip\_listskipamount}
-\_def\_belowliskip {\_penalty-200 \_vskip\_listskipamount}
-\_def\_interliskip {}
-\_def\_listskipA {\_medskipamount}
-\_def\_listskipB {0pt plus.5\_smallskipamount}
+\_def\_aboveliskip {\_removelastskip \_penalty-100 \_vskip\_listskipab}
+\_def\_belowliskip {\_penalty-200 \_vskip\_listskipab}
+\_newskip\_listskipab
\_def\_setlistskip {%
- \_ifnum \_ilevel = 1 \_listskipamount = \_listskipA \_relax
- \_else \_listskipamount = \_listskipB \_relax
+ \_ifnum \_ilevel = 1 \_listskipab = \_olistskipamount \_relax
+ \_else \_listskipab = \_ilistskipamount \_relax
\_fi}
\_doc -----------------------------
@@ -54,17 +50,19 @@
}
\_def\_enditems{\_par\_belowliskip\_egroup \_isnextchar\_par{}{\_noindent}}
-\_def\_startitem{\_par \_ifnum\_itemnum>0 \_interliskip \_fi
+\_def\_startitem{\_par \_ifnum\_itemnum>0 \_vskip\_itemskipamount \_fi
\_advance\_itemnum by1
\_the\_everyitem \_noindent\_llap{\_the\_printitem}\_ignorespaces
}
\_public \begitems \enditems \itemnum ;
\_doc ----------------------------
- \`\novspaces` sets \^`\listskipamount` to 0pt.
+ \`\novspaces` sets \^`\_listskipab` and \^`\itemskipamount` to 0pt.
+ Moreover, it deactivates \^`\_setlistskip` (for inner lists).
\_cod ----------------------------
-\_def\_novspaces {\_removelastskip \_listskipamount=0pt \_relax}
+\_def\_novspaces {\_removelastskip
+ \_listskipab=\_zoskip \_itemskipamount=\_zoskip \_let\_setlistskip=\_relax}
\_public \novspaces ;
\_doc -----------------------------
@@ -123,6 +121,7 @@
\_endcode % -------------------------------------
+2022-02-25 \olistskipamount, \ilistskipamount, \itemskipamount introduced
2021-03-10 \_ifmmode*\_else\_ea\_startitem\_fi added to * defintition
2020-04-21 \isnextchar\par added to \enditems
2020-03-18 introduced
diff --git a/Master/texmf-dist/tex/optex/base/optex.ini b/Master/texmf-dist/tex/optex/base/optex.ini
index 3266cf0ab1f..ebf31ea4c21 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.10 Feb 2023}
+\def\optexversion{1.11 Mar 2023}
\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 855969f4de2..8867f4477aa 100644
--- a/Master/texmf-dist/tex/optex/base/parameters.opm
+++ b/Master/texmf-dist/tex/optex/base/parameters.opm
@@ -197,12 +197,16 @@
parameters locally in the group where \^`\inspic` is used in order to not
influence the dimensions of other images. But there exist many
situations you need to put the same dimensions to more images,
- so you can set this parameter only once before more \^`\inspic` macros.
+ so you can set this parameter only once before more \^`\inspic` macros.\nl
+ More parameters accepted by `\pdfximage` primitive can be set in the
+ \`\picparams` tokens list. For example `\picparams={page3}`
+ selects page 3 from included PDF file.
\_cod -----------------------------
\_newdimen\_picwidth \_picwidth=0pt \_let\picw=\_picwidth
\_newdimen\_picheight \_picheight=0pt
-\_public \picwidth \picheight ;
+\_newtoks\_picparams
+\_public \picwidth \picheight \picparams ;
\_doc -----------------------------
\`\kvdict` is dictionary name when \~`\readkv`, \~`\kvx`, \~`\kv`, and \~`\iskv` are
@@ -310,16 +314,25 @@
\nl
The \`\ilevel` keeps the value of the current nesting level of the items list.
\nl
- The \`\listskipamount` gives vertical skip above and below the items list
- if `\ilevel=1`.
+ The \`\olistskipamount` is vertical skip above and below the items list
+ if `\ilevel=1`.\nl
+ The \`\ilistskipamount` is vertical skip above and below the items list
+ if `\ilevel>1`.\nl
+ The \`\itemskipamount` is vertical skip between list items, but not above the firts
+ and below the last.
\_cod -----------------------------
-\_newtoks\_defaultitem \_defaultitem={$\_bullet$\_enspace}
+\_newtoks\_defaultitem \_defaultitem={$\_bullet$\_enspace}
\_newtoks\_everyitem
\_newtoks\_everylist
-\_newskip \_listskipamount \_listskipamount=\_medskipamount
\_newcount \_ilevel
-\_public \defaultitem \everyitem \everylist \listskipamount \ilevel ;
+\_newskip\_olistskipamount \_olistskipamount=\_medskipamount
+\_newskip\_ilistskipamount \_ilistskipamount=0pt plus.5\_smallskipamount
+\_newskip\_itemskipamount \_itemskipamount=0pt
+
+\_public \defaultitem \everyitem \everylist \ilevel
+ \olistskipamount \ilistskipamount \itemskipamount ;
+\_let \listskipamount = \_olistskipamount % for backward compatibility
\_doc -----------------------------
The \^`\tit` macro includes `\vglue`\`\titskip` above the title of the document.
diff --git a/Master/texmf-dist/tex/optex/pkg/tikz.opm b/Master/texmf-dist/tex/optex/pkg/tikz.opm
index 87b2f7369a1..4da799a4aaa 100644
--- a/Master/texmf-dist/tex/optex/pkg/tikz.opm
+++ b/Master/texmf-dist/tex/optex/pkg/tikz.opm
@@ -1,6 +1,6 @@
% This is macro package used by OpTeX, see http://petr.olsak.net/optex
-\_codedecl \tikzpicture {TikZ for OpTeX <2022-02-18>}
+\_codedecl \tikzpicture {TikZ for OpTeX <2023-03-04>}
\_namespace{pgf}
\_catcode`\@=11
\_let\_optexforeach=\foreach
@@ -155,11 +155,17 @@
\_let\.foreach=\pgffor@foreach % \_pgf_foreach is \pgffor@foreach
\_let\foreach=\_optexforeach % \foreach is OpTeX's \foreach
+\_let\.usetikzlibrary=\usetikzlibrary
+\_def\usetikzlibrary#1{\_let\foreach=\.foreach
+ \.usetikzlibrary{#1}\let\foreach=\_optexforeach
+}
+
% don't worry about reseting catcodes - we are at the end of \opinput'ed file
\_endnamespace
\_endcode
History:
+2023-03-04 \_tikz_foreach used during \usetikzlibrary (bug fix).
2022-03-18 Tikz's \foreach only in its environment.
2022-03-05 resources management re-implemented.
2021-07-15 released