summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/optex/base/README10
-rw-r--r--Master/texmf-dist/doc/optex/base/mte-doc.tex26
-rw-r--r--Master/texmf-dist/doc/optex/base/optex-doc.pdfbin1405606 -> 1383214 bytes
-rw-r--r--Master/texmf-dist/doc/optex/base/optex-doc.tex11
-rw-r--r--Master/texmf-dist/doc/optex/base/optex-techdoc.tex6
-rw-r--r--Master/texmf-dist/doc/optex/base/optex-userdoc.tex12
-rw-r--r--Master/texmf-dist/tex/optex/base/alloc.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/basic-macros.opm7
-rw-r--r--Master/texmf-dist/tex/optex/base/cite-bib.opm4
-rw-r--r--Master/texmf-dist/tex/optex/base/colors.opm30
-rw-r--r--Master/texmf-dist/tex/optex/base/doc.opm150
-rw-r--r--Master/texmf-dist/tex/optex/base/f-erewhon.opm31
-rw-r--r--Master/texmf-dist/tex/optex/base/f-heros.opm7
-rw-r--r--Master/texmf-dist/tex/optex/base/f-lmfonts.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/fams-ini.opm5
-rw-r--r--Master/texmf-dist/tex/optex/base/fnotes.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-opmac.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-preload.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-resize.opm151
-rw-r--r--Master/texmf-dist/tex/optex/base/fonts-select.opm314
-rw-r--r--Master/texmf-dist/tex/optex/base/hyperlinks.opm203
-rw-r--r--Master/texmf-dist/tex/optex/base/languages.opm7
-rw-r--r--Master/texmf-dist/tex/optex/base/makeindex.opm2
-rw-r--r--Master/texmf-dist/tex/optex/base/math-macros.opm1
-rw-r--r--Master/texmf-dist/tex/optex/base/multicolumns.opm9
-rw-r--r--Master/texmf-dist/tex/optex/base/optex.ini2
-rw-r--r--Master/texmf-dist/tex/optex/base/optex.lua2
-rw-r--r--Master/texmf-dist/tex/optex/base/styles.opm62
-rw-r--r--Master/texmf-dist/tex/optex/base/table.opm94
-rw-r--r--Master/texmf-dist/tex/optex/base/usebib.opm5
-rw-r--r--Master/texmf-dist/tex/optex/pkg/emoji.opm4
-rw-r--r--Master/texmf-dist/tex/optex/pkg/mte.opm685
-rw-r--r--Master/texmf-dist/tex/optex/pkg/vlna.opm4
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds4
34 files changed, 1408 insertions, 450 deletions
diff --git a/Master/texmf-dist/doc/optex/base/README b/Master/texmf-dist/doc/optex/base/README
index d3a5becec45..61c46983281 100644
--- a/Master/texmf-dist/doc/optex/base/README
+++ b/Master/texmf-dist/doc/optex/base/README
@@ -17,8 +17,14 @@ pkg/ ... external macros. Maybe, they can be created by other authors if
in the OpTeX documentation.
doc/ ... PDF version of the OpTeX documentation and sources.
-History:
-
+<1.03> Jun. 2021:
+ mte: Package for MicroTypographic Extensions released.
+ Erewhon: font family support added.
+ \rgbcmykmap for RGB-CMYK mapping introduced.
+ \table: sum of \tsizes allowed different from one.
+ doc: hyperlinks from Index created.
+ \url and \link macros re-written.
+ Bugs fixing.
<1.02> Apr. 2021
Location CTAN:macros/luatex/optex moved to CTAN:macros/optex (similarly for TDS).
NewComputerModern font support added.
diff --git a/Master/texmf-dist/doc/optex/base/mte-doc.tex b/Master/texmf-dist/doc/optex/base/mte-doc.tex
new file mode 100644
index 00000000000..030f023d3f7
--- /dev/null
+++ b/Master/texmf-dist/doc/optex/base/mte-doc.tex
@@ -0,0 +1,26 @@
+% This is part of mte.opm macro package for OpTeX
+
+% Run optex mte-doc
+% (two times) to generate documentation including references and the index.
+
+\load [doc]
+
+\def\elink[#1]#2{%
+ \ulink[http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf\#cs:#1]%
+ {\tt\string#2}%
+}
+\def\olink[#1]#2{%
+ \ulink[http://petr.olsak.net/ftp/olsak/optex/optex-doc.pdf\#cs:#1]%
+ {\tt\string#2}%
+}
+\let\_urllinkcolor=\Cyan
+
+\printdoctail mte.opm
+\printdoc mte.opm
+
+\nonum\sec Index
+\begmulti 3
+\tt \makeindex
+\endmulti
+
+\bye
diff --git a/Master/texmf-dist/doc/optex/base/optex-doc.pdf b/Master/texmf-dist/doc/optex/base/optex-doc.pdf
index ba31f2ad238..3bcf1a843ee 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 e14d95c2303..8d056698f4e 100644
--- a/Master/texmf-dist/doc/optex/base/optex-doc.tex
+++ b/Master/texmf-dist/doc/optex/base/optex-doc.tex
@@ -4,6 +4,7 @@
% (three times) to generate OpTeX documentation including references and the index.
\load [doc.opm] \let\enddocument=\endinput
+\let\_catcodedot=\relax \catcode`\.=12 % we are not using \.foo sequences
\typosize[10/12] % Main size (used in techdoc)
@@ -20,7 +21,7 @@
\tit Format Based on Plain \TeX/ and OPmac\fnotemark1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\hfill Version 1.02
+\hfill Version 1.03
\centerline{\it Petr Olšák, 2020, 2021}
@@ -109,6 +110,14 @@ 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}.
+
+% 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\_pgprintA #1{#1}
\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 525fdb94770..31f789d56c9 100644
--- a/Master/texmf-dist/doc/optex/base/optex-techdoc.tex
+++ b/Master/texmf-dist/doc/optex/base/optex-techdoc.tex
@@ -127,10 +127,14 @@ Differences are mentioned in the documentation below.
\printdoc fonts-preload.opm
\printdoctail fonts-resize.opm
+\secc[fresize] Implementation of resizing
+Only \"resizing" macros are implemented here. Other aspects of Font
+Selection System and their implementation are desribed in
+section~\ref[fselect].
\printdoc fonts-resize.opm
\printdoctail fonts-select.opm
-\secc Implementation of the Font Selection System
+\secc[fselect] Implementation of the Font Selection System
\printdoc fonts-select.opm
\sec [math-preload] Preloaded fonts for math mode
diff --git a/Master/texmf-dist/doc/optex/base/optex-userdoc.tex b/Master/texmf-dist/doc/optex/base/optex-userdoc.tex
index 9bcec7db1e0..93dad283773 100644
--- a/Master/texmf-dist/doc/optex/base/optex-userdoc.tex
+++ b/Master/texmf-dist/doc/optex/base/optex-userdoc.tex
@@ -1733,12 +1733,16 @@ The macro packages intended to \OpTeX/ have the name `*.opm`.
The following packages are distributed as part of \OpTeX/:
\begitems
* `qrcode.opm` enables to create QR codes.
+* \ulink[http://petr.olsak.net/ftp/olsak/optex/mte-doc.pdf]{\tt mte.opm}
+ includes settings for microtypographic extensions (protrusions+expanding fonts).
* `vlna.opm` enables to protect of one-letter prepositions and more things automatically.
* `emoji.opm` defines `\emoji{<name>}` command for colored emoticons.
* `plain-at.opm` defines the old names from plain \TeX/.
+* \ulink[https://ctan.org/tex-archive/macros/luatex/optex/pdfextra/pdfextra-doc.pdf]{\tt pdfextra.opm}
+ allows the use of many extra features from PDF standard (by M. Vlasák).
\enditems
-See the directory `optex/pkg/` and these files for more information about
-them.
+See these files in `optex/pkg/` or `optex/<pkgname>` for more information about
+them. The packages may have their documentation, try `texdoc <pkgname>`.
\secc Lorem ipsum dolor sit
%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1988,13 +1992,13 @@ The origin for the typographical area is not at the top left 1\,in 1\,in coordin
but at the top left paper corner exactly. For example, `\hoffset` includes directly left
margin.
-The tabbing macros `\settabs`\iindex{settabs} and `\+` (from Plain \TeX/)
+The tabbing macros `\settabs` and `\+` (from Plain \TeX/)
are not defined in \OpTeX/ because they are obsolete. But you can use the
\ulink[http://petr.olsak.net/optex/optex-tricks.html\#tabs]{\OpTeX/ trick 0021}
if you really need such feature.
The `\sec` macro is reserved for sections but original Plain \TeX/ declares this
-control sequence for math secans.
+control sequence for math secant\fnote{Use \code{$\\secant(x)$} to get $\secant(x)$.}.
\enddocument
diff --git a/Master/texmf-dist/tex/optex/base/alloc.opm b/Master/texmf-dist/tex/optex/base/alloc.opm
index 5d874134d41..13252cae708 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 <2021-02-15>} % loaded in format
+\_codedecl \newdimen {Allocators for registers <2021-02-15>} % preloaded in format
\_doc -----------------------------
The limits are set first.
diff --git a/Master/texmf-dist/tex/optex/base/basic-macros.opm b/Master/texmf-dist/tex/optex/base/basic-macros.opm
index 4d465c30109..57393fc3232 100644
--- a/Master/texmf-dist/tex/optex/base/basic-macros.opm
+++ b/Master/texmf-dist/tex/optex/base/basic-macros.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \sdef {Basic macros for OpTeX <2021-02-03>} % loaded in format
+\_codedecl \sdef {Basic macros for OpTeX <2021-05-16>} % preloaded in format
\_doc ------------------------------
\`\bgroup`, \`\egroup`, \`\empty`, \`\space`, \`\null` and \`\wlog`
@@ -51,7 +51,9 @@
\_def \_sdef #1{\_ea\_def \_csname#1\_endcsname}
\_def \_sxdef #1{\_ea\_xdef \_csname#1\_endcsname}
-\_def \_slet #1#2{\_ea\_let \_csname#1\_ea\_endcsname \_csname#2\_endcsname}
+\_def \_slet #1#2{\_ea\_let \_csname#1\_ea\_endcsname
+ \_ifcsname#2\_ea\_endcsname \_begincsname#2\_endcsname \_else \_undefined \_fi
+}
\_public \sdef \sxdef \slet ;
\_doc ------------------------------
@@ -123,6 +125,7 @@
\_endcode % -------------------------------------
+2021-05-16: \slet reimplemnted (to allow \slet{foo}{undefined}).
2021-02-03: \useit defined.
2021-01-22: \trycs: \ea added in order to be able to use cs with parameters
2021-01-08: \opwarning format changed (secondly, hope that conclusively)
diff --git a/Master/texmf-dist/tex/optex/base/cite-bib.opm b/Master/texmf-dist/tex/optex/base/cite-bib.opm
index 56954a4ee08..adef0eaef87 100644
--- a/Master/texmf-dist/tex/optex/base/cite-bib.opm
+++ b/Master/texmf-dist/tex/optex/base/cite-bib.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \cite {Cite, Biblioraphy <2021-04-13>} % loaded in format
+\_codedecl \cite {Cite, Biblioraphy <2021-04-13>} % preloaded in format
\_doc -----------------------------
Registers used by `\cite`, `\bib` macros are declared here.
@@ -280,7 +280,7 @@
\_def\usebib{\_usebib}
\_doc ------------------------------
- \_forwardlink\`\nobibwarning` `[<list of bib-labels>]`
+ \_fw\`\nobibwarning` `[<list of bib-labels>]`
declares a list of bib labels
which are not fully declared in `.bib` file but we want to suppress the
warning about it. List of bib labels are comma-separated case sensitive
diff --git a/Master/texmf-dist/tex/optex/base/colors.opm b/Master/texmf-dist/tex/optex/base/colors.opm
index bbda496761e..23ec22dd9fb 100644
--- a/Master/texmf-dist/tex/optex/base/colors.opm
+++ b/Master/texmf-dist/tex/optex/base/colors.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \colordef {Colors <2020-03-18>} % loaded in format
+\_codedecl \colordef {Colors <2021-05-28>} % preloaded in format
\_doc -----------------------------
We declare internal boolean value \`\_iflocalcolor` ad do
@@ -129,9 +129,12 @@
to they are in $[0,1]$ interval. The `\colordefFin` expands to the values
accumulated in Lua code `color_C`, `color_M`, `color_Y` and `color_K`.
The `\_douseK` applies \^`\useK` to CMYK components.
+ \nl
+ The `\_tocmyk:<rgb>` or `\_torgb:<cmyk>` control sequences (given by
+ \^`\rgbcmykmap`) have precedence.
\_cod -----------------------------
-\_def\_rgbtocmyk #1 #2 #3 ;{%
+\_def\_rgbtocmyk #1 #2 #3 ;{\_trycs{_tocmyk:#1 #2 #3}{%
\_ea \_stripzeros \_detokenize \_ea{\_directlua{
local kr = math.max(#1,#2,#3)
if (kr==0) then
@@ -140,13 +143,13 @@
tex.print(string.format('\_pcent.3f \_pcent.3f \_pcent.3f \_pcent.3f ;',
(kr-#1)/kr, (kr-#2)/kr, (kr-#3)/kr, 1-kr))
end
-}}}
-\_def\_cmyktorgb #1 #2 #3 #4 ;{%
+}}}}
+\_def\_cmyktorgb #1 #2 #3 #4 ;{\_trycs{_torgb:#1 #2 #3 #4}{%
\_ea \_stripzeros \_detokenize \_ea{\_directlua{
local kr = 1-#4
tex.print(string.format('\_pcent.3f \_pcent.3f \_pcent.3f ;',
(1-#1)*kr, (1-#2)*kr, (1-#3)*kr))
-}}}
+}}}}
\_def\_colorcrop{\_directlua{
local m=math.max(color_C, color_M, color_Y, color_K)
if (m>1) then
@@ -181,6 +184,19 @@
\_def\_stripzeroC #1 #2:{#1}
\_doc -----------------------------
+ \`\rgbcmykmap` `{<R> <G> <B>}`\,`{<C> <M> <Y> <K>}` declares mapping from
+ RGB to CMYK and from CMYK to RGB for given color. It has precedence
+ before general formulae used in the \^`\_rgbtocmyk` and \^`\_cmyktorgb`
+ macros. Note, that the values <R> <G> <B> <C> <M> <Y> <K> must be given
+ exacly in the same format as in \^`\setcmykcolor` and \^`\setrgbcolor`
+ parameters. For example, `0.5` or `.5` or `.50` are different values from
+ point of view of this mapping.
+ \_cod -----------------------------
+
+\_def\_rgbcmykmap#1#2{\_sxdef{_torgb:#2}{#1}\_sxdef{_tocmyk:#1}{#2}}
+\_public \rgbcmykmap ;
+
+ \_doc -----------------------------
The \`\rgbcolordef` and \`\cmykcolordef` use common macro
\`\_commoncolordef` with different first four parameters.
The `\_commoncolordef <selector><K><R><G><what-define>{<data>}` does the
@@ -373,7 +389,8 @@ The \^`\rgbcolordef` can be used to mix colors in additive color model RGB.
If \^`\onlyrgb` is declared, then \^`\colordef` works as \^`\rgbcolordef`.
If a CMYK to RGB or RGB to CMYK conversion is needed then
-the following simple formulae are used
+direct conversion of given color is used (if declared using
+\^`\rgbcmykmap``{<rgb>}{<cmyk>}`) or the following simple formulae are used
(ICC profiles are not supported):
$$
\displaylines{
@@ -390,5 +407,6 @@ and it is used in \^`\rgbcolordef` or if it is printed when \^`\onlyrgb` is decl
\_endinput
+2021-05-28 \rgbcmykmap introduced
2020-04-22 \replstring\tmpb{+ }{+}, {- }{-} added in \colordef, bug fixed
2020-03-18 introduced
diff --git a/Master/texmf-dist/tex/optex/base/doc.opm b/Master/texmf-dist/tex/optex/base/doc.opm
index ce571a9e812..643a283e7ca 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 <2020-04-28>}
+\_codedecl \printdoc {Macros for documentation printing <2021-05-15>} % loaded on demand by \load[doc]
\_doc -----------------------------
General decalarations.
@@ -34,6 +34,8 @@
\_doc -----------------------------
The listing mode is implemented here. The \`\maxlines`
is maximal lines of code printed in the listing mode.
+ The \`\_catcodedot` sets dot as letter in listngs (for package
+ documentation where `\.foo` sequeces exist).
\_cod -----------------------------
\_newcount \_maxlines \_maxlines=100000
@@ -45,9 +47,10 @@
\_typosize[8/10]
\_let\_printverbline=\_printcodeline
\_ttline=\_inputlineno
- \_setverb
+ \_setverb \_catcodedot
\_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}%
\_relax \_ttfont
\_endlinechar=`^^J
\_def\_tmpb{\_start}%
@@ -57,27 +60,38 @@
\_def\_tmpa{\_empty#1}%
\_let\_next=\_readverbline
\_ea\_isinlist\_ea\_tmpa\_ea{\_Doc}\_iftrue \_let\_next=\_processinput \_fi
- \_ea\_isinlist\_ea\_tmpa\_ea{\_Endcode}\_iftrue \_endinput \_let\_next=\_processinput \_fi
+ \_ea\_isinlist\_ea\_tmpa\_ea{\_Doctab}\_iftrue \_let\_next=\_processinput \_fi
+ \_ea\_isinlist\_ea\_tmpa\_ea{\_Endcode}\_iftrue \_def\_next{\_processinput\_endinput}\_fi
\_ifx\_next\_readverbline \_addto\_tmpb{#1^^J}\_fi
\_next
}
{\_catcode`\ =13 \_gdef\_aspace{ }}\_def\_asp{\_ea\_noexpand\_aspace}
\_edef\_Doc{\_asp\_asp\_bslash _doc}
+\_bgroup \_lccode`~=`\^^I \_lowercase{\_egroup\_edef\_Doctab{\_noexpand~\_bslash _doc}}
\_edef\_Endcode{\_noexpand\_empty\_bslash _endcode}
+\_def\_catcodedot{\_catcode`\.=11 }
\_doc -----------------------------
- The scanner of the control sequences in the listing mode.
+ The scanner of the control sequences in the listing mode replaces all
+ occurrences of `\` by \`\_makecs`. This macro reads next tokens and
+ accumulates them to `\_tmpa` as long as they have category 11. It
+ means that `\_tmpa` includes the name of the following control sequence
+ when \fw\`\_makecsF` is run. The printing form of the control
+ sequence is set to `\_tmpb` and the test of existence `\,<csname>`is
+ performed. If it is true then active hyperlink is created. If not, then
+ the first `_` or `.` is removed from `\_tmpa` and the test is repeated.
\_cod -----------------------------
-\_def\_makecs{\_def\_tmp{}\_futurelet\_next\_makecsA}
+\_def\_makecs{\_def\_tmpa{}\_futurelet\_next\_makecsA}
\_def\_makecsA{\_ifcat a\_noexpand\_next \_ea\_makecsB \_else \_ea\_makecsF \_fi}
-\_def\_makecsB#1{\_addto\_tmp{#1}\_futurelet\_next\_makecsA}
-\_def\_makecsF{\_ifx\_tmp\_empty \_csstring\\%
- \_else \_ifcsname ,\_tmp\_endcsname \_link[cs:\_tmp]{\Blue}{\_csstring\\\_tmp}%
- \_else \_let\_next=\_tmp \_remfirstunderscore\_next
- \_ifx\_next\_empty \_let\_next=\_tmp \_fi
- \_ifcsname ,\_next\_endcsname \_link[cs:\_next]{\Blue}{\_csstring\\\_tmp}%
- \_else \_csstring\\\_tmp \_fi\_fi\_fi
+\_def\_makecsB#1{\_addto\_tmpa{#1}\_futurelet\_next\_makecsA}
+\_def\_makecsF{\_let\_tmpb=\_tmpa
+ \_ifx\_tmpa\_empty \_csstring\\%
+ \_else \_ifcsname ,\_tmpa\_endcsname \_trycs{el:\_tmpa}{\_intlink}%
+ \_else \_remfirstunderscoreordot\_tmpa
+ \_ifx\_tmpa\_empty \_let\_tmpa=\_tmpb \_fi
+ \_ifcsname ,\_tmpa\_endcsname \_trycs{el:\_tmpa}{\_intlink}%
+ \_else \_csstring\\\_tmpb \_fi\_fi\_fi
}
\_def\_processinput{%
\_let\_start=\_relax
@@ -96,8 +110,18 @@
\_endgroup \_ttskip
\_isnextchar\_par{}{\_noindent}%
}
-\_def\_remfirstunderscore#1{\_ea\_remfirstunderscoreA#1\_relax#1}
-\_def\_remfirstunderscoreA#1#2\_relax#3{\_if _#1\_def#3{#2}\_fi}
+\_def\_remfirstunderscoreordot#1{\_ea\_remfirstuordotA#1\_relax#1}
+\_def\_remfirstuordotA#1#2\_relax#3{\_if _#1\_def#3{#2}\_fi \_if\_string#1.\_def#3{#2}\_fi}
+
+ \_doc -----------------------------
+ By default the internal link is created by \`\_intlink` inside listing
+ mode. But you can define `\el:<csname>` which has precedence and it can
+ create an external link. The `\_tmpa` includes the name used in the link
+ and `\_tmpb` is the name to be printed. See \^`\_makecsF` above and the
+ example at the beginning of this section.
+ \_cod -----------------------------
+
+\_def\_intlink{\_link[cs:\_tmpa]{\Blue}{\_csstring\\\_tmpb}}
\_doc -----------------------------
The lines in the listing mode have a yellow background.
@@ -167,6 +191,16 @@
\_bf\_llaptoclink{#1}{#2}\_hfill \_pgn{#3}\_tocpar\_medskip}
\_doc -----------------------------
+ If this macro is loaded by \^`\load` then we need to initialize
+ catcodes using the `\_afteroad` macro.
+ \_cod -----------------------------
+
+\_def\_afterload{\_catcode`\<=13 \_catcode`\`=13 \_catcode`\.=11
+ \_wlog {doc.opm: catcodes of < and ` activated, catcode of . is letter.}%
+}
+\_catcode`.=11
+
+ \_doc -----------------------------
The \code{<something>} will be print as <something>.
\_cod -----------------------------
@@ -177,20 +211,11 @@
\_everyintt{\_catcode`\<=13 }
\_doc -----------------------------
- If this macro is loaded by \^`\load` then we need to initialize
- catcodes using the `\_afteroad` macro.
- \_cod -----------------------------
-
-\_def\_afterload{\_catcode`\<=13 \_catcode`\`=13 }
-
- \_doc -----------------------------
Main documentation points and hyperlinks to/from it.
Main documentation point: \code{\\`\\foo`}.
- User-level documentation point: \code{\\^`\\foo}, first occurence only.
+ User documentation point: \code{\\^`\\foo}, first occurence only.
The next occurrences are only links to the main documentation point.
- Link to user-level documentation point: \code{\\~`\\foo}.
- If user-level documentation point follows the main documentation point
- then use \code{\\_forwardlink\\`\\foo`}.
+ Link to user documentation point: \code{\\~`\\foo}.
\_cod -----------------------------
\_verbchar`
@@ -202,8 +227,6 @@
\_link[cs:^\_tmp]{\Red}{\_tt\_csstring\\\_tmp}\_else
{\_tt\Red\_csstring\\\_tmp}\_fi}%
}
-\_def\_forwardlink\`#1`{{\_slet{cs:^\_csstring#1}{relax}\`#1`}}
-
\_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}}%
@@ -216,6 +239,14 @@
\_futurelet\_next\_cslinkA
}
+ \_doc -----------------------------
+ The \`\fw` macro for forward links to user documentation point (given later)
+ is defined here.
+ \_cod -----------------------------
+
+\_def\_fw\`#1`{{\_slet{cs:^\_csstring#1}{}\`#1`}}
+\_public \fw ;
+
\_endcode %-------------------------------------------
\noindent
@@ -225,12 +256,13 @@ commands are defined after the file `doc.opm` is load by \^`\load`~`[doc]`.
The `\printcoc` starts reading of given `<filename>` from the second line.
The file is read in {\em the listing mode}.
The `\prindoctail` starts reading given `<filename>` from the
-first occurrence of the `\_encode`. The file is read
+first occurrence of the `\_endcode`. The file is read
in normal mode (like `\input <filename>`).
The {\em listing mode} prints the lines as a listing of a code. This mode is
finished when first {\visiblesp` \_doc`} occurs or first `\_endcode`
-occurs. At least two spaces must precede before such `\_doc`. On the other
+occurs. At least two spaces or one tab
+character must precede before such `\_doc`. On the other
hand, the `\_encode` must be at the left edge of the line without spaces.
If this rule is not met then the listing mode continues.
@@ -255,10 +287,6 @@ applied, the reading of the file opened by `\printdoc` is finished.
You cannot reach the end of the file (without `\_endcode`) in the listing
mode.
-The listing mode creates all control sequences which are listed in the
-index as an active link to the main documentation point of such control sequence
-and prints them in blue. Another text is printed in black.
-
The main documentation point is denoted by \code{\\`\\}`<sequence>`\code{`}
in red, for example \code{\\`\\foo`}.
The user documentation point is the first occurrence of
@@ -266,11 +294,63 @@ The user documentation point is the first occurrence of
There can be more such markups, all of them are hyperlinks to the main
documentation point.
And main documentation point is a hyperlink to the user documentation point
-if this point exists. Finally, the
+if this point precedes. Finally, the
\code{\\~`\\}`<sequence>`\code{`} (for example \code{\\~`\\foo`}) are
hyperlinks to the user documentation point.
+By default, the hyperink from main documentation point to the user
+documentation point is active only if it is backward link, i.e.\
+the main documentation point is given later. The reason is that we don't
+know if such user documentation point will exist when creating
+main documentation point and we don't want
+broken links. If you are sure that user documentation point will
+follow then use prefix \^`\fw` before~\code{\\`}, for example
+\code{\\fw\\`\\foo`} is main documentation point where the user
+documentation point is given later and forward hyperlink is created here.
+
+Control sequences and their page positions of main documentation points and user
+documentation points are saved to the index.
+
+The listing mode creates all control sequences which are listed in the
+index as an active link to the main documentation point of such control sequence
+and prints them in blue. Moreower, active links are control sequneces of the
+type `\_foo` or `\.foo` although the documentation mentions only `\foo`.
+Another text is printed in black.
+
+The listing mode is able to generate external links to another \OpTeX/-like
+documentation, if the macros `\,<csname>` and `\el:<csname>` are defined.
+The second macro should create a hyperlink using `\_tmpa`
+where the link name of the <csname> is saved and `\_tmpb` where the name of
+the <csname> to be printed is saved (`\tmpb` can include preceding `_` or
+`.` unlike `\_tmpa`). For example, suppose, that we have created
+`optex-doc.eref` file by:
+\begtt
+TEXINPUTS='.;$TEXMF/{doc,tex}//' optex optex-doc
+grep Xindex optex-doc.ref > optex-doc.eref
+\endtt
+The `.eref` file includes only `\_Xindex{<csname>}{}` lines from
+`optex-doc.ref` file. Then we can use following macros:
+\begtt
+\def\_Xindex#1#2{\sdef{,#1}{}\slet{el:#1}{optexdoclink}}
+\def\optexdoclink{%
+ \edef\extlink{url:\optexdocurl\csstring\#cs:\_tmpa}%
+ \_ea\_urlactive\_ea[\extlink]{\Cyan}{\csstring\\\_tmpb}}
+\def\optexdocurl{http://petr.olsak.net/ftp/olsak/optex/optex-doc.pdf}
+\isfile{optex-doc.eref}\iftrue \input{optex-doc.eref}\fi
+\endtt
+All `\el:<csname>`, where <csname> is from `optex-doc.ref`,
+have the same meaning: `\optexdoclink` in this example. And
+`\optexdoclink` creates the external link in `\Cyan` color.
+
+\secc Implementation
+
\endinput
+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.
+2021-05-03 External links fom listing mode allowed.
+2021-05-02 \_forwadlink replaced by \_fw, to be more consistent.
+2021-05-02 \fw introduced, \.foo -> \foo allowed.
2020-04-28 \levevmode in \^ macros added (bug fixed)
-2020-04-22 released \ No newline at end of file
+2020-04-22 released
diff --git a/Master/texmf-dist/tex/optex/base/f-erewhon.opm b/Master/texmf-dist/tex/optex/base/f-erewhon.opm
new file mode 100644
index 00000000000..11fc55330e1
--- /dev/null
+++ b/Master/texmf-dist/tex/optex/base/f-erewhon.opm
@@ -0,0 +1,31 @@
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
+
+\_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}}
+
+\_wlog{\_detokenize{%
+Modifiers:^^J
+ \caps ...... caps & small caps^^J
+ \slant ..... slanted Regular, Bold^^J%
+Variants:^^J
+ \sl ... slanted Regular, \sb ... slanted Bold^^J
+}}
+
+\_moddef \resetmod {\_fsetV caps={} \_fvars Regular Bold Italic Bolditalic }
+\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
+\_moddef \slant {\_fvars RegularSlanted BoldSlanted RegularSlanted BoldSlanted }
+\_private \slant ;
+\_famvardef \sl {\_slant\_rm}
+\_famvardef \bs {\_slant\_bf}
+
+\_initfontfamily % new font family must be initialized
+
+\_loadmath {[Erewhon-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/f-heros.opm b/Master/texmf-dist/tex/optex/base/f-heros.opm
index 2aec4b466a9..2195774b887 100644
--- a/Master/texmf-dist/tex/optex/base/f-heros.opm
+++ b/Master/texmf-dist/tex/optex/base/f-heros.opm
@@ -33,6 +33,7 @@ Modifiers:^^J
\_let\_bsansdigits=\_bfdigits
\_let\_bisansvariables=\_bivariables
\_let\_bisansgreek=\_bigreek
+ \_Umathchardef \triangle "0 "5 "25B3 \_Umathcode "25B3 "0 "5 "25B3
\_fi
\_endcode
@@ -81,12 +82,12 @@ name) and to optional font features appended. The Font Selection
System uses this macro at the primitive level in the following sense:
\begtt \catcode`\<=13
-\font \<selector> {\_fontnamegen} \_sizespec
+\font \<font-switch> {\_fontnamegen} \_sizespec
\endtt
%
Note that the extended `\font` syntax
-`\font\<selector> {<font name>:<font features>} <size spec.>` or
-`\font\<selector> {[<font file name>]:<font features>} <size spec.>`
+`\font\<font-switch> {<font name>:<font features>} <size spec.>` or
+`\font\<font-switch> {[<font file name>]:<font features>} <size spec.>`
is expected here.
\seccc Example 1
diff --git a/Master/texmf-dist/tex/optex/base/f-lmfonts.opm b/Master/texmf-dist/tex/optex/base/f-lmfonts.opm
index 3b1e0d0c403..5356680e9d3 100644
--- a/Master/texmf-dist/tex/optex/base/f-lmfonts.opm
+++ b/Master/texmf-dist/tex/optex/base/f-lmfonts.opm
@@ -115,7 +115,7 @@ Note: Text fonts support optical sizes, but LatinModern-Math only for scripts.^^
\_endcode
-\secc How to write the font family file with optical sizes
+\secc[optsizes] How to write the font family file with optical sizes
You can use \^`\_optname` macro when `\_fontnamegen` in expanded. This macro is fully
expandable and its input is `<internal-template>` and its output is a
diff --git a/Master/texmf-dist/tex/optex/base/fams-ini.opm b/Master/texmf-dist/tex/optex/base/fams-ini.opm
index 1d4d9f5c596..1d47504fc59 100644
--- a/Master/texmf-dist/tex/optex/base/fams-ini.opm
+++ b/Master/texmf-dist/tex/optex/base/fams-ini.opm
@@ -95,6 +95,9 @@
{ -,\caps: {\rm\bf\it\bi} }
\_famalias [BaskervilleF]
+\_faminfo [Erewhon] {Derived from Heuristica with slanted variants} {f-erewhon}
+ { -: {\rm\bf\it\bi\sl\bs} \caps: {\rm\bf\it\bi} }
+
\_famfrom {Georg Duffner, Octavio Pardo}
\_faminfo [EB Garamond] {Free variants of classical Garamond} {f-ebgaramond}
{ -,\caps,\medium,\medium\caps,\semibold,\semibold\caps: {\rm\bf\it\bi}
@@ -184,7 +187,7 @@ have the original Times purchased from Adobe then you can register your
declaration of Adobe's Times family in `fams-local.opm`. When a user writes
`\fontfam[Times]` then the original Times (not Termes) is used.
-The `fams-ini.opm` and `fams-local.opm` files use the macros
+The `fams-ini.opm` and `fams-local.opm` files can use the macros
\~`\_faminfo`, \~`\_famalias` and \~`\_famtext`. See the example from
`fams-ini.tex`:
diff --git a/Master/texmf-dist/tex/optex/base/fnotes.opm b/Master/texmf-dist/tex/optex/base/fnotes.opm
index 1445c57d4cd..62912d04001 100644
--- a/Master/texmf-dist/tex/optex/base/fnotes.opm
+++ b/Master/texmf-dist/tex/optex/base/fnotes.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \fnote {Footnotes, marginal notes OpTeX <2020-05-26>} % loaded in format
+\_codedecl \fnote {Footnotes, marginal notes OpTeX <2020-05-26>} % preloaded in format
\_doc -----------------------------
\`\_gfnotenum` is a counter which counts footnotes globally in the whole document.\nl
diff --git a/Master/texmf-dist/tex/optex/base/fonts-opmac.opm b/Master/texmf-dist/tex/optex/base/fonts-opmac.opm
index 3ae2f0c5e1c..025df761a59 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-opmac.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-opmac.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \typosize {Font managing macros from OPmac <2021-03-10>} % loaded in format
+\_codedecl \typosize {Font managing macros from OPmac <2021-03-10>} % preloaded in format
\_doc -----------------------------
\`\typosize` `[<font-size>/<baselineskip>]` sets given parameters.
diff --git a/Master/texmf-dist/tex/optex/base/fonts-preload.opm b/Master/texmf-dist/tex/optex/base/fonts-preload.opm
index 712730436c9..d56d5c0a78a 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-preload.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-preload.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \tenrm {Latin Modern fonts (EC) preloaded <2020-01-23>} % loaded in format
+\_codedecl \tenrm {Latin Modern fonts (EC) preloaded <2020-01-23>} % preloaded in format
% Only few text fonts are preloaded:
diff --git a/Master/texmf-dist/tex/optex/base/fonts-resize.opm b/Master/texmf-dist/tex/optex/base/fonts-resize.opm
index 7d1ce6cbedc..68ebf763db4 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-resize.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-resize.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \setfontsize {Font resizing macros <2021-04-17>} % preloaded in format
+\_codedecl \setfontsize {Font resizing macros <2021-05-02>} % preloaded in format
\_doc -----------------------------
The \`\setfontsize` `{<sizespec>}` saves the `<sizespec>` to the \`\_sizespec` macro.
@@ -33,75 +33,6 @@
\_public \setfontsize \defaultoptsize ;
\_doc -----------------------------
- \`\_resizefont` `{<variant-name>}\<font switch>`,
- resizes the font given by the variant.
- The <variant-name> is `rm` or `bf` or `it` or `bi`.
- The new <font-switch> is declared (roughly speaking) by:
- \begtt \catcode`<=13
- \_font <font switch> = <fontname of>\_ten<variant-name> \_sizepec
- \endtt
- If the \^`\_fontselector` is defined then it has priority before <font-switch>
- and the font is loaded by:
- \begtt \catcode`<=13
- \_ea\_font \_fontselector = <fontname of>\_ten<variant-name> \_sizepec
- \endtt
- The font is loaded by \`\_doresizefont``<font switch>`. This macro has
- meaning \`\_doresizetfmfont` in TFM mode and it switches to
- \^`\_doresizeunifont` when \^`\initunifonts` is used.\nl
- The `<fontname of>` is generated by the `\fontname` \TeX/ primitive where
- \`\_rfontskipat` removes the `at<dimen>` part of the `\fontname` output.
- The `<fontname of>` is generated differently in OTF mode, see
- \^`\_doresizeunifont` macro.\nl
- The \`\_whatresize` is defined as `<variant-name>`.\nl
- The \^`\_fontloaded``<font switch>` is a macro which can be used for
- post-processing when a font is loaded.
- \_cod -----------------------------
-
-\_def\_resizefont#1#2{%
- \_edef\_whatresize{#1}%
- \_ifx \_fontselector \_undefined
- \_doresizefont#2\_relax \_ea\_fontloaded \_csname _ten#1\_endcsname
- \_else \_ea\_doresizefont \_fontselector \_ea\_fontloaded \_fontselector \_fi
- \_lastmagsize=\_zo
- \_slet{_tryload#1}{_relax}%
-}
-\_def\_doresizetfmfont#1{\_logfont{#1}%
- \_ea\_font\_ea#1\_ea\_rfontskipat
- \_fontname \_cs{_ten\_whatresize} \_relax\_space \_sizespec \_relax
-}
-\_let\_doresizefont=\_doresizetfmfont
-\_def\_logfont#1{} % default is no logging of used fonts
-
-\_def\_rfontskipat#1{\_ifx#1"\_ea\_rfskipatX \_else\_ea\_rfskipatN\_ea#1\_fi}
-\_def\_rfskipatX #1" #2\_relax{"\_whichtfm{#1}"}
-\_def\_rfskipatN #1 #2\_relax{\_whichtfm{#1}}
-
- \_doc -----------------------------
- If a font is loaded by \^`\_resizefont` or \^`\resizethefont` then the
- \`\_fontloaded``<font switch>` is called immediately after it. If the font
- is loaded first then its `\skewchar` is equal to $-1$. We run
- \`\_newfontloaded``<font switch>` and set `\skewchar=-2` in this case.
- A user can define a `\_newfontloaded` macro. We are sure that
- `\_newfontloaded` macro is called only once for each instance of the font
- given by its name, OTF features and size specification. The `\skewchar` value is
- globally saved to the font (like `\fontdimen`). If it is used in math
- typesetting then it is set to a positive value.\nl
- The `\_newfontloaded` should be defined for micro-typographic configuration of
- fonts, for example. See
- \ulink[http://petr.olsak.net/optex/optex-tricks.html\#fontexpand]{OpTeX/ trick 0058}.
- \_cod -----------------------------
-
-\_def\_fontloaded #1{\_ifnum\_skewchar#1=-1 \_skewchar#1=-2 \_newfontloaded#1\_fi}
-\_def\_newfontloaded #1{}
-
- \_doc -----------------------------
- \`\fontdef` `<font switch>{<modifiers><variant selector>}`
- opens group, runs `<modifiers><variant selector>` (i.e.\ it runs `#2` parameter).
- The font switch `#1` saved in the \`\_fontselector` macro is re-declared
- because the variant selector runs the \^`\_resizefont`. Now, we need to
- keep the current meaning of the font switch `#1` but we must leave the
- opened group. This is done by the \`\_keepmeaning` macro.
- \nl
\`\fontlet` `<font switch A> <font switch B> <size spec>` does
\begtt \catcode`\<=13
\font <font switch A> = <fontname> <sizespec>
@@ -109,18 +40,10 @@
The `<fontname>` is extracted using the primitive command `\_fontname <font switch B>`.
\_cod -----------------------------
-\_def \_fontdef #1#2{\_begingroup
- \_ifx\_fontselector\_undefined \_def\_fontselector{#1}\_fi
- \_reloading #2%
- \_ea \_keepmeaning \_fontselector \_endgroup
-}
\_def\_fontlet#1#2{\_ifx #2=\_ea\_fontlet \_ea#1\_else
- \_ea\_font\_ea#1\_ea\_rfontskipat\_fontname#2 \_relax\_space \_fi
+ \_ea\_font\_ea#1\_ea\_rfontskipat\_fontname#2 \_relax\_space \_fi
}
-\_def \_keepmeaning #1#2{\_global\_let\_keepmeaningdata=#1%
- #2\_let#1=\_keepmeaningdata \_global\_let\_keepmeaningdata=\_undefined
-}
-\_public \fontdef \fontlet ;
+\_public \fontlet ;
\_doc -----------------------------
\`\newcurrfontsize` `<size spec>` sets current font size to the `<size spec>`
@@ -144,39 +67,6 @@
\_public \newcurrfontsize \resizethefont ;
\_doc -----------------------------
- The variant selector is defined by `\protected\def\XX{\_tryloadXX \_tenXX}`
- The `\_tryloadXX` can be in `\_relax` state if no font modifiers were
- declared. But normally it does \^`\_resizefont``{XX}\tenXX`. This meaning
- is activated by the \`\_reloading` macro.
- \_cod -----------------------------
-
-\_def\_reloading{\_loadf{rm}\_tenrm \_loadf{bf}\_tenbf
- \_loadf{it}\_tenit \_loadf{bi}\_tenbi
-}
-\_def\_loadf#1#2{\_sdef{_tryload#1}{\_ifmmode \_else \_resizefont{#1}#2\_fi}}
-\_def\_tryloadtt{\_resizefont{tt}\_tentt} % only in TFM mode
-
-\_let\_tryloadrm=\_relax
-\_let\_tryloadbf=\_relax
-\_let\_tryloadit=\_relax
-\_let\_tryloadbi=\_relax
-
- \_doc ----------------------------
- The font selection system allows to use \`\currvar`
- instead explicitly specified variant selector. The current variant
- is extracted from `\the\font` output which could be `\_tenXX` control
- sequence. Then `\currvar` expands to `\_rm` or `\_it` etc.
- \_cod ----------------------------
-
-\_protected \_def \_currvar{\_cs{_currvar:\_ea \_csstring \_the\_font}}
-\_sdef{_currvar:_tenrm}{\_rm}
-\_sdef{_currvar:_tenbf}{\_bf}
-\_sdef{_currvar:_tenit}{\_it}
-\_sdef{_currvar:_tenbi}{\_bi}
-\_sdef{_currvar:_tentt}{\_tt}
-\_public \currvar ;
-
- \_doc -----------------------------
The \`\_regtfm` `<font id> <optical size data>`
saves the <optical size data> concerned to `<font id>`.
The `<optical size data>` is in the form as shown below in the code where
@@ -232,14 +122,17 @@
\_regtfm lmri 0 ec-lmri7 7.5 ec-lmri8 8.5 ec-lmri9 9.5 ec-lmri10 11.1 ec-lmri12 *
\_regtfm lmtt 0 ec-lmtt8 8.5 ec-lmtt9 9.5 ec-lmtt10 11.1 ec-lmtt12 *
-\_setfontsize {at10pt} % default font size
-
\_endcode %---------------------------------------------------
\sec[setfontsize] Scaling fonts in text mode (low-level macros)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+This section describes single part of Font Selection System: resizing fonts
+to various sizes. This feature is available in both modes: TFM mode
+(initialized when format starts) and OTF mode (after \~`\fontfam` or
+\~`\initunifonts` is used).
+
\secc The `\setfontsize` macro
The \^`\setfontsize` `{<size spec>}`
@@ -310,28 +203,6 @@ these features by the \^`\initunifonts` command explicitly, for example:
\cyklop The 12 pt text is here
\endtt
-\secc[fontdef] The \code{\\fontdef} declarator
-
-You can declare `\<newfont>` by the \~`\fontdef` command.
-
-\begtt \catcode`\<=13
- \fontdef \<newfont> {<font modifiers> \<variant-selector>}
- example:
- \fontdef \bigfont {\setfontsize{at15pt}\bf}
-\endtt
-%
-This command runs `<font modifiers> \<variant-selector>` in an internal group and sets the
-resulting selected font as `\<newfont>`.
-
-The resulting `\<newfont>` declared by \~`\fontdef` is \"fixed font switch"
-independent of \^`\setfontsize` and other font modifiers. More exactly, it is
-a fixed font switch when it is used but it can depend on the current font
-modifiers and font family and given font modifiers when it is declared.
-
-The parameter of the \~`\fontdef` macro must be exactly finished by the
-variant selector. More information about font modifiers
-and variant selectors are in the section~\ref[fontsystem].
-
\secc[fontlet] The \code{\\fontlet} declarator
We have another command for scaling: \^`\fontlet` which can resize
@@ -370,13 +241,13 @@ of the `\defaultoptsize` register and such font is scaled by the specified
Font collections with optical sizes must be registered by the
\^`\_regtfm` for `tfm` files or \^`\_regoptsizes` for Unicode fonts.
-\OpTeX/ registers 8bit Latin Moder fonts in the format (`fonts-resize.opm` file)
+\OpTeX/ registers 8bit Latin Modern fonts in the format
and OTF Latin Modern fonts in the `f-lmfonts.opm` file.
-
-\secc Implementation notes
+See also section~\ref[optsizes].
\_endinput
+2021-05-02 better concept of doc, moving parts to fonts-select
2021-04-17 \_fontloaded, \_newfontloaded introduced
2020-04-17 \resizethefont introduced
2020-03-17 released
diff --git a/Master/texmf-dist/tex/optex/base/fonts-select.opm b/Master/texmf-dist/tex/optex/base/fonts-select.opm
index eab114fcc48..5dab510453f 100644
--- a/Master/texmf-dist/tex/optex/base/fonts-select.opm
+++ b/Master/texmf-dist/tex/optex/base/fonts-select.opm
@@ -1,6 +1,131 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \fontfam {Fonts selection system <2021-04-22>} % preloaded in format
+\_codedecl \fontfam {Fonts selection system <2021-05-23>} % preloaded in format
+
+ \_doc -----------------------------
+ The variant selectors \^`\rm`, \^`\bf`, \^`\it`, \^`\bi`, \^`\tt`
+ are defined (roughly speaking) by
+ \begtt \catcode`\<=13
+ \def\<XX> {\_tryload<XX>\_ten<XX>}
+ \endtt
+ where <XX> is \"internal variant name" `rm` or `bf` or `it` or `bi` or `tt`.
+ There are five \"internal font switchers" `\_tenrm`, `\_tenbf`, `\_tenit`,
+ `\_tenbi` and `\_tentt`. They are used almost for all fonts selected by the Fonts
+ Selection System. For example, `\_tenbf` is the switcher for bold variant of
+ the current family in the current font context. The \^`\bf` macro is defined as
+ `\_tryloadbf \_tenbf`. If the font context (font family, font size, features)
+ is not changed, then `\_tryloadbf` is `\relax` and `\_tenbf` font switcher selects
+ given font. If the font context is changed, then `\_tryloadbf` is re-defined (see
+ \^`\_reloading` macro) to load new bold varinat of the font using \^`\_resizefont`
+ The loaded font is saved to `\_tenbf` switcher and `\_tryloadbf` returns
+ back to the `\relax` meaning. So, `\bf` macro loads
+ new font with current font context and then selects it by `\_tenbf`
+ selector. The word \"ten" is used here
+ only for historical reason; the font can be at arbitrary size.
+ \nl
+ The \`\_reloading` macro is run whenever font context is changed.
+ It activates `\_tryload<XX>` for `<XX>` in `rm`, `bf`, `it` and `bi`.
+ The \`\_loadf``{<XX>}\ten<XX>` is processed for this.
+ \nl
+ The \`\_tryloadtt` is implemented differently because we want to keep
+ family independence for `\tt` macro, see section~\ref[tt].
+ So, `\_tryloadtt` is defined constantly as \"loading `\tt` font" and it is
+ not re-defined to `\relax`. On the other hand, `\_tryloadtt` is
+ re-defined in the \^`\initunifonts` macro or when used
+ \~`\famvardef``\tt`.
+ \_cod -----------------------------
+
+\_def\_reloading{\_loadf{rm}\_tenrm \_loadf{bf}\_tenbf \_loadf{it}\_tenit \_loadf{bi}\_tenbi}
+\_def\_loadf#1#2{\_sdef{_tryload#1}{\_ifmmode \_else \_resizefont{#1}#2\_fi}}
+\_def\_tryloadtt{\_resizefont{tt}\_tentt} % only in TFM mode
+
+\_let\_tryloadrm=\_relax
+\_let\_tryloadbf=\_relax
+\_let\_tryloadit=\_relax
+\_let\_tryloadbi=\_relax
+
+ \_doc ----------------------------
+ The Font Selection system allows to use \`\currvar`
+ instead explicitly specified variant selector. The current variant
+ is extracted from `\the\font` output which could be `\_ten<XX>` control
+ sequence. Then `\currvar` expands to `\_rm` or `\_it` etc.
+ \_cod ----------------------------
+
+\_protected \_def \_currvar{\_cs{_currvar:\_ea \_csstring \_the\_font}}
+\_sdef{_currvar:_tenrm}{\_rm}
+\_sdef{_currvar:_tenbf}{\_bf}
+\_sdef{_currvar:_tenit}{\_it}
+\_sdef{_currvar:_tenbi}{\_bi}
+\_sdef{_currvar:_tentt}{\_tt}
+\_public \currvar ;
+
+ \_doc -----------------------------
+ The \`\_resizefont` `{<variant-name>}\<font switch>` is the heart of the
+ Fonts Selection System. It resizes the font given by the variant with
+ respect to the current font context and sets a new <font-switch>.
+ The <variant-name> is `rm` or `bf` or `it` or `bi` or `tt`.
+ The new <font-switch> is declared (roughly speaking) by:
+ \begtt \catcode`<=13
+ \_font <font switch> = <fontname of>\_ten<variant-name> \_sizepec % in TFM mode
+ \_font <font switch> = {\_fontnamegen} \_sizespec % in OTF mode
+ \endtt
+ The font is loaded by \`\_doresizefont``<font switch>`. This macro has
+ meaning \`\_doresizetfmfont` in TFM mode (default in format) and it
+ switches to \^`\_doresizeunifont` when \^`\initunifonts` is used.\nl
+ The `<fontname of>` is generated by the `\fontname` \TeX/ primitive where
+ \`\_rfontskipat` removes the `at<dimen>` part of the `\fontname` output.\nl
+ The \`\_whatresize` is defined as `<variant-name>`.\nl
+ The \^`\_fontloaded``<font switch>` is a macro which can be used for
+ post-processing when a font is loaded.
+ \_cod -----------------------------
+
+\_def\_resizefont#1#2{%
+ \_edef\_whatresize{#1}\_doresizefont#2\_relax \_fontloaded #2%
+ \_lastmagsize=\_zo
+ \_if t\_ignoresecond#1\_else \_slet{_tryload#1}{_relax}\_fi
+}
+\_def\_doresizetfmfont#1{\_logfont{#1}%
+ \_ea\_font\_ea#1\_ea\_rfontskipat
+ \_fontname \_cs{_ten\_whatresize} \_relax\_space \_sizespec \_relax
+}
+\_let\_doresizefont=\_doresizetfmfont
+\_def\_logfont#1{} % default is no logging of used fonts
+
+\_def\_rfontskipat#1{\_ifx#1"\_ea\_rfskipatX \_else\_ea\_rfskipatN\_ea#1\_fi}
+\_def\_rfskipatX #1" #2\_relax{"\_whichtfm{#1}"}
+\_def\_rfskipatN #1 #2\_relax{\_whichtfm{#1}}
+
+ \_doc -----------------------------
+ \`\_doresizeunifont``<font-switch>` implements the OTF mode of
+ loading fonts \^`\_doresizefont`.
+ There is a fallback to TFM mode if \^`\_fontnamegen` is not defined.\nl
+ The \^`\_fontnamegen` expands to the font name/file:font-features
+ depending on the current font context.
+ \_cod -----------------------------
+
+\_def\_doresizeunifont #1{\_logfont{#1}%
+ \_ifx\_fontnamegen\_undefined \_doresizetfmfont#1\_else
+ \_font#1={\_fontnamegen} \_sizespec \_relax \_setwsp#1\_relax
+ \_fi
+}
+
+ \_doc -----------------------------
+ If a font is loaded by \^`\_resizefont` or \^`\resizethefont` then the
+ \`\_fontloaded``<font switch>` is called immediately after it. If the font
+ is loaded first then its `\skewchar` is equal to $-1$. We run
+ \`\_newfontloaded``<font switch>` and set `\skewchar=-2` in this case.
+ A user can define a `\_newfontloaded` macro. We are sure that
+ `\_newfontloaded` macro is called only once for each instance of the font
+ given by its name, OTF features and size specification. The `\skewchar` value is
+ globally saved to the font (like `\fontdimen`). If it is used in math
+ typesetting then it is set to a positive value.\nl
+ The `\_newfontloaded` should be defined for micro-typographic configuration of
+ fonts, for example. See
+ \ulink[http://petr.olsak.net/optex/optex-tricks.html\#fontexpand]{OpTeX/ trick 0058}.
+ \_cod -----------------------------
+
+\_def\_fontloaded #1{\_ifnum\_skewchar#1=-1 \_skewchar#1=-2 \_newfontloaded#1\_fi}
+\_def\_newfontloaded #1{}
\_doc -----------------------------
\`\initunifonts` macro extends \LuaTeX's font capabalities,
@@ -10,30 +135,25 @@
from \LaTeX's `luatexbase` namespace, we provide our own replacements.
Moreover, `\initunifont` switches with
the \^`\_doresizefont` macro to OTF mode which is represented by the
- macro \`\_doresizeunifont`. This mode includes
- a fallback to TFM mode if \^`\_fontnamegen` is not defined.
- Finally, `\initunifonts` sets itself to relax because we don't want to do
+ macro \^`\_doresizeunifont`.
+ Finally, \^`\initunifonts` sets itself to relax because we don't want to do
this work twice.\nl
- \`\_ttunifont` is default font for `\tt` variant if
- `f-lmfonts.opm` (or another font file where `\tt` is declared) is not loaded.
+ \`\_ttunifont` is default font for `\tt` variant.
+ User can re-define it or use \^`\famvardef``\tt`.
\_cod -----------------------------
\_def\_initunifonts {%
- \directlua{%
+ \_directlua{%
require('luaotfload-main')
luaotfload.main()
}%
\_gdef\_rfskipatX ##1" ##2\_relax{"##1"}%
\_global\_let \_doresizefont=\_doresizeunifont
- \_gdef\_tryloadtt {\_fontdef\_tentt{\_let\_fontnamegen=\_ttunifont\_rm}}%
+ \_gdef\_tryloadtt {\_begingroup \_let\_fontnamegen\_ttunifont % \tt uses \_ttunifont
+ \_resizefont{tt}\_tentt\_relax \_ea\_endgroup \_ea\_let \_ea\_tentt \_the\_tentt}%
\_global\_let \_initunifonts=\_relax % we need not to do this work twice
\_global\_let \initunifonts=\_relax
}
-\_gdef\_doresizeunifont #1{\_logfont{#1}%
- \_ifx\_fontnamegen\_undefined \_doresizetfmfont#1\_else
- \_font#1={\_fontnamegen} \_sizespec \_relax \_setwsp#1\_relax
- \_fi
-}
\_def\_ttunifont{[lmmono10-regular]:\_fontfeatures-tlig;}
\_public \initunifonts ;
@@ -72,31 +192,6 @@
}
\_doc -----------------------------
- \`\_regoptsizes` `<internal-template> <left-output>?<right-output> <resizing-data>`
- prepares data for using by the \`\_optname` `<internal-template>` macro.
- The data are saved to the `\_oz:<internal-template>` macro.
- When the `\_optname` is expanded then the data are scanned by the macro
- \`\_optnameA` `<left-output>?<right-output> <mid-output> `\code{<}`<size>`
- in the loop.\nl
- \`\_optfontalias` `{<template A>}{<template B>}` is defined as
- `\let\_oz:<templateA>=\_oz:<templateB>`.
- \_cod -----------------------------
-
-\_def\_regoptsizes #1 #2?#3 #4*{\_sdef{_oz:#1}{#2?#3 #4* }}
-\_def\_optname #1{\_ifcsname _oz:#1\_endcsname
- \_ea\_ea\_ea \_optnameA \_csname _oz:#1\_ea\_endcsname
- \_else \_failedoptname{#1}\_fi
-}
-\_def\_failedoptname #1{optname-fails:(#1)}
-\_def\_optnameA #1?#2 #3 <#4 {\_ifx*#4#1#3#2\_else
- \_ifdim\_optsize<#4pt #1#3#2\_optnameC
- \_else \_afterfifi \_optnameA #1?#2 \_fi\_fi
-}
-\_def\_optnameC #1* {\_fi\_fi}
-\_def\_afterfifi #1\_fi\_fi{\_fi\_fi #1}
-\_def\_optfontalias #1#2{\_slet{_oz:#1}{_oz:#2}}
-
- \_doc -----------------------------
\`\_fvars` `<rm-template> <bf-template> <it-template> <bi-template>`
saves data for usage by the `\_currV` macro. If a template is only dot
then previous template is used (it can be used if the font family doesn't
@@ -199,10 +294,40 @@
\_public \moddef ;
\_doc -----------------------------
- The \`\famvardef` `\<XX> {<data>}`
+ \`\fontdef` `<font-switch> {<data>}` does:
+ \begtt \catcode`\<=13
+ \begingroup <data> \ea\endgroup \ea\let \ea<font-switch> \the\font
+ \endtt
+ It means that font modifiers used in <data> are applied in the group and the
+ resulting selected font (current at the end of the group) is set to the
+ <font-switch>.
+ We want to declare <font-switch> in its real name directly by `\font` primitive in
+ order to save this name for reporting later (in overfull messages, for
+ example). This is the reason why \^`\_loadf` is re-defined locally here.
+ The <variant selector> used in <data> expands to `\_tryload<XX> \_ten<XX>`.
+ The modified `\_tryload<XX>`
+ removes `\_ten<XX>` and does `\_resizefont{<XX>}<font-swith><font-switch>`,
+ i.e.\ a font is loaded using real `<font-switch>` name and then it is selected
+ as the current font.
+ \_cod -----------------------------
+
+\_def\_fontdef #1#2{\_begingroup
+ \_def\_loadf##1##2{\_sdef{_tryload##1}####1{\_resizefont{##1}#1#1}}%
+ \_reloading \_let\_reloading=\_relax
+ #2\_ea\_endgroup \_ea\_let \_ea#1\_the\_font
+}
+\_public \fontdef ;
+
+ \_doc -----------------------------
+ The \`\famvardef` `\<XX> {<data>}` does, roughly speaking:
+ \begtt \catcode`\<=13
+ \def \<XX> {\fontdef\_ten<XX> {<data>}\_ten<XX>}
+ \endtt
+ but the macro `\<XX>` is declared as family-dependent.
+ So, the real \^`\famvardef` `\<XX> {<data>}`
uses analogical trick like \^`\moddef` with
- the \^`\_famdepend` macro. The auxiliary
- \`\_famvardefA` `\<XX> \_ten<XX> \_tryload<XX> {<data>}` is used.
+ the \^`\_famdepend` macro. The \^`\famvardef` loads
+ the auxiliary \`\_famvardefA` `\<XX> \_ten<XX> \_tryload<XX> {<data>}`.
It does:
\begitems
* `\def \_tryload:<currfam>:<XX> {`\^`\fontdef`` \_ten<XX> {<data>}}` loads font `\_ten<XX>`,
@@ -213,6 +338,9 @@
`\famvardef\tt` behaves somewhat differently: it doesn't re-define the
`\tt` macro which is defined as `\_tryloadtt \_tentt` in sections~\ref[math-preload]
and~\ref[unimath-codes]. It only re-defines the internal `\_tryloadtt` macro.
+ Note, that you cannot use `\tt` inside `\famvardef\tt`. So, new `\tt`
+ macro does not load \^`\_ttunifont` but uses font from a standard variant
+ rm, bf, it or bi with given font context.
\_cod -----------------------------
\_def\_famvardef#1{\_edef\_tmp{\_csstring#1}%
@@ -339,25 +467,34 @@
\_doc -----------------------------
The font features are managed in the \`\_fontfeatures` macro.
- They have their implicit values saved in the \`\_defaultfontfeatures`
- and the \`\setff` `{<features>}`
- can add next font features. If there is the same font feature as the newly
- added one then the old value is removed from the `\_fontfeatures` list.
+ It expands to
+ \begitems
+ * \`\_defaultfontfeatures` -- used for each font,
+ * \`\_ffadded` -- features added by \^`\setff`,
+ * \`\_ffcolor` -- features added by \^`\setfontcolor`,
+ * \`\_ffletterspace` -- features added by \^`\setletterspace`,
+ * \`\_ffwordspace` -- features added by \^`\setwordspace`.
+ \enditems
+ The macros \^`\_ffadded`, \^`\_ffcolor`, \^`\_ffletterspace`,
+ \^`\_ffwordspace` are empty by default.
\_cod -----------------------------
+\_def \_fontfeatures{\_defaultfontfeatures\_ffadded\_ffcolor\_ffletterspace\_ffwordspace}
\_def \_defaultfontfeatures {+tlig;}
+\_def \_ffadded{}
+\_def \_ffcolor{}
+\_def \_ffletterspace{}
+\_def \_ffwordspace{}
+
+ \_doc -----------------------------
+ The \`\setff` `{<features>}` adds next font features to \^`\_ffadded`.
+ Usage \^`\setff{}` resets empty set of all \^`\_ffadded` features.
+ \_cod -----------------------------
+
\_def \_setff #1{%
- \_ifx^#1^\_let \_fontfeatures=\_defaultfontfeatures
- \_else \_edef\_fontfeatures{\_fontfeatures #1;}\_fi
+ \_ifx^#1^\_def\_ffadded{}\_else \_edef\_ffadded{\_ffadded #1;}\_fi
\_reloading
}
-\_setff {} % default font features: +tlig;
-\_def\_removefeature #1{%
- \_isinlist\_fontfeatures{#1}\_iftrue
- \_def\_tmp ##1#1##2;##3\_relax{\_def\_fontfeatures{##1##3}}%
- \_ea \_tmp \_fontfeatures \_relax
- \_fi
-}
\_public \setff ;
\_doc -----------------------------
@@ -370,22 +507,18 @@
`\fontdimen` registers).
\_cod -----------------------------
-\_def\_savedfontcolor{}
-\_def\_savedletterspace{}
-\_def\_savedwsp{}
-
-\_def \_setfontcolor #1{\_removefeature{color=}%
- \_edef\_tmp{\_calculatefontcolor{#1}}%
- \_ifx\_tmp\_empty \_else \_edef\_fontfeatures{\_fontfeatures color=\_tmp;}\_fi
- \_reloading
+\_def \_setfontcolor #1{%
+ \_edef\_tmp{\_calculatefontcolor{#1}}%
+ \_ifx\_tmp\_empty \_def\_ffcolor{}\_else \_edef\_ffcolor{color=\_tmp;}\_fi
+ \_reloading
}
-\_def \_setletterspace #1{\_removefeature{letterspace=}%
- \_if^#1^\_else \_edef\_fontfeatures{\_fontfeatures letterspace=#1;}\_fi
- \_reloading
+\_def \_setletterspace #1{%
+ \_if^#1^\_def\_ffletterspace{}\_else \_edef\_ffletterspace{letterspace=#1;}\_fi
+ \_reloading
}
\_def \_setwordspace #1{%
- \_if^#1^\_def\_setwsp##1{}\_removefeature{+Ws}%
- \_else \_def\_setwsp{\_setwspA#1/}\_setff{+Ws}\_fi
+ \_if^#1^\_def\_setwsp##1{}\_def\_ffwordspace{}%
+ \_else \_def\_setwsp{\_setwspA#1/}\_def\_ffwordspace{+Ws;}\_fi
\_reloading
}
\_def\_setwsp #1{}
@@ -402,6 +535,33 @@
\_public \setfontcolor \setletterspace \setwordspace ;
+ \_doc -----------------------------
+ \`\_regoptsizes` `<internal-template> <left-output>?<right-output> <resizing-data>`
+ prepares data for using by the \`\_optname` `<internal-template>` macro.
+ The data are saved to the `\_oz:<internal-template>` macro.
+ When the `\_optname` is expanded then the data are scanned by the macro
+ \`\_optnameA` `<left-output>?<right-output> <mid-output> `\code{<}`<size>`
+ in the loop.\nl
+ \`\_optfontalias` `{<template A>}{<template B>}` is defined as
+ `\let\_oz:<templateA>=\_oz:<templateB>`.
+ \_cod -----------------------------
+
+\_def\_regoptsizes #1 #2?#3 #4*{\_sdef{_oz:#1}{#2?#3 #4* }}
+\_def\_optname #1{\_ifcsname _oz:#1\_endcsname
+ \_ea\_ea\_ea \_optnameA \_csname _oz:#1\_ea\_endcsname
+ \_else \_failedoptname{#1}\_fi
+}
+\_def\_failedoptname #1{optname-fails:(#1)}
+\_def\_optnameA #1?#2 #3 <#4 {\_ifx*#4#1#3#2\_else
+ \_ifdim\_optsize<#4pt #1#3#2\_optnameC
+ \_else \_afterfifi \_optnameA #1?#2 \_fi\_fi
+}
+\_def\_optnameC #1* {\_fi\_fi}
+\_def\_afterfifi #1\_fi\_fi{\_fi\_fi #1}
+\_def\_optfontalias #1#2{\_slet{_oz:#1}{_oz:#2}}
+
+\_setfontsize {at10pt} % default font size
+
\_endcode %---------------------------------------------------
@@ -532,7 +692,7 @@ family selectors and defined font macros doing something with fonts.
* Font switches can be decared by `\font` primitive (see
section~\ref[fontprimitive]) or by \^`\fontlet` command (see
section~\ref[fontlet]) or by \~`\fontdef` command (see
- sections~\ref[fontdef2] and~\ref[fontdef]).
+ sections~\ref[fontdef2]).
When the font switches are used then they select the given font independently
of the current font context. They can be used
in `\output` routine (for example) because we need to set fixed fonts
@@ -566,14 +726,19 @@ All declaration commands mentioned here: `\font`, `\fontlet`, `\fontdef`, `\famv
\secc[fontdef2] The `\fontdef` declarator in detail
-The general format for \^`\fontdef` usage is
+You can declare `\<font-switch>` by the \^`\fontdef` command.
\begtt \catcode`\<=13
-\fontdef\<font switch> {\<family selector> <font modifiers> \<variant selector>}
+\fontdef\<font-switch> {\<family selector> <font modifiers> \<variant selector>}
\endtt
%
where `\<family selector>` and `<font modifiers>` are optional and
`\<variant selector>` is mandatory.
+The resulting `\<font-switch>` declared by \~`\fontdef` is \"fixed font switch"
+independent of the font context. More exactly, it is
+a fixed font switch when it is {\em used}. But it can depend on the current font
+modifiers and font family and given font modifiers when it is {\em declared}.
+
The \^`\fontdef` does the following steps.
It pushes the current font context to a stack, it does modifications of the font
context by given `\<family selector>` and/or `<font modifiers>` and it
@@ -582,9 +747,6 @@ it is assigned to the declared `\<font switch>` (like `\font` primitive does
it). Finally, `\fontdef` pops the font context stack, so the current
font context is the same as it was before `\fontdef` is used.
-More about `\fontdef` command including examples is written in
-section~\ref[fontdef].
-
\secc[famvardef] The `\famvardef` declarator
@@ -596,8 +758,8 @@ macro has similar syntax as \^`\fontdef`:
%
where `\<family selector>` and `<font modifiers>` are optional and
`\<variant selector>` is mandatory.
-The `\<new variant selector>` should be used in the same sense as `\rm`,
-`\bf` etc. It can be used as the final command in next
+The `\<new variant selector>` declared by `\famvardef` should be used in the same
+sense as `\rm`, `\bf` etc. It can be used as the final command in next
\^`\fontdef` or \^`\famvardef` declarators
too. When the `\<new variant selector>` is used in the normal text then it does
the following steps: pushes current font context to a stack, modifies font
@@ -848,6 +1010,8 @@ Luaotfload documentation for more information.
\endinput
+2021-05-23 concept of \_fontfeatures macro re-implemented
+2021-05-02 simpler \_resizefont, better concept of doc, moving parts from fonts-resize
2021-04-22 \_ffonum introduced
2021-04-19 \setwordspace: parameter format {/A/B/C} implemented.
2021-02-25 \_ttunifont introduced
diff --git a/Master/texmf-dist/tex/optex/base/hyperlinks.opm b/Master/texmf-dist/tex/optex/base/hyperlinks.opm
index 95fae3846bd..ef205f3aa23 100644
--- a/Master/texmf-dist/tex/optex/base/hyperlinks.opm
+++ b/Master/texmf-dist/tex/optex/base/hyperlinks.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \ulink {Hyperlinks <2021-04-17>} % preloaded in format
+\_codedecl \ulink {Hyperlinks <2021-05-14>} % preloaded in format
\_doc ----------------------------
\`\dest``[<type>:<spec>]` creates a destination of internal links. The
@@ -25,78 +25,81 @@
\_public \dest ;
\_doc ----------------------------
- \`\link``[<type>:<spec>]{<color>}{<text>}` creates an internal link to \^`\dest`
- with the same `<type>:<spec>`. You can have more links with the same
- `<type>:<spec>` but only one `\dest` in the document. If \^`\hyperlinks`
- command is not used, then `\link` only prints `<text>` else its meaning is set to
- `\_linkactive`.
- The \`\_linkactive` is implemented by `\_pdfstartlink...\_pdfendlink`
- primitives. The `<color>` is the color of the link text generated by
- the `\_linkactive` macro.
- The `<color>` parameter can be overwritten by definition of
- `\_<type>linkcolor`. For example `\def\_toclinkcolor{\Red}` means that
- links from table of contents are in red. This is similar concept as
- `\_def\_tocborder`.
+ Each hyperlink is created internally by \`\_xlink``{<type>}{<spec>}{<color>}{<text>}`.
+ This macro expands to `\_quitvmode{<text>}` by default, i.e.\ no active
+ hyperlink is created, only <text> is printed in horizontal mode.
+ If \^`\hyperlinks` is used, then `\_xlink` gets meaning of
+ \`\_xlinkactive` and hyperlinks are created using `\pdfstartlink`,
+ `\pdfendlink` primitives. The <text> has given <color> only when
+ hyperlink is created. But if `\_<type>linkcolor` is defined, it has
+ precedence.
\nl
- \`\ilink``[<type>:<spec>]{<text>}` is equivalent to `\_link` but
- the `<color>` is used from \^`\hyperlinks` declaration
- (or it is overwriten by `\def\_<type>linkcolor`).
+ The \`\_linkdimens` macro declares the dimensions of link area.
\nl
- \`\_linkdimens` are default dimensions of the link area.
- \_cod ----------------------------
+ A specific action can be defined for each link <type> by the macro
+ `\_<type>action{<spec>}`. \OpTeX/ defines only \`\_urlaction``{<url>}`.
+ The default link action (when `\_<type>action` is not defined) is
+ `goto mame{<type>:<spec>}` (creates an internal link). It is declared in the
+ \`\_linkactions``{<type>}{<spec>}` macro.
+ \nl
+ The `\_pdfstartlink` primitive uses `attr{\_pdfborder{<type>}}`. The
+ \`\_pdfborder``{<type>}` macro expands to `/C[? ? ?] /Border[0 0 .6]` if the
+ `\_<type>border` macro (i.e.\ \`\_refborder`, \`\_citeborder`, \`\_tocborder`,
+ \`\_pgborder`, \`\_urlborder`, \`\_fntborder` or \`\_fnfborder`)
+ is defined.
+ \_cod
-\_protected\_def\_linkactive[#1:#2]#3#4{\_leavevmode\_pdfstartlink \_linkdimens
- attr{\_pdfborder{#1}} goto name{#1:#2}\_relax
- {\_localcolor\_trycs{_#1linkcolor}{#3}#4}\_pdfendlink
+\_protected\_def\_xlinkactive#1#2#3#4{\_quitvmode
+ \_pdfstartlink \_linkdimens attr{\_pdfborder{#1}}\_linkactions{#1}{#2}\_relax
+ {\_localcolor\_trycs{_#1linkcolor}{#3}#4}\_pdfendlink
}
-\_protected\_def\_link[#1]#2#3{\_leavevmode{#3}}
-\_def\_ilink[#1]#2{\_link[#1]{}{#2}}
+\_protected\_def\_xlink#1#2#3#4{\_quitvmode{#4}}
+
\_def\_linkdimens{height.9em depth.3em}
-\_public \ilink \link ;
- \_doc ----------------------------
- \`\ulink``[<url>]{<text>}` creates external link. It prints only the `<text>` by default but
- the \^`\hyperlinks` declaration defines it as \`\_urlactive``[url:<url>]{<text>}`.
- The external link is created by the `\_pdfstartlink...\pdfendlink` primitives.
- The `<url>` is detokenized with `\escapechar=-1` before it is used, so
- `\%`, `\#` etc. can be used in the `<url>`.
- \_cod ----------------------------
+\_def\_linkactions#1#2{\_ifcsname _#1action\_endcsname
+ \_lastnamedcs{#2}\_else goto name{#1:#2}\_fi}
+\_def\_urlaction #1{user{/Subtype/Link/A <</Type/Action/S/URI/URI(#1)>>}}
-\_protected\_def\_urlactive[#1:#2]#3#4{\_leavevmode{\_escapechar=-1
- \_pdfstartlink \_linkdimens attr{\_pdfborder{#1}}%
- user{/Subtype/Link/A <</Type/Action/S/URI/URI(\_detokenize{#2})>>}\_relax
- {\_localcolor\_trycs{_#1linkcolor}{#3}#4}\_pdfendlink}%
+\_def\_pdfborder#1{\_ifcsname _#1border\_endcsname
+ /C [\_csname _#1border\_endcsname] /Border [0 0 .6]\_else /Border [0 0 0]\_fi
}
-\_def\_ulink[#1]#2{\_leavevmode{#2}}
-\_public \ulink ;
- \_doc ----------------------------
- The `\_pdfstartlink` primitive uses `attr{\_pdfborder{<type>}}` in its parameter
- (see \^`\_linkactive` or \^`\_urlactive` macros). The \`\_pdfborder``{<type>}`
- macro expands to `/C[? ? ?] /Border[0 0 .6]` if the
- `\_<type>border` macro (i.e.\ \`\_refborder`, \`\_citeborder`, \`\_tocborder`,
- \`\_pgborder`, \`\_urlborder`, \`\_fntborder` or \`\_fnfborder`)
- is defined. Users can define it in
- order to create colored frames around active links. For example
- `\def\_tocborder{1 0 0}` causes red frames in TOC (not printed, only visible
- in PDF viewers).
+ \_doc ------------------------------
+ \`\link``[<type>:<spec>]{<color>}{<text>}` creates a link. It is
+ kept here for backward compatibility and it is
+ equivalent to \^`\_xlink{<type>}{<spec>}{<color>}{<text>}`.
+ If `\_<type>action` is not defined then
+ `\link` creates internal link do the \^`\dest[<type>:<spec>]`.
+ You can have more links with the same `<type>:<spec>` but only one \^`\dest`
+ in the document.
+ \nl
+ \`\ilink``[<type>:<spec>]{<text>}` is equivalent to \^`\link` but
+ the `<color>` is used from \^`\hyperlinks` declaration
+ (or it is overwriten by `\def\_<type>linkcolor`).
+ \nl
+ \`\ulink``[<url>]{<text>}` creates external link.
+ The `<url>` is detokenized with `\escapechar=-1` before it is used, so
+ `\%`, `\#` etc. can be used in the `<url>`.
\_cod ----------------------------
-\_def\_pdfborder#1{\_ifcsname _#1border\_endcsname
- /C [\_csname _#1border\_endcsname] /Border [0 0 .6]\_else /Border [0 0 0]\_fi
-}
+\_def\_link[#1:#2]{\_xlink{#1}{#2}}
+\_def\_ilink[#1:#2]#3{\_xlink{#1}{#2}\_ilinkcolor{#3}}
+\_def\_ulink[#1]#2{{\_escapechar=-1 \_ea}\_expanded
+ {\_noexpand\_xlink{url}{\_detokenize{#1}}}\_elinkcolor{#2}}
+
+\_public \ilink \ulink \link ;
\_doc ----------------------------
- \`\hyperlinks``{<ilink_color>}{<ulink_color>}` activates `\dest`, `\link`,
- `\ilink`, `\ulink` in order they create links. These macros are redefined
- here to their \"active" version.
+ \`\hyperlinks``{<ilink_color>}{<ulink_color>}` activates `\dest`, `\xlink`,
+ in order they create links.
\_cod ----------------------------
\_def\_hyperlinks#1#2{%
- \_let\_dest=\_destactive \_let\_link=\_linkactive
- \_def\_ilink[##1]##2{\_link[##1]{#1}{##2}}%
- \_def\_ulink[##1]##2{\_urlactive[url:##1]{#2}{##2}}%
- \_public \dest \ilink \ulink \link ;%
+ \_let\_dest=\_destactive \_let\_xlink=\_xlinkactive
+ \_let\_ilinkcolor=#1%
+ \_let\_elinkcolor=#2%
+ \_public \dest \xlink ;%
}
\_public \hyperlinks ;
@@ -104,38 +107,64 @@
\`\url``{<url>}` does approximately the same as \^`\ulink``[<url>]{<url>}`, but
more work is done before the `\ulink` is processed. The link-version of <url>
is saved to `\_tmpa` and the printed version in `\_tmpb`. The printed
- version is modified in order to set breakpoints to special places of the
- `<url>`. For example `//` is replaced by `\_urlskip/\_urlskip/\_urlbskip`
- where `\urlskip` adds a small nonbreakable glue between these two slashes and
- before them and `\_urlbskip` adds a breakable glue after them.
+ version is processed in four steps: 1.~the `\|` are replaced by `[||]` (we
+ suppose that such string does not exist in any URL). 2.~it is detokenized with
+ `\escapechar=-1`. 3.~muti-strings and spaces are replaced by strings in
+ braces `{...}`. 4.~internal penalties and skips are put between characters
+ using \`\_urlA`, \`\_urlB` and \`\_urlC`. The step~4 do following:
+ The \`\_urlxskip` is inserted between each pair of \"normal characters",
+ i.e.\ characters not declared by `\sdef{_ur:<character>}`.
+ The special characters declared by `\sdef{_ur:<character>}` are replaced
+ by the body of their corresponding macro.
+ The \`\_urlskip`, \`\_urlbskip`, \`\_urlgskip`
+ are typical skips used for special characters, their meaning is
+ documented in the code below. You can change them.
+ Default values: penalty 9990 is inserted between each pair of normal
+ chararacters, penalty 100 is inserted after special charcters, nobreak before special
+ characters. The URL can be broken at any place using these default
+ values. If you want to disable breaking between normal characters, say
+ `\let\_urlxskip=\nobreak`.
\nl
The text version of the `<url>` is printed in \`\_urlfont`.
\_cod ----------------------------
\_def\_url#1{{%
\_def\_tmpa{#1}\_replstring\_tmpa {\|}{}%
- {\_escapechar=-1 \_ea}\_ea\_edef\_ea\_tmpa\_ea{\_detokenize\_ea{\_tmpa}}%
- \_def\_tmpb{#1}\_replstring\_tmpb {\|}{\_urlbskip}%
- \_replstring\_tmpb {//} {{\_urlskip\_urlslashslash\_urlbskip}}%
- \_replstring\_tmpb {/} {{\_urlskip/\_urlbskip}}%
- \_replstring\_tmpb {.} {{\_urlskip.\_urlbskip}}%
- \_replstring\_tmpb {?} {{\_urlskip?\_urlbskip}}%
- \_replstring\_tmpb {=} {{\_urlskip=\_urlbskip}}%
- \_ea\_replstring\_ea\_tmpb \_ea{\_string &} {{\_urlbskip\_char`\& \_urlskip}}%
- \_ea\_replstring\_ea\_tmpb \_ea{\_bslash|} {{\_penalty0}}%
- \_ea\_ulink \_ea[\_tmpa] {\_urlfont\_tmpb\_null}%
+ \_def\_tmpb{#1}\_replstring\_tmpb {\|}{[||]}%
+ {\_escapechar=-1 \_ea}\_ea\_edef\_ea\_tmpb\_ea{\_detokenize\_ea{\_tmpb}}%
+ \_replstring\_tmpb{[||]}{{gb|}}%
+ \_replstring\_tmpb{ }{{ }}%
+ \_replstring\_tmpb{://}{{://}}%
+ \_ea\_ulink \_ea[\_ea{\_tmpa}] {\_urlfont \_ea\_urlA\_tmpb\_end}%
}}
-\_def\_urlfont{\_tt}
-\_def\_urlskip{\_null\_nobreak\_hskip0pt plus0.05em\_relax}
-\_def\_urlbskip{\_penalty100 \_hskip0pt plus0.05em\_relax}
-\_def\_urlslashslash{/\_urlskip/}
+\_def\_urlA#1{\_ifx\_end#1\_else \_urlC{}{#1}\_fi}
+\_def\_urlB#1{\_ifx\_end#1\_else \_urlC{\_urlxskip}{#1}\_fi}
+\_def\_urlC#1#2{%
+ \_ifcsname _ur:#2\_endcsname \_lastnamedcs \_ea\_ea\_ea \_urlA
+ \_else #1#2\_ea\_ea\_ea \_urlB \_fi
+}
+\_sdef{_ur:://}{\_urlskip:\_urlskip/\_urlskip/\_urlbskip}
+\_sdef{_ur:/}{\_urlskip/\_urlbskip}
+\_sdef{_ur:.}{\_urlskip.\_urlbskip}
+\_sdef{_ur:?}{\_urlskip?\_urlbskip}
+\_sdef{_ur:=}{\_urlskip=\_urlbskip}
+\_sdef{_ur:-}{\_urlskip-\_urlbskip}
+\_sdef{_ur:&}{\_urlskip\_char`\&\_urlbskip}
+\_sdef{_ur:gb|}{\_urlgskip}
+
+\_def\_urlfont{\_tt} % url font
+\_def\_urlxskip{\_penalty9990\_hskip0pt plus0.03em\_relax} % skip between normal characters
+\_def\_urlskip{\_null\_nobreak\_hskip0pt plus0.1em\_relax} % skip before :// / . ? = - &
+\_def\_urlbskip{\_penalty100 \_hskip0pt plus0.1em\_relax} % skip after :// / . ? = - &
+\_def\_urlgskip{\_penalty-500\_relax} % "goodbreak" penalty generated by \|
\_public \url ;
\_endcode % ----------------------------------------
-There are four types of internal links and one type of external link:
+There are six types of internal links and one type of external link used
+in \OpTeX/. They are used in the format <type>:<spec>.
\begitems
* `ref:<label>` -- the destination is created when `\label[<label>]` is used,
@@ -146,20 +175,36 @@ There are four types of internal links and one type of external link:
see also the section \ref[output].
* `cite:<bibpart>/<bibnum>` -- the destination is created in bibliography reference,
see section \ref[bib].
+* `fnt:<gfnotenum>` -- link form text to footnote, see also section~\ref[fnotes].
+* `fnf:<gfnotenum>` -- link from footnote to text, see also section~\ref[fnotes].
* `url:<url>` -- used by `\url` or `\ulink`,
see also the end of this section.
\enditems
-The `<tocrefnum>`, `<gpageno>`, and `<bibnum>` are numbers starting from one and
-globally incremented by one in the whole document. The registers \^`\tocrefnum`,
-\^`\gpageno` and \^`\bibnum` are used for these numbers.
+The `<tocrefnum>`, `<gpageno>`, `<bibnum>`, and `<gfnotenum>` are numbers starting
+from one and globally incremented by one in the whole document. The registers \^`\tocrefnum`,
+\^`\gpageno`, \^`\bibnum`, and \^`\_gfnotenum` are used for these numbers.
When a chap/sec/secc title is prefixed by `\label[<label>]`, then both types
of internal links are created at the same destination place:
`toc:<tocrefnum>` and `ref:<label>`.
+The color for active links can be declared by `\def\_<type>linkcolor`, the
+border around link can be declared by `\def\_<type>border`. These macros are
+not declared by default, so color for active links are given only by
+\^`\hyperlinks` macro and borders are invisible.
+For example `\def\_toclinkcolor{\Red}` means that links from table of
+contents are in red.
+Another example `\def\_tocborder{1 0 0}` causes red frames in TOC
+(not printed, only visible in PDF viewers).
+
+
\_endinput
+2021-05-14 \_xlink introduced, \link, \ilink, \ulink re-implemented.
+2021-05-12 \url: triplet :// instead //, \_urlslashslash removed.
+2021-05-11 \url reimplemented, \_urlxskip added.
+2021-04-30 \url: \detokenize of \tmpb added, bug fix.
2021-04-17 attr{\_pdfborder{...}} instead expanding \_pdfborder to attr{...}
2021-04-02 The possibility of \def\_toclinkcolor introduced, \localcolor moved
2021-01-27 \public \link added to \hyperlinks, bug fixed.
diff --git a/Master/texmf-dist/tex/optex/base/languages.opm b/Master/texmf-dist/tex/optex/base/languages.opm
index ff9373b7202..19b1813edd8 100644
--- a/Master/texmf-dist/tex/optex/base/languages.opm
+++ b/Master/texmf-dist/tex/optex/base/languages.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \_mtext {Languages <2021-01-21>} % preloaded in format
+\_codedecl \_mtext {Languages <2021-05-23>} % preloaded in format
\_doc -----------------------------
Only four words are generated by \OpTeX/ macros: \"Chapter",
@@ -50,12 +50,12 @@
\_def \_monthw #1 #2 #3 #4 #5 #6 #7 {%
\_sdef{_mt:m1:#1}{#2}\_sdef{_mt:m2:#1}{#3}\_sdef{_mt:m3:#1}{#4}%
- \_sdef{_mt:m4:#1}{#5}\_sdef{_mt:m5:#1}{#5}\_sdef{_mt:m6:#1}{#5}%
+ \_sdef{_mt:m4:#1}{#5}\_sdef{_mt:m5:#1}{#6}\_sdef{_mt:m6:#1}{#7}%
\_monthwB #1
}
\_def \_monthwB #1 #2 #3 #4 #5 #6 #7 {%
\_sdef{_mt:m7:#1}{#2}\_sdef{_mt:m8:#1}{#3}\_sdef{_mt:m9:#1}{#4}%
- \_sdef{_mt:m10:#1}{#5}\_sdef{_mt:m11:#1}{#5}\_sdef{_mt:m12:#1}{#5}%
+ \_sdef{_mt:m10:#1}{#5}\_sdef{_mt:m11:#1}{#6}\_sdef{_mt:m12:#1}{#7}%
}
\_monthw en January February March April May June
@@ -182,6 +182,7 @@
\_endcode % -------------------------------------
+2021-05-23 \_monthw: bug fix
2021-01-21 more robust quotes in outlines
2020-12-05 bib phrases moved here
2020-04-29 Obrazek -> Abbildung: bug fixed
diff --git a/Master/texmf-dist/tex/optex/base/makeindex.opm b/Master/texmf-dist/tex/optex/base/makeindex.opm
index e5f7b4032e4..64ff2ca228f 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 <2021-02-15>} % loaded in format
+\_codedecl \makeindex {Makeindex and sorting <2021-02-15>} % preloaded in format
\_doc -----------------------------
\^`\makeindex` implements sorting algorithm at \TeX/ macro-language level.
diff --git a/Master/texmf-dist/tex/optex/base/math-macros.opm b/Master/texmf-dist/tex/optex/base/math-macros.opm
index efb777a30af..8a956ee2d0e 100644
--- a/Master/texmf-dist/tex/optex/base/math-macros.opm
+++ b/Master/texmf-dist/tex/optex/base/math-macros.opm
@@ -321,6 +321,7 @@
\_protected\_def\cot {\_mathop{\_rm cot}\_nolimits}
\_protected\_def\coth {\_mathop{\_rm coth}\_nolimits}
%\_protected\_def\sec {\_mathop{\_rm sec}\_nolimits} % \sec is section
+\_protected\_def\secant {\_mathop{\_rm sec}\_nolimits}
\_protected\_def\csc {\_mathop{\_rm csc}\_nolimits}
\_protected\_def\max {\_mathop{\_rm max}}
\_protected\_def\min {\_mathop{\_rm min}}
diff --git a/Master/texmf-dist/tex/optex/base/multicolumns.opm b/Master/texmf-dist/tex/optex/base/multicolumns.opm
index bf5b05f7db1..1a32db62b7b 100644
--- a/Master/texmf-dist/tex/optex/base/multicolumns.opm
+++ b/Master/texmf-dist/tex/optex/base/multicolumns.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \begmulti {Balanced columns <2020-03-26>} % preloaded in format
+\_codedecl \begmulti {Balanced columns <2021-05-20>} % preloaded in format
\_doc -----------------------------
This code is documented in detail in the \"\TeX/book naruby", pages 244--246,
@@ -26,7 +26,7 @@
\_newcount\_mullines
\_def\_begmulti #1 {\_par\_bgroup\_wipeepar\_multiskip\_penalty0 \_def\_Ncols{#1}
- \_setbox6=\_vbox\_bgroup \_let\_setxhsize=\_relax \_penalty0
+ \_setbox6=\_vbox\_bgroup\_bgroup \_let\_setxhsize=\_relax \_penalty-99
%% \hsize := column width = (\hsize+\colsep) / n - \colsep
\_advance\_hsize by\_colsep
\_divide\_hsize by\_Ncols \_advance\_hsize by-\_colsep
@@ -34,7 +34,7 @@
\_def\par{\_ifhmode\_endgraf\_global\_advance\_mullines by\_prevgraf\_fi}%
}
\_def\_endmulti{\_vskip-\_prevdepth\_vfil
- \_ea\_egroup\_ea\_baselineskip\_the\_baselineskip\_relax
+ \_ea\_egroup\_ea\_egroup\_ea\_baselineskip\_the\_baselineskip\_relax
\_dimen0=.8\_maxdimen \_tmpnum=\_dimen0 \_divide\_tmpnum by\_baselineskip
\_splittopskip=\_baselineskip
\_setbox1=\_vsplit6 to0pt
@@ -111,4 +111,5 @@
\_endcode % -------------------------------------
-
+2021-05-20 Colors inside \begmulti...\endmuti, bug fixed
+2020-03-26 Introduced
diff --git a/Master/texmf-dist/tex/optex/base/optex.ini b/Master/texmf-dist/tex/optex/base/optex.ini
index d50ffeccf74..be081adac88 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.02 Apr.2021}
+\def\optexversion{1.03 Jun.2021}
\def\fmtname{OpTeX}
\let\fmtversion=\optexversion
diff --git a/Master/texmf-dist/tex/optex/base/optex.lua b/Master/texmf-dist/tex/optex/base/optex.lua
index 2d83f38ed6f..3738acaefbb 100644
--- a/Master/texmf-dist/tex/optex/base/optex.lua
+++ b/Master/texmf-dist/tex/optex/base/optex.lua
@@ -324,11 +324,9 @@ callback_register("mlist_to_hlist", function(head, ...)
elseif new_head ~= true then
head = new_head
end
-
-- mlist_to_hlist means either added functions or standard luatex behavior
-- of node.mlist_to_hlist (handled by default function)
head = callback.call_callback("mlist_to_hlist", head, ...)
-
-- post_mlist_to_hlist_filter
new_head = callback.call_callback("post_mlist_to_hlist_filter", head, ...)
if new_head == false then
diff --git a/Master/texmf-dist/tex/optex/base/styles.opm b/Master/texmf-dist/tex/optex/base/styles.opm
index 534eb13663c..deb47d6930f 100644
--- a/Master/texmf-dist/tex/optex/base/styles.opm
+++ b/Master/texmf-dist/tex/optex/base/styles.opm
@@ -26,9 +26,7 @@
\_public \boxlines ;
\_doc -----------------------------
- The \`\report` and \`\letter` style initialization macros are defined here.
- \nl
- The `\letter` defines \`\address` and \`\subject` macros.
+ The \`\report` style initialization macro is defined here.
\_cod -----------------------------
\_def\_report{
@@ -43,6 +41,15 @@
\_parindent=1.2em \_iindent=\_parindent \_ttindent=\_parindent
\_footline={\_global\_footline={\_hss\_rmfixed\_folio\_hss}}
}
+
+ \_doc -----------------------------
+ The \`\letter` style initialization macro is defined here.
+
+ The `\letter` defines \`\address` and \`\subject` macros.
+
+ See the files `demo/op-letter-*.tex` for usage examples.
+ \_cod -----------------------------
+
\_def\_letter{
\_def\_address{\_vtop\_bgroup\_boxlines \_parskip=0pt \_let\par=\_egroup}
\_def\_subject{{\_bf \_mtext{subj}: }}
@@ -65,56 +72,7 @@
}
\_public \slides ;
-
\_endcode % -------------------------------------
-The example of `\letter` style document follows:
-
-\begtt %-----------------------------------------------------------------
-
-\letter
-\fontfam[bonum]
-\chyph
-
-\address
- Vážený pan
- Mgr. Bořek Byrokrat
- ředitel Ústavu pro další možnosti
- Úřední 789
- 123 45 Praha 1
-
-\hfill V Praze dne \today
-
-\subject Žádost o možnost další možnosti
-
-Vážený pane řediteli
-
-na základě Vašeho dopisu č.j.~123456/78-dat a elektronické výzvy si dovoluji
-Vás požádat o prozkoumání mé možnosti další možnosti.
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
-veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
-commodo consequat.
-
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
-veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
-commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
-esse cillum dolore eu fugiat nulla pariatur.
-
-S úctou
-
-\hfill \address
- {\it Petr Olšák}
- specialista na \TeX{}
- Ulice 12345
- Praha 13
-
-\bye
-
-\endtt %---------------------------------------------------------------------
-
-\endinput
-
2021-03-10 \ifmmode* added to \adef*
2020-03-28 released
diff --git a/Master/texmf-dist/tex/optex/base/table.opm b/Master/texmf-dist/tex/optex/base/table.opm
index f32bf311abd..b29aabbf4a7 100644
--- a/Master/texmf-dist/tex/optex/base/table.opm
+++ b/Master/texmf-dist/tex/optex/base/table.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \table {Basic macros for OpTeX <2021-04-12>} % preloaded in format
+\_codedecl \table {Basic macros for OpTeX <2021-06-03>} % preloaded in format
\_doc -----------------------------
The result of the \`\table``{<declaration>}{<data>}` macro is inserted into
@@ -58,10 +58,9 @@
\_doc -----------------------------
The \`\_tableB` saves `<data>` to `\_tmpb`
- and does four \^`\replstring`s to prefix each macro \^`\crl` (etc.)
- by `\_crcr`. The reason is: we want to use macros that scan its parameter
- to the delimiter written in the right part of the table item declaration.
- See \^`\fS` for example. The `\crcr` cannot be hidden in another macro in this case.
+ and does \^`\replstring`s to prefix each macro \^`\crl` (etc.)
+ by `\_crcr`. See \^`\_tabreplstrings`. It cannot be used in a `\table` in
+ another `\table`, so \^`\_tabreplstrings` is set to `\relax` locally.
The `\tabskip` value is saved for places between columns
into the \`\_tabskipmid` macro. Then it runs
@@ -73,8 +72,13 @@
`<converted declaration>` immediately after each column declarator.
If `pxto` keyword was used, then we set the virtual unit \^`\tsize` to
- `\hsize` first. Then the first attempt of the table is created in box 0.
- Then the \^`\tsize` is re-calculated using `\wd0` and the real table is
+ `-\hsize` first. Then the first attempt of the table is created in box 0.
+ All collums where `p{..\tsize}` is used, are created as empty in this first
+ pass. So, the `\wd0` is the width of all other columns.
+ The \^`\_tsizesum` includes the sum of \^`\tsize`'s in `\hsize` units
+ after firts pass. The desired table width is stored in the `\_tmpdim`, so
+ `\_tmpdim-\_wd0` is the rest which have to be filled by \^`\tsize`s.
+ Then the \^`\tsize` is re-calculated and the real table is
printed by `\halign` in the second pass.
If no `pxto` keyword was used, then we print the table using `\halign`
@@ -96,13 +100,17 @@
\_cod -----------------------------
\_long\_def\_tableB #1{\_egroup \_def\_tmpb{#1}%
- \_replstring\_tmpb{\crl}{\_crcr\crl}\_replstring\_tmpb{\crll}{\_crcr\crll}%
- \_replstring\_tmpb{\crli}{\_crcr\crli}\_replstring\_tmpb{\crlli}{\_crcr\crlli}%
- \_replstring\_tmpb{\crlp}{\_crcr\crlp}%
+ \_tablereplstrings \_let\_tablereplstrings=\_relax
\_edef\_tabskipmid{\_the\_tabskip}\_tabskip=\_tabskipl
\_ifpxto
- \_tsize=\_hsize \_setbox0 = \_vbox{\_tablepxpreset \_halign \_tableC}%
- \_tsize=\_dimexpr\_hsize-(\_wd0-\_tmpdim)\_relax
+ \_edef\_tsizes{\_global\_tsizesum=\_the\_tsizesum \_gdef\_noexpand\_tsizelast{\_tsizelast}}%
+ \_tsizesum=\_zo \_def\_tsizelast{0}%
+ \_tsize=-\_hsize \_setbox0=\_vbox{\_tablepxpreset \_halign \_tableC}%
+ \_advance\_tmpdim by-\_wd0
+ \_ifdim \_tmpdim >\_zo \_else \_tsizesum=\_zo \_fi
+ \_ifdim \_tsizesum >\_zo \_tsize =\_expr{\_number\_hsize/\_number\_tsizesum}\_tmpdim
+ \_else \_tsize=\_zo \_fi
+ \_tsizes % retoring values if there is a \table pxto inside a \table pxto.
\_setbox0=\_null \_halign \_tableC
\_else
\_halign\_tablew \_tableC
@@ -111,6 +119,19 @@
\_def\_tableC{\_ea{\_ea\_bgroup\_the\_tabdata\_egroup\_tabskip=\_tabskipr\_cr
\_scantextokens\_ea{\_tmpb\_crcr}}}
+ \_doc -----------------------------
+ \`\_tabreplstrings` replaces each `\crl` etc. to `\crcr\crl`.
+ The reason is: we want to use macros that scan its parameter
+ to a delimiter written in the right part of the table item declaration.
+ The `\crcr` cannot be hidden in another macro in this case.
+ \_cod -----------------------------
+
+\_def\_tablereplstrings{%
+ \_replstring\_tmpb{\crl}{\_crcr\crl}\_replstring\_tmpb{\crll}{\_crcr\crll}%
+ \_replstring\_tmpb{\crli}{\_crcr\crli}\_replstring\_tmpb{\crlli}{\_crcr\crlli}%
+ \_replstring\_tmpb{\crlp}{\_crcr\crlp}%
+}
+
\_def\_tablepxpreset{} % can be used to de-activate references to .ref file
\_newbox\_tstrutbox % strut used in table rows
\_newtoks\_tabdata % the \halign declaration line
@@ -211,10 +232,34 @@
\_def\_tabdeclarec{\_the\_tabiteml\_hfil##\_unsskip\_hfil\_the\_tabitemr}
\_def\_tabdeclarel{\_the\_tabiteml\_relax##\_unsskip\_hfil\_the\_tabitemr}
\_def\_tabdeclarer{\_the\_tabiteml\_hfil##\_unsskip\_the\_tabitemr}
-\_def\_paramtabdeclarep#1{\_the\_tabiteml
- \_vtop{\_hsize=#1\_relax \_baselineskip=\_normalbaselineskip
- \_lineskiplimit=\_zo \_noindent \_hskip\_zo \_relax ##\_unsskip
- \_ifvmode\_vskip\_dp\_tstrutbox \_else\_lower\_dp\_tstrutbox\_hbox{}\_fi}\_the\_tabitemr}
+\_def\_paramtabdeclarep#1{\_the\_tabiteml\_vtop{\_hsize=#1\_relax \_partabitem{##}}\_the\_tabitemr}
+
+ \_doc -----------------------------
+ \`\_partabitem``{<data>}` prints the table item in a paragraph format.
+ This macro solves two things. Fist, the setting of parameters for the
+ paragraph formatting. The `\hsize` and parameters from macros
+ \^`\fC`, \^`\fR` etc. are set already.\nl
+ Second thing: if the `\hsize` is negative then first pass of `pxto` table is processed.
+ We print nothing in such case but we advance the \`\_tsizesum`.
+ The auxiliary macro \`\_tsizelast` is used to do advancing
+ only in the first row of the table.
+ \^`\_tsizesum` and \^`\_tsizelast` are initialized in the \^`\_tableB` macro.\nl
+ \`\_partabitemA``{<data>}` only copies <data>, but it is redefined by \^`\fS`.
+ \_cod -----------------------------
+
+\_newdimen \_tsizesum
+\_def \_tsizelast{0}
+\_long\_def\_partabitem#1{%
+ \_ifdim\_hsize<0pt
+ \_ifnum\_tsizelast<\_colnum \_global\_advance\_tsizesum by-\_hsize
+ \_xdef\_tsizelast{\_the\_colnum}\_fi
+ \_else
+ \_baselineskip=\_normalbaselineskip
+ \_lineskiplimit=\_zo \_noindent \_hskip\_zo \_relax \_partabitemA{#1}\_unsskip
+ \_ifvmode\_vskip\_dp\_tstrutbox \_else\_lower\_dp\_tstrutbox\_hbox{}\_fi
+ \_fi
+}
+\_let\_partabitemA=\_useit
\_doc -----------------------------
Users put optional spaces around the table item typically, i.e.\ they write
@@ -238,9 +283,9 @@
\_def\_fR{\_leftskip=0pt plus 1fill \_relax}
\_def\_fC{\_leftskip=0pt plus1fill \_rightskip=0pt plus 1fill \_relax}
\_def\_fX{\_leftskip=0pt plus1fil \_rightskip=0pt plus-1fil \_parfillskip=0pt plus2fil \_relax}
-\_long\_def\_fS #1\_unsskip{\_noindent \_setbox0 =\_vbox{\_noindent #1\_endgraf \_ea}%
- \_ifnum\_prevgraf=1 \_hfil \_fi #1\_unsskip
-}
+\_def\_fS{\_long\_def\_partabitemA##1{%
+ \_setbox0=\_vbox{\_noindent ##1\_endgraf \_ea}\_ifnum\_prevgraf=1 \_hfil \_fi ##1%
+}}
\_public \fL \fR \fC \fX \fS ;
\_doc -----------------------------
@@ -469,14 +514,14 @@ The first `c` column is variable width (it gets the width of the most wide item)
and the resting space to given `\hsize` is filled by the `p` column.
You can declare more than one `p{<coefficient>\tsize}` columns in the table
-when `pxto` keyword is used. The total sum of <coefficinets> must be exactly one.
-For example,
+when `pxto` keyword is used.
\begtt \catcode`\<=13
-\table pxto13cm {r p{.3\tsize} p{.5\tsize} p{.2\tsize} l}{<data>}
+\table pxto13cm {r p{3.5\tsize} p{2\tsize} p{\tsize} l}{<data>}
\endtt
%
-This gives the ratio of widths of individual paragraphs in the table.
+This gives the ratio of widths of individual paragraphs in the table
+3.5\,:\,2\,:\,1.
\secc `\eqbox`: boxes with equal width across the whole document
@@ -512,6 +557,9 @@ after the second one.
\_endinput
+2021-06-03 \fS corrected, re-implemented.
+2021-06-02 \table in \table allowed, bug fixed.
+2021-06-01 pxto: sum of \tsize's allowed different than 1
2021-04-12 p declarator: \hskip0pt added to allow first word hyphenated
2021-03-09 \_tablepxpreset introduced
2021-02-15 \_expandafter -> \_ea
diff --git a/Master/texmf-dist/tex/optex/base/usebib.opm b/Master/texmf-dist/tex/optex/base/usebib.opm
index 9dbd4752411..0b515fcfba3 100644
--- a/Master/texmf-dist/tex/optex/base/usebib.opm
+++ b/Master/texmf-dist/tex/optex/base/usebib.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \MakeReference {Reading bib databases <2021-04-13>} % loaded on demand by \usebib
+\_codedecl \MakeReference {Reading bib databases <2021-04-30>} % loaded on demand by \usebib
\_doc -----------------------------
Loading the `librarian.tex` macro package. See `texdoc librarian`
@@ -17,7 +17,7 @@
\_let\newwrite=\_newwrite
\_private \BibFile \ReadList \SortList \SortingOrder \NameCount \AbbreviateFirstname
- \CreateField \RetrieveFieldInFor \RetrieveFieldIn ;
+ \CreateField \RetrieveFieldInFor \RetrieveFieldIn \RetrieveField ;
\_doc -----------------------------
The `\usebib` command.
@@ -367,6 +367,7 @@ character is sorted before `A`.
History:
--------
+2021-04-30 \RetrieveField declared as private, bug fixed.
2021-04-13 \bibpart implemented
2021-04-13 \_bibgl introduced (used by \slides)
2021-03-12 \_citelistB added before first test.
diff --git a/Master/texmf-dist/tex/optex/pkg/emoji.opm b/Master/texmf-dist/tex/optex/pkg/emoji.opm
index 9053953bff0..3db7849d974 100644
--- a/Master/texmf-dist/tex/optex/pkg/emoji.opm
+++ b/Master/texmf-dist/tex/optex/pkg/emoji.opm
@@ -6,9 +6,9 @@
% The \emoji{<name>} command is available, see texdoc emoji (from
% corresponding LaTeX package).
-\_namespace{emoji}
+\_codedecl \emoji {Emotikons from the TwemojiMozilla.ttf font}
-\_codedecl \.emoji {Emotikons from the TwemojiMozilla.ttf font}
+\_namespace{emoji}
\_doc -----------------------------
Font TwemojiMozilla.ttf is loaded. The font feature +colr is needed.
diff --git a/Master/texmf-dist/tex/optex/pkg/mte.opm b/Master/texmf-dist/tex/optex/pkg/mte.opm
new file mode 100644
index 00000000000..e0687001d6d
--- /dev/null
+++ b/Master/texmf-dist/tex/optex/pkg/mte.opm
@@ -0,0 +1,685 @@
+% This is macro package used by OpTeX, see http://petr.olsak.net/optex
+% mte.opm, Petr Olšák <petr@olsak.net>, 2021
+% See end of the file for more information
+
+\_codedecl \enablemte {MicroTypographic Extension <2021-05-23>}
+\_namespace{mte}
+
+ \_doc -------------------
+ First, we define default protrusion values. They are
+ saved in the macros
+ \^`\.AlphabetPR`, \^`\.alphabetPR`, \^`\.digitsPR`, \^`\.punctPR`,
+ \^`\.quotPR`, \^`\.othersPR`
+ for regular and bold fonts. The analogous macros
+ \^`\.AlphabetPI`, \^`\.alphabetPI`, \^`\.digitsPI`, \^`\.punctPI`,
+ \^`\.quotPI`, \^`\.othersPI` store data
+ for italic and bold italic fonts.
+ We are using long names of these macros (without the dot shortcut in the
+ code) because user can copy these macros to his/her macro file and do modifications.
+ \nl
+ User (or a font family file) can define other values, for example by
+ `\def\_mte_quotPR{...}`. If such definition is done before
+ loading this package, it has precedence. This is the reason why we are
+ using \`\.trydef` which defines given macro only if it is not defined
+ already.
+ \_cod -------------------
+
+\_def\.trydef #1{\_ifx#1\_undefined \_afterfi{\_def#1}\_else \_ea\_ignoreit \_fi}
+
+ \_doc
+ We want to save size of the following macros with data tables, so we don't write
+ `[<code of char>] =` but only \`\_mte`~`<char> =`. We use \OpTeX/ name space for
+ \^`\_mte` (no package name space) because user may copy these macros to
+ other macro files and modify them. We hope that the name \^`\_mte` will
+ be never used in another meaning in \OpTeX/.
+ \_cod
+
+\_def\_mte #1{[\_immediateassignment\_tmpnum=`#1 \_the\_tmpnum]}
+
+ \_doc --------------------
+ The protrusion data follow.
+ The values are coefficients of total width of declared character.
+ First value gives left protrusion, second value is right protrusion.
+ \`\.AlphabetPR`
+ \_cod --------------------
+
+\.trydef \_mte_AlphabetPR {% Alphabets, Protrusion, Regular fonts
+ \_mte A = {.05,.05},
+ \_mte Æ = {.05, 0},
+ \_mte F = {0 ,.05},
+ \_mte J = {.05, 0},
+ \_mte K = {0 ,.05},
+ \_mte L = {0 ,.05},
+ \_mte T = {.05,.05},
+ \_mte V = {.05,.05},
+ \_mte W = {.05,.05},
+ \_mte X = {.05,.05},
+ \_mte Y = {.05,.05},
+}
+ \_doc
+ \`\.alphabetPR`
+ \_cod
+
+\.trydef \_mte_alphabetPR {% alphabets, Protrusion, Regular fonts
+ \_mte k = {0 ,.05},
+ \_mte r = {0 ,.05},
+ \_mte t = {0 ,.07},
+ \_mte v = {.05,.05},
+ \_mte w = {.05,.05},
+ \_mte x = {.05,.05},
+ \_mte y = {.05,.07},
+}
+ \_doc
+ \`\.digitsPR`
+ \_cod
+
+\.trydef \_mte_digitsPR {% digits, Protrusion, Regular fonts
+ \_mte 0 = {0 ,.05},
+ \_mte 1 = {.1 ,.2 },
+ \_mte 2 = {.05,.05},
+ \_mte 3 = {.05,.05},
+ \_mte 4 = {.07,.07},
+ \_mte 5 = {0 ,.05},
+ \_mte 6 = {0 ,.05},
+ \_mte 7 = {.05,.1 },
+ \_mte 8 = {0 ,.05},
+ \_mte 9 = {0 ,.05},
+ [0xF731] = {.1, .1}, % /one.oldstyle
+ [0xF732] = {.05, .05}, % /two.oldstyle
+ [0xF733] = {.03, .08}, % /three.oldstyle
+ [0xF734] = {.05, .05}, % /four.oldstyle
+ [0xF737] = {.05, .08}, % /seven.oldstyle
+}
+ \_doc
+ \`\.punctPR`
+ \_cod
+
+\.trydef \_mte_punctPR {% punctuations, Protrusion, Regular fonts
+ \_mte . = {0 , .7},
+ \_mte , = {0 , .5},
+ \_mte : = {0 , .5},
+ \_mte ; = {0 , .5},
+ \_mte ! = {0 , .1},
+ \_mte ? = {0 , .2},
+ \_mte @ = {.05,.05},
+ \_mte ~ = {.2, .25},
+ \_mte \% = {.05,.05}, % /percent
+ \_mte * = {.3, .3},
+ \_mte + = {.25,.25},
+ \_mte - = {.4, .5}, % /hyphen
+ \_mte – = {.4, .3}, % /endash
+ \_mte — = {.3, .2}, % /emdash
+ \_mte _ = {.2, .2}, % /underscore
+ \_mte / = {.2, .3},
+ \_mte \\ = {.2, .3}, % /backslash
+ \_mte ¡ = {.1, 0}, \_mte ¿ = {.1, 0},
+}
+ \_doc
+ \`\.quotPR`
+ \_cod
+
+\.trydef \_mte_quotPR {% quotation marks, Protrusion, Regular fonts
+ \_mte ' = {.3,.4}, % /quotesingle
+ \_mte ‘ = {.5,.7}, \_mte ’ = {.5,.6},
+ \_mte “ = {.5,.3}, \_mte ” = {.2,.6},
+ \_mte ‚ = {.4,.4}, \_mte „ = {.4,.4},
+ \_mte ‹ = {.4,.4}, \_mte › = {.3,.5},
+ \_mte « = {.3,.2}, \_mte » = {.1,.4},
+}
+ \_doc
+ \`\.othersPR`
+ \_cod
+
+\.trydef \_mte_othersPR {% other characters, Protrusion, Regular fonts
+ \_mte ( = {.3, 0}, \_mte ) = {0 ,.3},
+ \_mte < = {.2, .1}, \_mte > = {.1, .2},
+ \_mte \{ = {.4, .2}, \_mte \} = {.2, .4}, % /braceleft, /braceright
+ [0x2329] = {.4, 0}, [0x232A] = {0 ,.4}, % /angleleft, /angleright
+ \_mte † = {.1,.1},
+ \_mte ‡ = {.08, .08},
+ \_mte • = {.2, .2},
+ \_mte · = {.4, .45}, % /periodcentered
+ \_mte ℃ = {.08, .05},
+ \_mte ₡ = {0 , .05},
+ \_mte ° = {.4, .4},
+ [0x2122] = {.1, .2}, % /trademark
+ \_mte © = {.1, .1},
+ \_mte ® = {.1, .1},
+ \_mte ª = {.1, .2},
+ \_mte º = {.1, .2},
+ \_mte ¹ = {.2, .25},
+ \_mte ² = {.05, .1},
+ \_mte ³ = {.05, .1},
+ \_mte ¬ = {.2, 0},
+ \_mte − = {.3, .3},
+ \_mte ± = {.15, .2},
+ \_mte × = {.15, .25},
+ \_mte ÷ = {.15, .25},
+ \_mte € = {.1, 0},
+ \_mte Γ = {0 ,.180}, % /Gamma
+ \_mte Δ = {.1, .1}, % /Delta
+ \_mte Θ = {.05, .05}, % /Theta
+ \_mte Λ = {.1,.1}, % /Lambda
+ \_mte Σ = {.05, .05}, % /Sigma
+ \_mte Υ = {.1,.1}, % /Upsilon
+ \_mte Φ = {.05, .05}, % /Phi
+ \_mte Ψ = {.05, .05}, % /Psi
+}
+
+ \_doc
+ The protrusion data for italic and bold italic fonts follow.
+ \`\.AlphabetPI`
+ \_cod
+
+\.trydef \_mte_AlphabetPI {% Alphabets, Protrusion, Italic fonts
+ \_mte A = {.125,.1},
+ \_mte Æ = {.125,-.055},
+ \_mte B = {.09,-.04},
+ \_mte C = {.145,-.075},
+ \_mte D = {.075,-.028},
+ \_mte E = {.08,-.055},
+ \_mte F = {.085,-.08},
+ \_mte G = {.153,-.015},
+ \_mte H = {.073,-.06},
+ \_mte I = {.14,-.12},
+ [0x0132] = {.14,-.08}, % IJ
+ \_mte J = {.135,-.08},
+ \_mte K = {.07,-.03},
+ \_mte L = {.087,.04},
+ \_mte M = {.067,-.045},
+ \_mte N = {.075,-.055},
+ \_mte O = {.15,-.03},
+ \_mte Œ = {.15,-.055},
+ \_mte P = {.082,-.05},
+ \_mte Q = {.15,-.03},
+ \_mte R = {.075, .015},
+ \_mte S = {.09,-.065},
+ \_mte $ = {.1,-.02}, % $
+ \_mte T = {.22,-.085},
+ \_mte U = {.23,-.055},
+ \_mte V = {.26,-.06},
+ \_mte W = {.185,-.055},
+ \_mte X = {.07,-.03},
+ \_mte Y = {.25,-.06},
+ \_mte Z = {.09,-.06},
+}
+ \_doc
+ \`\.alphabetPI`
+ \_cod
+
+\.trydef \_mte_alphabetPI {% alphabets, Protrusion, Italic fonts
+ \_mte a = {.15,-.01},
+ \_mte b = {.17, 0},
+ \_mte c = {.173,-.01},
+ \_mte d = {.15,-.055},
+ \_mte e = {.18, 0},
+ \_mte f = {0 ,-.25},
+ \_mte g = {.15,-.01},
+ \_mte h = {.1, 0},
+ \_mte i = {.21, 0},
+ [0x17C9] = {.21,-.04}, % ij
+ \_mte j = {0 ,-.04},
+ \_mte k = {.11,-.05},
+ \_mte l = {.24,-.11},
+ \_mte m = {.08, 0},
+ \_mte n = {.115, 0},
+ \_mte o = {.155, 0},
+ \_mte q = {.17,-.04},
+ \_mte r = {.155,-.04},
+ \_mte s = {.13, 0},
+ \_mte t = {.23,-.01},
+ \_mte u = {.12, 0},
+ \_mte v = {.14,-.025},
+ \_mte w = {.098,-.02},
+ \_mte x = {.065,-.04},
+ \_mte y = {.13,-.02},
+ \_mte z = {.110,-.08},
+}
+ \_doc
+ \`\.digitsPI`
+ \_cod
+
+\.trydef \_mte_digitsPI {% digits, Protrusion, Italic fonts
+ \_mte 0 = {.17,-.085},
+ \_mte 1 = {.23,.11},
+ \_mte 2 = {.13,-.07},
+ \_mte 3 = {.14,-.07},
+ \_mte 4 = {.13,.08},
+ \_mte 5 = {.16, 0},
+ \_mte 6 = {.175,-.03},
+ \_mte 7 = {.25,-.15},
+ \_mte 8 = {.13,-.04},
+ \_mte 9 = {.155,-.08},
+ [0xF730] = {.05,.05}, % /zero.oldstyle
+ [0xF731] = {.1, .1}, % /one.oldstyle
+ [0xF732] = {.1,.08}, % /two.oldstyle
+ [0xF733] = {.08,.05}, % /three.oldstyle
+ [0xF734] = {.08,.08}, % /four.oldstyle
+ [0xF735] = {.05, 0}, % /five.oldstyle
+ [0xF736] = {.05, 0}, % /six.oldstyle
+ [0xF737] = {.08,.08}, % /seven.oldstyle
+ [0xF738] = {.05, 0}, % /eight.oldstyle
+ [0xF739] = {0 ,.05}, % /nine.oldstyle
+}
+ \_doc
+ \`\.punctPI`
+ \_cod
+
+\.trydef \_mte_punctPI {% punctuations, Protrusion, Italic fonts
+ \_mte . = {0 ,.5},
+ \_mte , = {0 ,.45},
+ \_mte : = {0 ,.3},
+ \_mte ; = {0 ,.3},
+ \_mte & = {.13,.03},
+ \_mte \% = {.18,.05},
+ \_mte * = {.38,.02},
+ \_mte + = {.18,.2},
+ \_mte @ = {.18,.01},
+ \_mte ~ = {.2,.15},
+ \_mte ( = {.3, 0}, \_mte ) = {0 ,.07},
+ \_mte / = {.1,.1},
+ \_mte - = {.5,.3}, % /hyphen
+ \_mte – = {.5,.3}, % /endash
+ \_mte — = {.4,.17}, % /emdash
+ \_mte _ = {.1,.2}, % /underscore
+ \_mte ¡ = {.2, 0}, \_mte ¿ = {.2, 0},
+}
+ \_doc
+ \`\.quotPI`
+ \_cod
+
+\.trydef \_mte_quotPI {% quotation marks, Protrusion, Italic fonts
+ \_mte ' = {.3,.4}, % /quotesingle
+ \_mte " = {.5,.3},
+ \_mte ‘ = {.8,.2}, \_mte ’ = {.8,-.02},
+ \_mte “ = {.54,.1}, \_mte ” = {.5,.1},
+ \_mte ‚ = {.3,.7}, \_mte „ = {.2,.6},
+ \_mte ‹ = {.5,.3}, \_mte › = {.4,.4},
+ \_mte « = {.4,.1}, \_mte » = {.2,.3},
+}
+ \_doc
+ \`\.othersPI`
+ \_cod
+
+\.trydef \_mte_othersPI {% other characters, Protrusion, Italic fonts
+ \_mte < = {.3,.1}, \_mte > = {200,100},
+ \_mte \\ = {.3,.3},
+ \_mte \{ = {.4,.1}, \_mte \} = {200,200},
+ \_mte † = {.2,.08},
+ \_mte ‡ = {.12,.08},
+ \_mte • = {.22,.1},
+ \_mte · = {.55,.3}, % /periodcentered
+ \_mte ℃ = {.17, 0},
+ \_mte ₡ = {.1,.05},
+ \_mte ¶ = {.2, 0},
+ \_mte ° = {.5,.3},
+ [0x2122] = {.2,.07}, % /trademark
+ \_mte © = {.05,.07},
+ \_mte ® = {.05,.07},
+ \_mte ª = {.14,.1},
+ \_mte º = {.14,.1},
+ \_mte ¹ = {.40,.15},
+ \_mte ² = {.25,.08},
+ \_mte ³ = {.25,.08},
+ \_mte ¬ = {.25,.08},
+ \_mte − = {.3,.2},
+ \_mte ± = {.15,.17},
+ \_mte × = {.2,.2},
+ \_mte ÷ = {.2,.2},
+ \_mte € = {.15, 0},
+ \_mte Γ = {.1,.12}, % /Gamma
+ \_mte Δ = {.12,.1}, % /Delta
+ \_mte Θ = {.12,.05}, % /Theta
+ \_mte Λ = {.13,.1}, % /Lambda
+ \_mte Ξ = {.1, 0}, % /Xi
+ \_mte Π = {.1, 0}, % /Pi
+ \_mte Σ = {.1,.05}, % /Sigma
+ \_mte Υ = {.18,.1}, % /Upsilon
+ \_mte Φ = {.13,.07}, % /Phi
+ \_mte Ψ = {.13,.05}, % /Psi
+ \_mte Ω = {.05, 0}, % /Omega
+}
+
+ \_doc --------------------
+ The expansion data follow in macros \^`\.AlphabetX`, \^`\.alphabetX`, \^`\.digitsX`
+ and \^`\.othersX`.
+ They are common for all fonts. \`\.AlphabetX`
+ \_cod --------------------
+
+\.trydef \_mte_AlphabetX {% Alphabets, eXpansion
+ \_mte A = .5,
+ \_mte Æ = .5,
+ \_mte B = .7,
+ \_mte C = .7,
+ \_mte D = .5,
+ \_mte E = .7,
+ \_mte F = .7,
+ \_mte G = .5,
+ \_mte H = .7,
+ \_mte K = .7,
+ \_mte M = .7,
+ \_mte N = .7,
+ \_mte O = .5,
+ \_mte Œ = .5,
+ \_mte P = .7,
+ \_mte Q = .5,
+ \_mte R = .7,
+ \_mte S = .7,
+ \_mte U = .7,
+ \_mte W = .7,
+ \_mte Z = .7,
+}
+ \_doc
+ \`\.alphabetX`
+ \_cod
+
+\.trydef \_mte_alphabetX {% alphabets, eXpansion
+ \_mte a = .7,
+ \_mte æ = .7,
+ \_mte b = .7,
+ \_mte c = .7,
+ \_mte d = .7,
+ \_mte e = .7,
+ \_mte g = .7,
+ \_mte h = .7,
+ \_mte k = .7,
+ \_mte m = .7,
+ \_mte n = .7,
+ \_mte o = .7,
+ \_mte œ = .7,
+ \_mte p = .7,
+ \_mte q = .7,
+ \_mte s = .7,
+ \_mte u = .7,
+ \_mte w = .7,
+ \_mte z = .7,
+}
+ \_doc
+ \`\.digitsX`
+ \_cod
+
+\.trydef \_mte_digitsX {% digits, eXpansion
+ \_mte 2 = .7,
+ \_mte 3 = .7,
+ \_mte 6 = .7,
+ \_mte 8 = .7,
+ \_mte 9 = .7,
+}
+ \_doc
+ \`\.othersX`
+ \_cod
+
+\.trydef \_mte_othersX {% others, eXpansion
+}
+
+ \_doc --------------------
+ The \`\_mte_P` (for protrusion, all fonts) and \`\_mte_X`
+ (for expansion, all fonts) are empty by default but user can
+ declare specific values here. These macros are used last in the
+ \`\.allPR`, \`\.allPI`, \`\.allX` macros
+ (used in the lua code bellow), so it has general precedence.
+ \_cod --------------------
+
+\.trydef \_mte_P {} % user specific, Protrusion
+\.trydef \_mte_X {} % user specific, eXpansion
+
+\_def \.allPR {\.AlphabetPR \.alphabetPR \.digitsPR \.punctPR \.quotPR \.othersPR \.P}
+\_def \.allPI {\.AlphabetPI \.alphabetPI \.digitsPI \.punctPI \.quotPI \.othersPI \.P}
+\_def \.allX {\.AlphabetX \.alphabetX \.digitsX \.othersX \.X}
+
+ \_doc --------------------
+ We add a new macro \`\.features` to the \OpTeX/'s
+ \olink[fontfeatures]\_fontfeatures. It is empty by
+ default but it will be changed by `\enablemte` to read protrusion and
+ expansion data using Lua code.
+ \_cod --------------------
+
+\_addto\_fontfeatures{\.features}
+\_def\.features{}
+
+ \_doc --------------------
+ \`\enablemte` initializes protrusion data by the \^`\.initprotrusion` macro
+ and expansion data by the \^`\.initexpansion` macro. Then it sets
+ \elink[pdfprotrudechars]{\protrudechars} and \elink[pdfadjustspacing]{\adjustspacing}
+ primitives and sets the \^`\.features` macro to use
+ the protrusion tables `pr` (for regular or bold fonts) or `pi` (for italic
+ or bold italic fonts). The table `ex` is used for expansion data.
+ These tables are declared in the Lua code below.
+ \nl
+ \`\disablemte` disables font \^`\.features` and sets appropriate primitive
+ registers to zero.
+ \_cod --------------------
+
+\_def\.enablemte {%
+ \_initunifonts
+ \.initprotrusion % luacode, pr and pi tables initialized
+ \.initexpansion % luacode, ex table initialized
+ \_protrudechars=2
+ \_adjustspacing=2
+ \_def\.features{protrusion=p\.var;expansion=ex}% pr/pi and ex tables used
+ \_reloading \_currvar
+}
+\_def\.disablemte {%
+ \_protrudechars=0
+ \_adjustspacing=0
+ \_def\.features{}%
+ \_reloading \_currvar
+}
+\_nspublic \enablemte \disablemte ;
+
+ \_doc --------------------
+ The \`\.var` macro expands ro `r` when regular or bold font is loaded
+ and it expands to `i` if italic or bold italic font is loaded.
+ The `pr` or `pi` data table is selected using this macro.
+ \_cod --------------------
+
+\_def\.it{it}\_def\.bi{bi}
+\_def\.var{\_ifx\_whatresize\.it i\_else \_ifx\_whatresize\.bi i\_else r\_fi\_fi}
+
+ \_doc -------------------
+ The `pr` and `pi` data tables are created using lua code in
+ the \`\.initprotrusion` macro. The data from \^`\.allPR` or \^`\.allPI`
+ are used here.
+ The analogical concept is used in the \`\.initexpansion` macro.
+ \_cod -------------------
+
+\_def\.initprotrusion {%
+ \_directlua {%
+ fonts.protrusions.setups['pr']={
+ factor=\.fpfactor,
+ \.leftright,
+ \.allPR
+ }
+ fonts.protrusions.setups['pi']={
+ factor=\.fpfactor,
+ \.leftright,
+ \.allPI
+}}}
+\_def\.initexpansion {%
+ \_directlua {%
+ fonts.expansions.setups['ex']={
+ \.stretchshrinkstep,
+ factor=\.fxfactor,
+ \.allX
+}}}
+
+ \_doc --------------------
+ The \`\.leftright`, \`\.stretchshrinkstep`, \`\.fpfactor`, and \`\.fxfactor`
+ macros are used in the Lua code above and they have following default values
+ (you can re-define them, if you want):
+ \_cod --------------------
+
+\_def \.fpfactor{1}
+\_def \.leftright {left=1, right=1}
+\_def \.fxfactor{1}
+\_def \.stretchshrinkstep {stretch=3, shrink=2, step=.5}
+
+ \_doc --------------------
+ \`\setfpfactor` and \`\setfxfactor` simply define \^`\.fpfactor` and \^`\.fxfactor`.
+ \_cod --------------------
+
+\_def\.setfpfactor #1 {\_def\.fpfactor{#1}}
+\_def\.setfxfactor #1 {\_def\.fxfactor{#1}}
+\_nspublic \setfpfactor \setfxfactor ;
+
+ \_doc --------------------
+ There are similar letters: A, Á, Á, Â, Ã, Ä, Å, they need the same setting.
+ But only the basic letter (A in this example) has protrusion and/or expansion
+ setting using Lua code. The equivalent settings are done by the macro
+ \`\.setequivs``<font-switch>`.
+ This macro is used in \olink[_newfontloaded]{\_newfontloaded} `<font-switch>`
+ which is called by \OpTeX/ if the font is loaded first.
+ The \^`\.setequivs` macro uses data from \^`\.equalcodes` (see bellow)
+ and sets equal
+ \elink[lpcode]{\lpcode}, \elink[rpcode]{\rpcode}, and \elink[efcode]{\efcode}
+ for variant characters.
+ It is called only if \^`\.features` is non-empty, i.e.\ if the font
+ includes mte data.
+ \_cod --------------------
+
+\_def\_newfontloaded#1{\_ifx\.features\_empty \_else \.setequivs#1\_fi}
+
+\_def\.setequivs #1{\_let\.f=#1\_ea\.setequivsA\.equalcodes,,={},}
+\_def\.setequivsA#1#2=#3#4,{\_ifx^#3^\_else
+ \_afterfi{\_tmpnum=`#1 \.setequivsB#3#4\_end\.setequivsA}\_fi}
+\_def\.setequivsB#1{\_ifx\_end#1\_else
+ \_lpcode\.f`#1=\_lpcode\.f\_tmpnum
+ \_rpcode\.f`#1=\_rpcode\.f\_tmpnum
+ \_efcode\.f`#1=\_efcode\.f\_tmpnum
+ \_ea\.setequivsB\_fi
+}
+
+ \_doc --------------------
+ \`\.equalcodes` includes comma separated equivalences. The same
+ \elink[lpcode]{\lpcode}, \elink[rpcode]{\rpcode}, and \elink[efcode]{\efcode}
+ for all characters
+ given at right side is set as these codes of the character given
+ at the left side of equal sign.
+ You can do `\addto\_mte_equalcodes{<your additional settings>}`
+ if you want.
+ \_cod --------------------
+
+\_def\.equalcodes {%
+ A = ÀÁÂÃÄÅĀĂĄǺȀẠẢẤẦẨẪẬẮẰẲẶΑ,
+ B = ฿Β,
+ C = ÇĆĈĊČ,
+ D = ÐĎĐḌḎ,
+ E = ÈÉÊËĒĔĖĘĚȄẸẺẼỀẾỄỂỆΕ,
+ G = ĜĞĠĢǦǴ,
+ H = ĤĦḤḦḪΗ,
+ I = ÌÍÎÏĨĪĬĮİȈỈỊΙ,
+ J = Ĵ,
+ K = ĶΚ,
+ L = ĹĽĻŁḶ,
+ M = Μ,
+ N = ÑŃŅŇṄṆΝ,
+ O = ÒÓÔÕÖØŌŎŐỌƠǪǾȌỎỐỒỔỖỘỚỜỠỞỢΟ,
+ P = Ρ,
+ R = ŔŖŘȐṚṘṜ,
+ S = ŚŜŞŠȘṢ,
+ T = ŢŤȚṬṮΤ,
+ U = ÙÚÛÜŨŪŬŮŰŲƯȔỤỦỨỪỬỮỰ,
+ W = ŴẀẂẄ,
+ X = Χ,
+ Y = ÝŶŸỴỶỸ,
+ Z = ŹŻŽẒΖ,
+ a = àáâãäåāăąǻȁạảấầẩẫậắằẳẵ,
+ æ = ǽ,
+ c = çćĉċč,
+ d = đḍḏ, % ď has different right side
+ e = èéêëēĕėęěȅẹẻẽếềểễệ,
+ g = ĝğġģǧǵ,
+ h = ĥħḥḧḫ,
+ i = ìíîïĩīĭįıȉỉị,
+ j = ĵ,
+ k = ķ,
+ l = ĺļłḷḹ, % ľ has different right side
+ n = ñńņňṅṇ,
+ o = òóôõöøōŏőọơǫǿȍỏốồổỗộớờỡởợ,
+ r = ŕŗřȑṛṙṝ,
+ s = śŝşšșṣ,
+ t = ţțṭṯẗť,
+ u = ùúûüũūŭůűųưȕụủứừửữự,
+ w = ŵẁẃẅ,
+ y = ýŷÿỳỵỷỹ,
+ z = źżžẓ,
+}
+\_endnamespace
+\_endcode
+
+\tit MicroTypographic Extensions for \OpTeX/
+
+\centerline{\it Petr Olšák, 2021}
+\bigskip
+
+You can do `\load[mte]` followed by \^`\enablemte`. The microtypographic
+extensions (protrusions, expansions) of all fonts are available after
+\^`\enablemte`. The \LaTeX/ package Microtype does similar effect.
+
+The \^`\enablemte` macro reloads the current font with microtypographic
+extensions (mte) enabled and all new fonts loaded by the Font Selection System have
+mte enabled too, because they are added to the
+\olink[_fontfeatures]{\_fontfeatures} macro used by \OpTeX/.
+
+The \^`\enablemte` macro does only local settings. If it is used in a group then
+only fonts used in this group have mte.
+
+The \^`\enablemte` macro sets (among other things)
+\elink[pdfprotrudechars]{\protrudechars}`=2` (protrusion is enabled) and
+\elink[pdfadjustspacing]{\adjustspacing}`=2` (font expansion is enabled).
+You can disable these features by setting these primitive registers to zero
+value (it is default if \^`\enablemte` is not used).
+Note, that the values of these registers are checked when
+paragraph is finalized although the fonts were loaded with mte enabled.
+It means that you have to use `\par` before end of group
+if you use \^`\enablemte` inside a group.
+For example:
+
+\begtt
+{\enablemte
+ Roman font with mte enabled, \it italic font with mte enabled.
+ \par % mte features are used
+}
+\endtt
+%
+Or, simply use \^`\enablemte` at beginning of your document.
+
+On the other hand, you can use \^`\disablemte` macro which reloads current
+font with mte disabled and all newly loaded fonts have
+mte disabled too. The macro has local validity. For example,
+`{\disablemte text}` prints `text` by a font with
+mte disabled. It works locally in the middle of the paragraph (unlike setting
+`\protrudechars` and `\adjustspacing` to zero).
+
+You can define your own protrusion or expansion values: copy macros
+`\_mte_AlphabetPR`, `\_mte_quotPR`, etc.\ from this package and define them
+as you wish using `\def`. Such definition has precedence.
+Similar definitions can be in some font family files too, so: do your
+definition after all `\fontfam` if you want to keep the precedence.
+All such definitions must be performed before the `\mteinit` command.
+
+You can use `\def\_mte_P` for data of protrusion for all fonts
+which has general precedence. For example, if you want to protrude hyphen
+char with factor one at the right side and by factor 0.5 at the left side, use
+\begtt
+\def\_mte_P {% user specification, Protrusion, Regular fonts
+ \_mte - = {.5, 1}, % /hyphen
+}
+\endtt
+Analogical macro can be used for expansion data `\_mte_X`.
+
+You can use \^`\setfpfactor` `<factor><space>` to set the factor by which
+all protrusion data are scaled. The <factor> is decimal number and its default
+value is~1. This macro can be used before \^`\enablemte`.
+You can use \^`\setfxfactor` `<factor><space>` with analogical meaning,
+expansion data are scaled by given~<factor>.
+
+If you feel that default microtypographic data are wrong in a particular case,
+please let me know. I can correct it in this package. If you feel
+that a specific font family needs different microtypographic data, please
+let me know. I can add extra definitions to appropriate font family
+file.
+
+\_endinput
+
+Use "optex mte-doc.tex" (twice) to generate documentation from this file.
diff --git a/Master/texmf-dist/tex/optex/pkg/vlna.opm b/Master/texmf-dist/tex/optex/pkg/vlna.opm
index 4db22aa0cc9..c613d48cc4c 100644
--- a/Master/texmf-dist/tex/optex/pkg/vlna.opm
+++ b/Master/texmf-dist/tex/optex/pkg/vlna.opm
@@ -10,9 +10,9 @@
% vlna.opm is based on Lua code from the package `luavlna` (by Michal Hoftich
% and Miro Hrončok). See `texdoc luavlna` or end of this file for more information.
-\_namespace{vlna}
+\_codedecl \singlechars {Preventing single-chars prepositions and more <2021-01-08>}
-\_codedecl \.singlechars {Preventing single-chars prepositions and more <2021-01-08>}
+\_namespace{vlna}
\_doc -----------------------------
We declare new attribute, register callbacks, and define Lua functions that
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index d5de2d088a4..f80c7670b87 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -6875,10 +6875,10 @@ sub POSTnwejm {
&SYSTEM ("$MV images $DEST/tex/latex/$package");
}
-sub POSToptex { # its own formats, so directly under tex/ and doc/
+sub POSToptex { # its own format, so under {tex,doc}/base
print "POST$package - mv base demo pkg doc subdirs\n";
&mv_with_mkdir ("base", "demo", "pkg", "$DEST/tex/$package");
- &mv_with_mkdir ("README", "doc/*", "$DEST/doc/$package");
+ &mv_with_mkdir ("README", "doc/*", "$DEST/doc/$package/base");
}
sub POSTpas_vc {