summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-02-26 22:08:47 +0000
committerKarl Berry <karl@freefriends.org>2020-02-26 22:08:47 +0000
commit3805b044b79834780c2e5f21292a3e4f63869b4f (patch)
treed7889ac9ff37b1953f03792775ef2fc63110658b /Master/texmf-dist
parent33fdbb41f0300f164828daec8135305598415b51 (diff)
optex (26feb20)
git-svn-id: svn://tug.org/texlive/trunk@53927 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/optex/README9
-rw-r--r--Master/texmf-dist/doc/latex/optex/op-demo.tex4
-rw-r--r--Master/texmf-dist/doc/latex/optex/op-ring.png (renamed from Master/texmf-dist/doc/latex/optex/ring.png)bin1294292 -> 1294292 bytes
-rw-r--r--Master/texmf-dist/doc/latex/optex/optex-doc.pdfbin145296 -> 150405 bytes
-rw-r--r--Master/texmf-dist/doc/latex/optex/optex-doc.tex256
-rw-r--r--Master/texmf-dist/tex/luatex/optex/basics-macros.opm54
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-adventor.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-antt.opm10
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-baskerville.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-bonum.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-cursor.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-gfsbodoni.opm6
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-heros.opm34
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-libertine-s.opm10
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-libertine.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-lido.opm52
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-pagella.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-schola.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-technika.opm10
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-termes.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/f-xcharter.opm7
-rw-r--r--Master/texmf-dist/tex/luatex/optex/fams-ini.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm40
-rw-r--r--Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm88
-rw-r--r--Master/texmf-dist/tex/luatex/optex/fonts-resize.opm3
-rw-r--r--Master/texmf-dist/tex/luatex/optex/fonts-select.opm246
-rw-r--r--Master/texmf-dist/tex/luatex/optex/hyperlinks.opm137
-rw-r--r--Master/texmf-dist/tex/luatex/optex/if-macros.opm112
-rw-r--r--Master/texmf-dist/tex/luatex/optex/luatex-ini.opm4
-rw-r--r--Master/texmf-dist/tex/luatex/optex/maketoc.opm92
-rw-r--r--Master/texmf-dist/tex/luatex/optex/math-macros.opm78
-rw-r--r--Master/texmf-dist/tex/luatex/optex/math-preload.opm5
-rw-r--r--Master/texmf-dist/tex/luatex/optex/math-unicode.opm107
-rw-r--r--Master/texmf-dist/tex/luatex/optex/op-macros.opm15
-rw-r--r--Master/texmf-dist/tex/luatex/optex/opmac-rest.opm322
-rw-r--r--Master/texmf-dist/tex/luatex/optex/optex.ini8
-rw-r--r--Master/texmf-dist/tex/luatex/optex/outlines.opm87
-rw-r--r--Master/texmf-dist/tex/luatex/optex/output.opm31
-rw-r--r--Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm22
-rw-r--r--Master/texmf-dist/tex/luatex/optex/prefixed.opm2
-rw-r--r--Master/texmf-dist/tex/luatex/optex/ref-file.opm61
-rw-r--r--Master/texmf-dist/tex/luatex/optex/references.opm113
-rw-r--r--Master/texmf-dist/tex/luatex/optex/unimath-codes.opm479
-rw-r--r--Master/texmf-dist/tex/luatex/optex/verbatim.opm265
45 files changed, 1723 insertions, 1086 deletions
diff --git a/Master/texmf-dist/doc/latex/optex/README b/Master/texmf-dist/doc/latex/optex/README
index 8cc02a11bf1..53a4ec4b22b 100644
--- a/Master/texmf-dist/doc/latex/optex/README
+++ b/Master/texmf-dist/doc/latex/optex/README
@@ -8,6 +8,15 @@ See http://petr.olsak.net/optex
History:
+<0.05> \boldmath reimplemented
+ \fontcolor, \letterspacing implemented
+ font catalogue improved
+<0.04> references.opl, hyperlinks.opl re-implemented.
+ \fontfam, f-* rewritten: no usage of boundary "..." in \_fontnamegen
+ \fnote{...} corrected: (parameter is not really parameter)
+ verbatim.opl re-implemented + doc added
+ file-ref.opl implemented (new \_Xrefversion{3})
+ bugfixing
<0.03> optex-doc optex.1 included,
verbatim.opm re-implmented,
math-unicode implemented,
diff --git a/Master/texmf-dist/doc/latex/optex/op-demo.tex b/Master/texmf-dist/doc/latex/optex/op-demo.tex
index f06bd2639b8..6ff462ceab7 100644
--- a/Master/texmf-dist/doc/latex/optex/op-demo.tex
+++ b/Master/texmf-dist/doc/latex/optex/op-demo.tex
@@ -29,7 +29,7 @@ and `\enditems` sequences.
* Last item.
\enditems
-\secc Title of Subsection
+\secc Title of\nl Subsection
The subsection text\dots
@@ -80,7 +80,7 @@ The images (PDF, JPG, PNG, TIFF) can be inserted
by `\inspic` sequence. The `\label` and `\caption/f`
can be added if you need to refer to a figure.
-\centerline {\picwidth=2.7cm \inspic ring.png }
+\centerline {\picwidth=2.7cm \inspic op-ring.png }
\label[my-pic]
\nobreak
\caption/f The nonempty ideal of a simple ring --
diff --git a/Master/texmf-dist/doc/latex/optex/ring.png b/Master/texmf-dist/doc/latex/optex/op-ring.png
index 257146bc6da..257146bc6da 100644
--- a/Master/texmf-dist/doc/latex/optex/ring.png
+++ b/Master/texmf-dist/doc/latex/optex/op-ring.png
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/optex/optex-doc.pdf b/Master/texmf-dist/doc/latex/optex/optex-doc.pdf
index 93a6d13eb3a..7f161eaeb0a 100644
--- a/Master/texmf-dist/doc/latex/optex/optex-doc.pdf
+++ b/Master/texmf-dist/doc/latex/optex/optex-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/optex/optex-doc.tex b/Master/texmf-dist/doc/latex/optex/optex-doc.tex
index 514a322dd70..7b0f6ff286b 100644
--- a/Master/texmf-dist/doc/latex/optex/optex-doc.tex
+++ b/Master/texmf-dist/doc/latex/optex/optex-doc.tex
@@ -19,17 +19,17 @@
\insertoutline{CONTENTS} \outlines{0}
+
\tit \OpTeX/\nl Format Based on Plain \TeX/ and OPmac\fnotemark1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\hfill Version Alpha 0.03
+\hfill Version Alpha 0.05
\centerline{\it Petr Olšák, 2020}
\bigskip
\centerline{\url{http://petr.olsak.net/optex}}
-
\fnotetext {The OPmac package is a set of simple additional macros to plain\TeX{}. It
enables users to take advantage of basic \LaTeX/ functionality but keeps
plain \TeX/ simplicity. See
@@ -53,8 +53,7 @@ is supported. The main goal of \OpTeX/ is:
* \OpTeX/ provides a powerful font selection system (for Unicode font
families, of course).
* \OpTeX/ supports hyphenations of all languages installed in your \TeX/ system.
-* All features from OPmac macros are copied (for example, you can see
- opmac-prospectus.pdf)
+* All features from OPmac macros are copied.
* Macros are documented in the same place where code is (macros for printing
this documentation will come in the future).
* User name space of control sequences is separated from internal name space
@@ -62,17 +61,28 @@ is supported. The main goal of \OpTeX/ is:
\enditems
\OpTeX/ should be a modern plain \TeX/ with power from OPmac (fonts selection
-system, colors, external graphics, references, hyperlinks...) with unicode
-fonts.
-
-\OpTeX/ (like OPmac) offers a markup language for authors of texts (like \LaTeX),
+system, colors, external graphics, references, hyperlinks, indexing,
+bibliography, ...) with preferred Unicode fonts.
+
+If you need to customize your document or you need to use something
+very specific, then you can copy relevant parts of \OpTeX/ macros into your macro
+file and do changes of these macros here. This is significant difference from
+\LaTeX/ or ConTeXt, which are an attempt to create a new user level with a
+plenty of non-primitive parameters and syntax hidding \TeX/ internals.
+The macros from \OpTeX/ are simple and straightforward because they solves only
+what is excplicitly needed, they does not create a new user level over \TeX/.
+And you can use them, understand them an modify them.
+
+\OpTeX/ offers a markup language for authors of texts (like \LaTeX),
i.e. the fixed set of tags to define the structure of the document. This
markup is different from the \LaTeX{} markup. It may offer to write the
source text of the document somewhat clearer and more attractive.
-\new
-{\bf Disclaimer:} This software is under construction.
-It is possible that some features documented here will be changed in future.
+\new
+{\bf Disclaimer:} This software is under construction. It is possible
+that some features documented here will be changed in future. There exists a
+large part of original OPmac macros included in \OpTeX/ which waits to its
+re-implementation at current state of development.
\sec Using \OpTeX/
@@ -86,7 +96,7 @@ It is possible that some features documented here will be changed in future.
optex document
\endtt
%
-You can try to process `optex demo` or `optex optex-doc`.
+You can try to process `optex op-demo` or `optex optex-doc`.
If there is no `optex` command, see more information about installation
\OpTeX/ at \url{http://petr.olsak.net/optex}.
@@ -102,15 +112,15 @@ The first line `\fontfam[LMfonts]` tells that Unicode Latin Modern
fonts (derived from Computer Modern) are used. If you omit this line then
preloaded Latin Modern fonts are used but preloaded fonts cannot be in
Unicode\fnote
-{This is technical limitations of \LuaTeX/ for fonts in formats:
+{This is technical limitations of \LuaTeX/ for fonts downloaded in formats:
only 8bit fonts can be preloaded.}.
So the sentence `Hello World` will be OK without the first line, but you
-cannot print such sentence in another languges (like `Ahoj světe!`)
+cannot print such sentence in another languages (for example `Ahoj světe!`)
where Unicode fonts are needed
because of the characters like `ě` are not mapped correctly in preloaded
-font.
+fonts.
-A somewhat larger example with common settings shoud be:
+A somewhat larger example with common settings should be:
\begtt
\fontfam[Termes] % selecting Unicode font family Termes
@@ -122,7 +132,7 @@ Tady je text.
\bye
\endtt
%
-You can look at `demo.tex` file for more examples.
+You can look at `op-demo.tex` file for more examples.
\sec Compatibility with Plain \TeX/
@@ -136,8 +146,8 @@ prefixed by `_` (like `\_this`). All primitives and common macros have two
control sequences in prefixed and unprefixed form with the same
meaning. For example `\hbox` is equal to `\_hbox`.
Internal macros of \OpTeX/ have and use only prefixed form. User should use
-unprefixed forms, but prefixed forms are accessibe too, bacause the `_` is
-set as a letter globally (in macro files and in users document too). User
+unprefixed forms, but prefixed forms are accessible too, because the `_` is
+set as a letter category code globally (in macro files and in users document too). User
should re-define unprefixed forms of control sequences with no worries that
something internal will be broken (only the sequence `\par` cannot be
re-defined without internal change of \TeX/ behavior because it is
@@ -157,14 +167,14 @@ internal point of view.
\new
The accents macros like `\'`, `\v` are undefined in \OpTeX/. Use real
-letters like ř, ž in your soucre document instead these old accents macros.
+letters like á, ř, ž in your source document instead these old accents macros.
If you really want to use them, you can initialize them by `\oldaccents`
command.
\new
The paper size is not set as letter with 1\,in margins but as a4 with 2\,cm
-marins. You can change it by `\margins/1 letter (1,1,1,1)in` (this example
-sets the classical plainTeX parameters).
+margins. You can change it by `\margins/1 letter (1,1,1,1)in` (this example
+sets the classical plain TeX parameters).
\new
The origin for typographical area is not at top left 1\,in 1\,in coordinates
@@ -172,11 +182,11 @@ but at top left paper corner exactly. For example, `\hoffset` includes directly
margin.
-\sec Selection of font family
+\sec Font families and fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-You can select the font family by `\fontfam[<Family_name>]`.
-The argument <Family_Name> is case insensitive and spaces are ignored. So,
+You can select the font family by `\fontfam[<Family-name>]`.
+The argument <Family-name> is case insensitive and spaces are ignored. So,
`\fontfam[LM Fonts]` is equal to `\fontfam[LMfonts]` and it is equal
to `\fontfam[lmfonts]`. Several aliases are prepared, thus
`\fontfam[Latin Modern]` can be used for loading Latin Modern family too.
@@ -184,36 +194,30 @@ to `\fontfam[lmfonts]`. Several aliases are prepared, thus
If you write `\fontfam[?]` then all font families registered in \OpTeX/
are listed on the terminal and in the log file.
-If you write `\fontfam[catalog]` then a catalogue of all fonts registered in
+If you write `\fontfam[catalog]` then a catalog of all fonts registered in
\OpTeX/ and available in your \TeX/ system is printed. And the instructions
-how to register your own font family is appedned in such catalogue.
+how to register your own font family is appended in such catalog.
If the family is loaded then {\em font modifiers} applicable in such font family
are listed on the terminal: (`\caps`, `\cond` for example).
-And there are four basic {\em varinat selectors} (`\rm`, `\bf`, `\it`, `\bi`).
-The font modifiers of basic variants (`\caps`, `\cond` for example) can
+And there are four basic {\em variant selectors} (`\rm`, `\bf`, `\it`, `\bi`).
+The font modifiers (`\caps`, `\cond` for example) can
be used immediately before a basic variant selector and they
can be (independently) combined: `\caps\it` or `\cond\caps\bf`. The
modifiers keeps their internal setting until group ends or until another
modifier which negates the previous feature is used. So
-`\caps \rm... \it...` uses normal and italics in Caps and SmallCaps.
+`\caps \rm text \it text` uses normal and italics in Caps and SmallCaps.
\new
There is one special variant selector `\currvar` which does not change the
-selected variant but reloads the font in respect of tne (maybe newly
-specified) font slector(s).
+selected variant but reloads the font in respect of the (maybe newly
+specified) font modifiers(s).
-\new Most declared font families are configured with recommended Unicode
-Math font. This font is automaticlally loaded unless you specify
-`\noloadmath` before first `\fontfam` command. See log file for more
-information about loading Text font family and UnicodeMath fonts. If you
-prefer another Unicode Math font, specify it by `\loadmath{[<font_file>]}`
-or `\loadmath{font_name}` before first `\loadfam` command.
-
-The `\em` macro acts as `\it` if the current font is `\rm`, acts as `\rm` if
-the current font is `\it`, acts as `\bi` if the current font is `\bf` and
-acts as `\bf` if the current font is `\bi`. The `\/` spaces are inserted
-automatically. Example:
+The context between variants `\rm`--`\it` and `\bf`--`\bi` is kept by the `\em`
+macro (emphasize text).
+It switches from current `\rm` to `\it`, from current `\it` to `\rm`, from
+current `\bf` to `\bi` and from current `\bi` to `\bf`.
+The needed italics correction `\/` is inserted automatically. Example:
\begtt
This is {\em important} text. % = This is {\it important\/} text.
@@ -225,33 +229,18 @@ This is {\em important} text. % = This is {\it important\/} text.
\new
More about the \OpTeX/ font selection system is written the file
`fonts-select.opm`. You can mix more font families in your document, you can
-declare your variant selectors o modifiers etc.
-
-\new
-The `\boldify` macro can be used for titles. It sets `\it` to `\bi` and
-`\rm` to `\bf`. It means that user can write `{\it something}` in the title
-and the result is the same as `{\bi something}`. Math formulae are in bold
-variant too. The `\boldify` macro has local validity like others font
-modifiers. Example:
-
-\begtt
-{\boldify\typosize[14/16] Title in {\it bold}\par}
-\endtt
+declare your variant selectors or modifiers etc.
\sec Font sizes
%%%%%%%%%%%%%%%
-The commands for font size setting described below, for variant selectors and
-modifiers desribed above have local validity. If you put them into a group,
-the font features are selected locally.
-
The command `\typosize[<fontsize>/<baselineskip>]` sets the font size of text and
math fonts and baselineskip. If one of these two parameters is empty, the
corresponding feature stays unchanged. Don't write the unit of these
parameters. The unit is internally set to `\ptunit` which is 1pt by default.
You can change the unit by the command `\ptunit=<something-else>`,
-for instance `\ptunit=1mm` enlages all font sizes declared by `\typosize`.
+for instance `\ptunit=1mm` enlarges all font sizes declared by `\typosize`.
Examples:
\begtt
@@ -260,6 +249,14 @@ Examples:
\typosize[8/] % font 8pt, baseline unchanged
\endtt
+The commands for font size setting described in this section
+have local validity. If you put them into a group,
+the settings are lost when the group is finished. If you set
+something relevant with paragraph shape (baselineskip given by
+`\typosize` for example) then you must first finalize the
+paragraph and second to close the group:
+`{\typosize[12/14] ...<text of paragraph>... \par}`.
+
The command
`\typoscale[<font-factor>/<baselineskip-factor>]`
sets the text and math fonts
@@ -274,7 +271,7 @@ i.e. the value stays unchanged. Examples:
\endtt
First usage of `\typosize` or `\typoscale` macro in your document sets so
-called {\em main values}, i.\ e. main font size and main baselineskip. They are internally
+called {\em main values}, i.~e. main font size and main baselineskip. They are internally
saved in registers `\mainfosize` and `\mainbaselineskip`.
\new
@@ -294,8 +291,9 @@ The size of the current font can be changed by the command
baselineskip.
\new
-There is `\setfontsize{<size_spec>}` command which behaves like other
-font modifiers. For example `\setfontsize{at15pt}\currvar`.
+There is `\setfontsize{<size-spec>}` command which behaves like
+font modifiers and sets given font size o fonts loaded by next variant selectors.
+For example `\setfontsize{at15pt}\currvar`.
More information about resizing of fonts is documented in `fonts-resize.opm`
file.
@@ -305,7 +303,7 @@ file.
%%%%%%%%%%%%%%%%%%%%%%%%%%
The document can be divided into chapters, sections and subsections and titled
-by `\tit` command. The parameters are separed by the end of current line (no
+by `\tit` command. The parameters are separated by the end of current line (no
braces are used):
\begtt
@@ -428,8 +426,8 @@ is an interesting Table~\ref[comp-dependence].
\endtt
If there are forward referenced objects then user have to run \TeX{} twice.
-During each pass, the working `*.ref` file (with refereces data) is created
-and this file is used (if it exists) at the begin of the document.
+During each pass, the working `*.ref` file (with references data) is created
+and this file is used (if it exists) at the beginning of the document.
You can create a reference to whatever else by commands
`\label[<label>]\wlabel{<text>}`. The connection between <label> and
@@ -457,6 +455,34 @@ The item style can be chosen by `\style` parameter written after `\begitems`:
\style X % big rectangle
\endtt
+For example:
+
+\begtt
+\begitems
+* First idea
+* Second idea in subitems:
+ \begitems \style i
+ * First sub-idea
+ * Second sub-idea
+ * Last sub-idea
+ \enditems
+* Finito
+\enditems
+\endtt
+
+produces:
+
+\begitems
+* First idea
+* Second idea in subitems:
+ \begitems \style i
+ * First sub-idea
+ * Second sub-idea
+ * Last sub-idea
+ \enditems
+* Finito
+\enditems
+
Another style can be defined by the command `\sdef{_item:<style>}{<text>}`.
Default item can be redefined by `\def\normalitem{<text>}`.
The list environments can be nested. Each new level of item is indented by
@@ -465,6 +491,7 @@ The vertical space at begin and end of the environment is inserted by the
macro `\iiskip`.
+\label[toc]
\sec Table of contents
%%%%%%%%%%%%%%%%%%%%%%
@@ -482,6 +509,24 @@ title of the section by the code:
\nonum\notoc\sec Table of Contents
\endtt
+\new
+If you are using a special macro in section titles or chapter titles
+and you need different behavior of such macro in other cases then use
+`\regmacro{<case-toc>}{<case-mark>}{<case-outline>}`.
+The parameters are applied locally in given cases. The `\regmacro` can be
+used repeatedly: the parameters are accumulated (for more macros).
+If a parameter is empty then original definition is used in given case.
+For example:
+
+\begtt
+% default value of \mylogo macro used in text and in the titles:
+\def\mylogo{\leavevmode\hbox{\Red{\it My}\Black{\setfontsize{mag1.5}\rm Lo}Go}}
+% another variants:
+\regmacro {\def\mylogo{\hbox{\Red My\Black LoGo}}} % used in TOC
+ {\def\mylogo{\hbox{{\it My}\/LoGo}}} % used in running heads
+ {\def\mylogo{MyLoGo}} % used in outlines
+\endtt
+
\sec Making the index
%%%%%%%%%%%%%%%%%%%%%
@@ -695,18 +740,19 @@ color. Example:
By default these macros are not defined. It means that no frames are created.
-There are {\em low level} commands to create the links. You can specify the
+There are \"low level" commands to create the links. You can specify the
destination of the internal link by `\dest[<type>:<label>]`. The
active text linked to the `\dest` can be created by
-`\link[<type>:<label>]{<color>}{<text>}`. The `<type>` parameter is one of
+`\ilink[<type>:<label>]{<text>}`. The `<type>` parameter is one of
the `toc`, `pg`, `cite`, `ref` or another special for your purpose.
+These commands create internal links only when `\hyperlinks` is decared.
The `\url` macro prints its parameter in `\tt` font and creates a potential
breakpoints in it (after slash or dot, for example). If `\hyperlinks`
declaration is used then the parameter of `\url` is treated as an external URL link.
An example: `\url{http://www.olsak.net}` creates \url{http://www.olsak.net}.
-The charecters \code{\%}, `\`, `#`, `{` and `}` have to be protected by
-backslash in the `\url` argument, the other special charecters `~`,
+The characters \code{\%}, `\`, `#`, `{` and `}` have to be protected by
+backslash in the `\url` argument, the other special characters `~`,
`^`, `&` can be written as single character\fnote
{More exactly, there is the same rules as for \code{\\code} command, see
section~\ref[verbatim].}.
@@ -715,10 +761,7 @@ in the `\url` argument as a potential breakpoint.
If the linked text have to be different than the URL, you can use
`\ulink[<url>]{text}` macro. For example:
-
-\begtt
-\ulink[http://petr.olsak.net/optex]{\OpTeX/ page}
-\endtt
+`\ulink[http://petr.olsak.net/optex]{\OpTeX/ page}`
creates
\ulink[http://petr.olsak.net/optex]{\OpTeX/ page}.
@@ -730,6 +773,12 @@ such outlines from data used for table of contents in the document. The
in the default view. The deeper levels can be open by mouse click on the
triangle symbol after that.
+\new
+If you are using a special macro in section titles then `\outlines` macro
+may crash. You must declare variant of the macro for outlines case which is
+expandable using `\regmacro`. See section \ref[toc] for more information
+about `\regmacro`.
+
The command `\insertoutline{<text>}` inserts next entry into PDF outlines at
the main level~0. This entry can be placed before table of contents (created
by `\outlines`) or after it.
@@ -786,7 +835,7 @@ decared in a group). There are tips for such global `\tthook` definitions here:
\begtt
\tthook={\typosize[9/11]} % setting font size for verbatim
\tthook={\ttline=0} % each listing will be numbered from one
-\tthook={\adef{ }{\char9251 }} % visualisation of spaces (unicode fonts)
+\tthook={\adef{ }{\char9251 }} % visualization of spaces (Unicode fonts)
\endtt
\new
@@ -805,7 +854,7 @@ parameter of macros and macro definitions, especially in titles declared by
`\chap`, `\sec` etc.
\new
You ca use more robust command `\code{<text>}` in such
-situations, but you must escape following charaters in the <text>:
+situations, but you must escape following characters in the <text>:
`\`, `#`, `%`, braces (if the braces are unmatched in the <text>),
and space or `^` (if there are more than one subsequent spaces or `^` in
the <text>). Examples:
@@ -875,9 +924,9 @@ generates the following result:
\bigskip
Apart from `l`, `r`, `c` declarators, you can use the `p{<size>}` declarator
-which declares the column of given width. More preciselly, a long text in
+which declares the column of given width. More precisely, a long text in
the table cell is printed as an paragraph with given width.
-To avoid the problems with narrow left-right aligned paragraphs you can write
+To avoid problems with narrow left-right aligned paragraphs you can write
`p{<size>\raggedright}`, then the paragraph will be only left aligned.
You can use `(<text>)` in the <declaration>. Then this text is applied in
@@ -926,7 +975,7 @@ If there is an item which spans to more than one column in the table then
`\mspan<number>[<declaration>]{<text>}`
which spans <number> columns and formats the <text> by the
<declaration>. The <declaration> must include a declaration of right one column
-with the same syntax as comon `\table` <declaration>.
+with the same syntax as common `\table` <declaration>.
If your table includes vertical rules and you want to
create continuous vertical rules by `\mspan`, then use rules
only after `c`, `l` or `r` letter in `\mspan` <declaration>. The
@@ -994,7 +1043,7 @@ storing and restoring the current transformation matrix and current point.
The possition of current point have to be the same from \TeX{}'s point of
view as from transformation point of view when `\pdfrestore` is processed.
Due to this fact the `\pdfsave\rlap{<transformed text>}\pdfrestore`
-or something similar is recomeded.
+or something similar is recommeded.
\OpTeX/ provides the macros
@@ -1006,8 +1055,8 @@ or something similar is recomeded.
These macros simply calls the
properly `\pdfsetmatrix` primitive command.
-It is known that the comosition of transformations is not commutative. It
-means that the order is important. You have to read the tranformation
+It is known that the composition of transformations is not commutative. It
+means that the order is important. You have to read the transformation
matrices from right to left. Example:
\begtt
@@ -1035,7 +1084,7 @@ third: \pdfsave \pdfrotate{-15.3}\pdfsetmatrix{2 0 1.5 2}\rlap{text3}\pdfrestore
The plain \TeX/'s macro `\footnote` can be used as usual. But a new macro
`\fnote{<text>}` is defined. The footnote mark is added automatically and it
is numbered on each page from one\fnote
-{This behavior is changed if \code{\\runningfnotes} is used:
+{This behavior is changed if `\runningfnotes` is used:
the footnotes are numbered from one in whole document in such case.
Alternatives are possible, see OPmac tricks.}.
The <text> is scaled by
@@ -1196,11 +1245,19 @@ Another examples can be found on the
\sec Typesetting math
%%%%%%%%%%%%%%%%%%%%%
-\OpTeX/ preloads a collection of 7bit Computer modern and AMS fonts.
-You can use them in any size and in the `\boldmath` variant.
+\OpTeX/ preloads a collection of 7bit Computer Modern and AMS fonts.
+You can use them in any size and in the `\boldmath` variant.
+%
+\new
+Most declared font families are configured with recommended Unicode
+math font. This font is automaticlally loaded unless you specify
+`\noloadmath` before first `\fontfam` command. See log file for more
+information about loading text font family and Unicode math fonts. If you
+prefer another Unicode math font, specify it by `\loadmath{[<font-file>]}`
+or `\loadmath{font-name}` before first `\loadfam` command.
Hundreds math symbols and operators like in AMS\TeX/ are accesible.
-For example `\alpha` $\alpha$, `\geq` $\geq$, `\sum` $\sum$,
+For example `\alpha` $\alpha$, `\geq`~$\geq$, `\sum` $\sum$,
`\sphericalangle` $\sphericalangle$, `\bumpeq`, $\bumpeq$. See AMS\TeX/
manual for complete list of symbols.
@@ -1221,13 +1278,6 @@ The following math alphabets are available:
The last two selectors `\bf` and `\bi` select the sans serif fonts regardless
current text font family.
-You can use `\noloadmath` before first `\fontfam` command in your document.
-Then `\fontfam` loads only text fonts. On the other case, by default, first
-`\fontfam` command loads Unicode-math fonts related to given text font
-family and Computer Modern nor AMS fonts are not used in math formulae.
-(note, that in version Feb 2020, the Unicode math fonts are in TODO list,
-`\fontfam` commands loads only text fonts now).
-
The math fonts can be scaled by `\typosize` and `\typoscale` macros.
Two math fonts collections are prepared: `\normalmath` for normal weight
and `\boldmath` for bold. The first one is set by default.
@@ -1290,7 +1340,7 @@ used. For example:
\endtt
%
declares the paper 100$\times$200\,mm with all four margins 7\,mm. The spaces
-before and after <fmt> parameter are necessery.
+before and after <fmt> parameter are necessary.
The command `\magscale[<factor>]` scales the whole typesetting area.
\new The fixed point of such scaling is the upper left corner of the paper sheet.
@@ -1318,7 +1368,7 @@ file is open. This file isn't open for every documents; only for those
where the forward references are printed or table of contents is created.
If the `*.ref` file isn't open for your document and you need to use the
`\lastpage` register then you have to write the command `\openref`. This command opens
-the `*.ref` file immediatelly.
+the `*.ref` file immediately.
There is an example for footlines in the format \"current page / last page":
@@ -1330,11 +1380,11 @@ There is an example for footlines in the format \"current page / last page":
\sec Using more languages
%%%%%%%%%%%%%%%%%%%%%%%%%
-\OpTeX/ prepares hyphenation patterns for all languafes if such patterns are
+\OpTeX/ prepares hyphenation patterns for all languages if such patterns are
available in your \TeX/ system.
\new
Only USenglish patterns (original from Plain \TeX/) are preloaded.
-Hyphenation patterns of all aother languages are loaded on demand when you first use
+Hyphenation patterns of all another languages are loaded on demand when you first use
the `\<iso-code>lang` command in your document.
For example `\delang` for German, `\cslang` for
Czech, `\pllang` for Polish. The <iso-code> is a shortcut
@@ -1354,14 +1404,14 @@ For compatibility with e-plain macros, there is the command
language name, i.e.\ `\uselanguage{Czech}` does the same work as `\cslang`.
The `\uselanguage` parameter is case insensitive.
-For compatibility with \csplain/ these are macros `\ehyph`, `\chyph`,
+For compatibility with \csplain/ there are macros `\ehyph`, `\chyph`,
`\shyph` which are equivalent to `\enlang`, `\cslang` and `\sklang`.
You can switch between language patterns by `\<iso-code>lang` commands mentioned
above.
-\OpTeX/ needs to know three words for catpions and titles in technical
-articles: \"Chapter", \"Table" and \"Figure". THese words needs to be know
+\OpTeX/ needs to know three words for captpions and titles in technical
+articles: \"Chapter", \"Table" and \"Figure". These words needs to be know
in used language. \OpTeX/ declares these words only for few languages:
Czech, Slovak, English. If you need to use these words in another languages,
you can declare them by `\sdef` command
@@ -1481,7 +1531,7 @@ document. Or you can use `<prefixed text>\address...` to put
`<prefixed text>` before first line of the address.
Analogical declaration macros `\book` or `\slides` are not prepared. Each
-book needs an individual typographical care so you need to cerate specific
+book needs an individual typographical care so you need to create specific
macros for design. And you can find an inspiration of slides in OPmac tricks
\ulink[http://petr.olsak.net/opmac-tricks-e.html\#slidy]{0017 and 0022}.
@@ -1493,7 +1543,7 @@ macros for design. And you can find an inspiration of slides in OPmac tricks
\tit Title (terminated by end of line)
\chap Chapter Title (terminated by end of line)
\sec Section Title (terminated by end of line)
-\secc Subsection Title (terminanted by end of line)
+\secc Subsection Title (terminated by end of line)
\maketoc % table of contents generation
\ii item1,item2 % insertion the items to the index
@@ -1512,7 +1562,7 @@ macros for design. And you can find an inspiration of slides in OPmac tricks
\begtt % start verbatim text
! % end verbatim text
\activettchar X % initialization character X for in-text verbatim
-\code % another alternative for in-text vrbatim
+\code % another alternative for in-text verbatim
\verbinput % verbatim extract from the external file
\begmulti num % start multicolumn text (num columns)
\endmulti % end multicolumn text
diff --git a/Master/texmf-dist/tex/luatex/optex/basics-macros.opm b/Master/texmf-dist/tex/luatex/optex/basics-macros.opm
index 638270d38b5..9f87f27c832 100644
--- a/Master/texmf-dist/tex/luatex/optex/basics-macros.opm
+++ b/Master/texmf-dist/tex/luatex/optex/basics-macros.opm
@@ -4,37 +4,63 @@
\let\_bgroup={ \let\_egroup=}
-\_bgroup \_lccode`\.=`\\ \_lowercase{\_egroup \_def\_nbackslash {.}}
-\_edef \_nbb {\_nbackslash\_nbackslash}
-\_edef \_pcent{\_csstring\%}
\_def \_empty {}
\_def \_space { }
\_def \_null {\_hbox{}}
\_def \_wlog {\_immediate\_write-1 } % write on log file (only)
-\_def \_opwarning #1{\_wterm{WARNING: #1.}}
+
+\_edef\_bslash {\_csstring\\}
+\_edef \_nbb {\_bslash\_bslash}
+\_edef \_pcent{\_csstring\%}
\_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 \_adef #1{\_catcode`#1=13 \_begingroup \_lccode`\~=`#1\_lowercase{\_endgroup\_def~}}
\_def \_cs #1{\_csname#1\_endcsname}
-
\_long\_def \_addto #1#2{\_ea\_def\_ea#1\_ea{#1#2}}
+\_def \_opwarning #1{\_wterm{WARNING: #1.}}
-\_def\_loggingall{\_tracingcommands=3 \tracingstats=2 \tracingassigns=1
- \tracingpages=1 \tracingoutput=1 \tracinglostchars=1
- \tracingmacros=2 \tracingparagraphs=1 \tracingrestores=1 }
-\_def\_tracingall{\tracingonline=1 \loggingall}
-
-\_def\_remfirstunderscore#1{\_ea\_remfirstunderscoreA#1\_relax#1}
-\_def\_remfirstunderscoreA#1#2\_relax#3{\_if _#1\_def#3{#2}\_fi}
+\_def\_loggingall{\_tracingcommands=3 \_tracingstats=2 \_tracingpages=1
+ \_tracingoutput=1 \_tracinglostchars=1 \_tracingmacros=2
+ \_tracingparagraphs=1 \_tracingrestores=1 \_tracingscantokens=1
+ \_tracingifs=1 \_tracinggroups=1 \_tracingassigns=1 }
+\_def\_tracingall{\_tracingonline=1 \_loggingall}
\_public
- \bgroup \egroup \nbackslash
- \empty \space \null \nbb \pcent \ncaret
+ \bgroup \egroup \empty \space \null \wlog
+ \bslash \nbb \pcent
\sdef \sxdef \slet \cs \adef
\addto \wlog \opwarning
\loggingall \tracingall ;
\_endcode % -------------------------------------
+`\bgroup`, `\egroup`, `\empty`, `\space`, `\null` and `\wlog` are classical
+macros from plain \TeX/.
+
+`\bslash` is \"normal backslash" with category code 12.
+`\nbb` and `\pcent` are double backslash and normal `%`, they should
+be used in lua codes, for example.
+
+`\sdef{<text>}` is equivalent to `\def\<text>`, where `\<text>` is a control
+sequence. You can use arbitrary parameter mask after `\sdef{<text>}`, don't
+put the (unwanted) space immediately after closing brace \code{\}}.
+
+`\sxdef{<text>}` is equivalent to `\xdef\<text>`.
+
+`\slet{<textA>}{<textB>}` is equivalent to `\let \<textA> = \<textB>`.
+
+`\adef{<char>}{<body>}` puts the <char> as active character and defines it
+as {<body>}. You can use parameter mask too.
+
+`\cs{<text>}` is only a shortcut to `\csname <text>\endcsname`, but you need
+one more `\ea` if you need to ger the real control sequence `\<text>`.
+
+`\addto\macro{<text>}` adds <text> to your `\macro`, which must be defined.
+
+`\opwarning{<text>}` prints warning on the terminal and to the log file.
+
+`\loggingall` and `\tracingall` is similar as in plain \TeX/, but prints
+more logging information to the log file and to the terminal.
+
diff --git a/Master/texmf-dist/tex/luatex/optex/f-adventor.opm b/Master/texmf-dist/tex/luatex/optex/f-adventor.opm
index 93afbee7876..022b14a1de6 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-adventor.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-adventor.opm
@@ -2,7 +2,7 @@
\_fontdecl [Adventor] \Adventor {TeX Gyre Adventor based on Avantgarde Book}
{\caps} {\rm \bf \it \bi} {}
- "[texgyreadventor-regular]"
+ {[texgyreadventor-regular]}
\_wlog{\_detokenize{%
Modifier:^^J
@@ -11,7 +11,7 @@ Modifier:^^J
\_protected\_def \Adventor {%
\_def \_currfamily {Adventor}%
- \_def \_fontnamegen {"[texgyreadventor-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[texgyreadventor-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-antt.opm b/Master/texmf-dist/tex/luatex/optex/f-antt.opm
index efbdb9a1d68..d7015ed28db 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-antt.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-antt.opm
@@ -2,16 +2,20 @@
\_fontdecl [Antykwa Torunska] \Antt {Traditional Polish font family}
{\cond \medium \light \caps} {\rm \bf \it \bi} {Pagella}
- "[AntykwaTorunska-Regular]"
+ {[AntykwaTorunska-Regular]}
\_wlog{\_detokenize{%
-Modifier:^^J
+Modifiers:^^J
\caps ...... caps & small caps^^J
+ \cond ...... condensed^^J
+ \medium .... medium weight^^J
+ \light ..... light weight^^J
+ \cond ...... condensed^^J
}}
\_protected\def \Antt {%
\_def \_currfamily {Antt}%
- \_def \_fontnamegen {"[AntykwaTorunska\_sfamxV\_sfamyV-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[AntykwaTorunska\_sfamxV\_sfamyV-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV sfamx={},sfamy={},caps={} \_fvars Regular Bold Italic BoldItalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-baskerville.opm b/Master/texmf-dist/tex/luatex/optex/f-baskerville.opm
index c493f7e0b57..a81e97f6398 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-baskerville.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-baskerville.opm
@@ -2,7 +2,7 @@
\_fontdecl [Baskerville] \Baskerville {Free vaiants of classical Baskerville}
{\caps} {\rm \bf \it \bi} {}
- "[BaskervilleF-Regular]"
+ {[BaskervilleF-Regular]}
\_wlog{\_detokenize{%
Modifier:^^J
@@ -11,7 +11,7 @@ Modifier:^^J
\_protected\def \Baskerville {%
\_def \_currfamily {Baskerville}%
- \_def \_fontnamegen {"[BaskervilleF-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[BaskervilleF-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={} \_fvars Regular Bold Italic BoldItalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-bonum.opm b/Master/texmf-dist/tex/luatex/optex/f-bonum.opm
index e1fc78680bd..6c163ce7cbe 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-bonum.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-bonum.opm
@@ -2,7 +2,7 @@
\_fontdecl [Bonum] \Bonum {TeX Gyre Bonum fonts based on Bookman}
{\caps} {\rm \bf \it \bi} {Bonum}
- "[texgyrebonum-regular]"
+ {[texgyrebonum-regular]}
\_wlog{\_detokenize{%
Modifier:^^J
@@ -11,7 +11,7 @@ Modifier:^^J
\_protected\def \Bonum {%
\_def \_currfamily {Bonum}%
- \_def \_fontnamegen {"[texgyrebonum-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[texgyrebonum-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-cursor.opm b/Master/texmf-dist/tex/luatex/optex/f-cursor.opm
index b89a4a74119..0774a6d0b9b 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-cursor.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-cursor.opm
@@ -2,7 +2,7 @@
\_fontdecl [Cursor] \Cursor {TeX Gyre Cursor fonts based on Courier}
{\caps} {\rm \bf \it \bi} {}
- "[texgyrecursor-regular]"
+ {[texgyrecursor-regular]}
\_wlog{\_detokenize{%
Modifier:^^J
@@ -11,7 +11,7 @@ Modifier:^^J
\_protected\def \Cursor {%
\_def \_currfamily {Cursor}%
- \_def \_fontnamegen {"[texgyrecursor-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[texgyrecursor-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-gfsbodoni.opm b/Master/texmf-dist/tex/luatex/optex/f-gfsbodoni.opm
index 7afbe001cce..4b743e07252 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-gfsbodoni.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-gfsbodoni.opm
@@ -2,16 +2,16 @@
\_fontdecl [GFS Bodoni] \GFSBodoni {Based on Bodoni with greek letters}
{} {\rm \bf \it \bi} {}
- "[GFSBodoni]"
+ {[GFSBodoni]}
\_wlog{\_detokenize{%
Modifier:^^J
- \caps ...... doesn't work even though otfinfo -f lists cmcp^^J
+ \caps ...... doesn't work even though otfinfo -f lists smcp^^J
}}
\_protected\def \GFSBodoni {%
\_def \_currfamily {GFSBodoni}%
- \_def \_fontnamegen {"[GFSBodoni\_currV]:\_fontfeatures"}%
+ \_def \_fontnamegen {[GFSBodoni\_currV]:\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fvars {} Bold It BoldIt }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-heros.opm b/Master/texmf-dist/tex/luatex/optex/f-heros.opm
index 6bea7a2642c..5a03746cae2 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-heros.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-heros.opm
@@ -2,7 +2,7 @@
\_fontdecl [Heros] \Heros {TeX Gyre Heros fonts based on Helvetica}
{\caps \cond} {\rm \bf \it \bi} {FiraMath}
- "[texgyreheros-regular]"
+ {[texgyreheros-regular]}
\_wlog{\_detokenize{%
Modifiers:^^J
@@ -12,7 +12,7 @@ Modifiers:^^J
\_protected\_def \Heros {%
\_def \_currfamily {Heros}%
- \_def \_fontnamegen {"[texgyreheros\_condV-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[texgyreheros\_condV-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={},cond={} \_fvars regular bold italic bolditalic }
@@ -45,7 +45,7 @@ rules.
\begtt
\_fontdecl [<Name of family>] \<Main-command> {<comments>}
{<modifiers>} {<variant selectors>} {<comments about math fonts>}
- "<font-for-testing>"
+ {<font-for-testing>}
\endtt
as first command in this file. This writes information about font family at
terminal and prevents loading such file twice. Moreover, it probes
@@ -84,27 +84,31 @@ name) and to optional fontfeatures appended. The font selection
system uses this macro at primitive level in the following sense:
\begtt
- \font \_fontnamegen \space \_sizespec
+ \font {\_fontnamegen} \_sizespec
\endtt
For example, using macros from `f-heros.opm` the `\font` command expands its
parameters to:
\begtt
- \font "[texgyreheros-regular]:+tlig;" at10pt
+ \font {[texgyreheros-regular]:+tlig;} at10pt
\endtt
if the `\rm` variant is processed and if no additional font modifiers are
activated. Of course, you need to know something about fontname syntax for
-extended `\font` primitive used with OTF fonts. The `"` characters are at
-outside boundary of font name. The `[` `]` brackets tell us that the file
-name (no font name) is specified inside such brackets. This file (with
-additional `.otf` extension) must be accessible in your filesystem. Without
-spaces, there are font features appended to file name (or font name) divided
-by semicolon. The `+tlig` font feature means that TeX like ligatures
-(minus minus = endash, for example) are active. Normal ligatures are active
-by default. You can list font features of given font by
-`otfinfo -f fontfile.otf`.
+extended `\font` primitive used with OTF fonts. The `[` `]` brackets tell us
+that the file name (no font name) is specified inside such brackets. This
+file (with additional `.otf` or `.ttf` extension) must be accessible by
+Lua\TeX/ in your filesystem. Without spaces, there are font features
+appended to file name (or font name) divided by semicolon. The `+tlig` font
+feature means that TeX like ligatures (minus minus = endash, for example)
+are active. Normal ligatures are active by default. You can list font
+features of given font by `otfinfo -f fontfile.otf`.
+
+The `\_fontnamegen` macro must include colon followed by family dependent
+font features (optional) and followed by `\_fontfeatures` (required).
+If this is not true then font modifiers `\setff`, `\setfontcolor`,
+`\setletterspace` and `\setwordspace` don't work.
You can use any expandable macros or expandable primitives in `\fontnamegen`
macro. The simple macros in it with names `\_<word>V` are preferred. They
@@ -136,7 +140,7 @@ Example: if both modifiers `\caps` and `\cond` were applied from this family
Heros and `\bf` variant is needed at 11pt then
\begtt
- \font "[texgyreheroscn-bold]:+smcp;+tlig;" at11pt
+ \font {[texgyreheroscn-bold]:+smcp;+tlig;} at11pt
\endtt
is processed. We assume that a font file texgyreheroscn-bold.otf is present
diff --git a/Master/texmf-dist/tex/luatex/optex/f-libertine-s.opm b/Master/texmf-dist/tex/luatex/optex/f-libertine-s.opm
index 1eb2933faa6..123585dac71 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-libertine-s.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-libertine-s.opm
@@ -1,8 +1,8 @@
%% This is part of OpTeX project, see http://petr.olsak.net/optex
-\_fontdecl [Linux Libertine] \libertine {Free Linux Libertine fonts}
+\_fontdecl [Linux Libertine] \Libertine {Free Linux Libertine fonts}
{\sans \mono \caps} {\rm \bf \it \bi \initials \displ \keybr} {}
- "Linux Libertine O"
+ {Linux Libertine O}
\_wlog{\_detokenize{%
Modifiers^^J
@@ -15,9 +15,9 @@ Special variants:^^J
\keybr ..... keyboard, emulates keyboard buttons^^J
}}
-\_protected\_def \_libertine {%
- \_def \_currfamily {libertine}%
- \_def\_fontnamegen {"Linux \_mainfamV\_V\_subfamV O/\_currV:\_capsV\_fontfeatures"}%
+\_protected\_def \Libertine {%
+ \_def \_currfamily {Libertine}%
+ \_def\_fontnamegen {Linux \_mainfamV\_V\_subfamV O/\_currV:\_capsV\_fontfeatures}%
\_resetmod
}
diff --git a/Master/texmf-dist/tex/luatex/optex/f-libertine.opm b/Master/texmf-dist/tex/luatex/optex/f-libertine.opm
index adc0961f7a7..041e3742f08 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-libertine.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-libertine.opm
@@ -2,7 +2,7 @@
\_fontdecl [Linux Libertine] \Libertine {Free Linux Libertine fonts}
{\sans \mono \caps \semi} {\rm \bf \it \bi \initials \displ \keybr} {Libertinus}
- "[LinLibertine_R]"
+ {[LinLibertine_R]}
\_wlog{\_detokenize{%
Modifiers:^^J
@@ -18,7 +18,7 @@ Special variants:^^J
\_protected\_def \Libertine {%
\_def \_currfamily {Libertine}%
- \_def\_fontnamegen {"[Lin\_subfamV _\_currV]:\_capsV\_fontfeatures"}%
+ \_def\_fontnamegen {[Lin\_subfamV _\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV subfam=Libertine,caps={} \_fvars R RB RI RBI }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-lido.opm b/Master/texmf-dist/tex/luatex/optex/f-lido.opm
new file mode 100644
index 00000000000..e082663125d
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/optex/f-lido.opm
@@ -0,0 +1,52 @@
+%% This is part of OpTeX project, see http://petr.olsak.net/optex
+
+\_fontdecl [Lido] \Lido {by StormType Foundry designed for "lidove noviny"}
+ {\caps \cond} {\rm \bf \mr \mi \it \bi} {Termes}
+ {[LidoSTF]}
+
+\_wlog{\_detokenize{%
+Variants:^^J
+ \rm \bf \it \bi ... classical variants^^J
+ \mr \mi .... medium regular and medium italics (between normal and bold)^^J
+Modifiers:^^J
+ \cond ...... condensed (italic is not avalable for \cond variants)^^J
+ \medium .... sets \mr \bf \mi \bi family
+}}
+
+\_protected\def \Lido {%
+ \_def \_currfamily {Lido}%
+ \_def \_fontnamegen {[LidoSTF\_condV\_currV]:\_capsV\_fontfeatures}%
+ \_resetmod
+}
+\_moddef \resetmod {\_fsetV caps={},cond={},ital=Italic \_fvars {} Bold {\_italV} {Bold\_italV} }
+\_moddef \medium {\_fvars Medium Bold {Medium\_italV} {Bold\_italV} }
+\_moddef \cond {\_fsetV cond=Condensed,ital={} }
+
+\_famvardef \mr {\_fvars Medium . . . \_rm}
+\_famvardef \mi {\_fvars . . {Medium\_italV} . \_it}
+
+
+\_initfontfamily % new font family must be initialized
+
+\_loadmath {[texgyretermes-math]}
+
+\_endcode
+
+This font family Lido by Storm Type Foundry was designed for Lidove noviny
+newspaper. It is similar to Times but it is not Times.
+
+The Lido font family supports 6 standard selectors
+
+\rm Regular \it Italics
+\mr Medium-Regular \mi Medium-Italics
+\bf Bold-Regular \bi Bold-Italics
+
+and three Condensed variants:
+
+\cond \rm Condensed
+ \mr Condensed-Medium
+ \bf Condensed-Bold
+
+The italic variants are missing when \cond is selected. This means that
+\cond\it does the same as \cond\rm etc.
+
diff --git a/Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm b/Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm
index 5be1362b0b0..7a7c7527afe 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm
@@ -3,7 +3,7 @@
\_fontdecl [Latin Modern] \LMfonts {TeX Gyre fonts based on Coputer Modern}
{\roman \sans \quotset \ttset \ttprop \ttlight \ttcond \upital
\dunhill submods:\caps \slant \nbold \bolder} {\rm \bf \it \bi \tt} {LM}
- "[lmroman10-regular]"
+ {[lmroman10-regular]}
\_wlog{\_detokenize{%
Modifiers (selects subfamily):^^J
@@ -19,7 +19,7 @@ Modifiers (selects subfamily):^^J
Submodifiers (setlects special variants of given subfamily):^^J
\caps ...... caps & small caps (available only at limited shapes)^^J
\slant ..... slanted (default in some subfamilies)^^J
- \nbold ..... normal bold (\roman gives extended bold by default)^^J
+ \nbold ..... normal bold (extended bold is default)^^J
\bolder .... extended bold^^J
}}
diff --git a/Master/texmf-dist/tex/luatex/optex/f-pagella.opm b/Master/texmf-dist/tex/luatex/optex/f-pagella.opm
index 1f9b8dac806..27127b7a6f1 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-pagella.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-pagella.opm
@@ -2,7 +2,7 @@
\_fontdecl [Pagella] \Pagella {TeX Gyre Pagella fonts based on Palatino}
{\caps} {\rm \bf \it \bi} {Pagella}
- "[texgyrepagella-regular]"
+ {[texgyrepagella-regular]}
\_wlog{\_detokenize{%
Modifier:^^J
@@ -11,7 +11,7 @@ Modifier:^^J
\_protected\def \Pagella {%
\_def \_currfamily {Pagella}%
- \_def\_fontnamegen {"[texgyrepagella-\_currV]:\_capsV\_fontfeatures"}%
+ \_def\_fontnamegen {[texgyrepagella-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-schola.opm b/Master/texmf-dist/tex/luatex/optex/f-schola.opm
index 649515e4a1a..d876582683a 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-schola.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-schola.opm
@@ -2,7 +2,7 @@
\_fontdecl [Schola] \Schola {TeX Gyre Schola fonts based on New Century}
{\caps} {\rm \bf \it \bi} {Schola}
- "[texgyreschola-regular]"
+ {[texgyreschola-regular]}
\_wlog{\_detokenize{%
Modifier:^^J
@@ -11,7 +11,7 @@ Modifier:^^J
\_protected\def \Schola {%
\_def \_currfamily {Schola}%
- \_def\_fontnamegen {"[texgyreschola-\_currV]:\_capsV\_fontfeatures"}%
+ \_def\_fontnamegen {[texgyreschola-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-technika.opm b/Master/texmf-dist/tex/luatex/optex/f-technika.opm
index cf9a197dda2..1e572345a46 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-technika.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-technika.opm
@@ -2,20 +2,20 @@
\_fontdecl [Technika] \Technika {Fonts from visual style of CTU in Prague}
{\caps \light} {\rm \bf \it \bi \stencil} {}
- "[Technika-Regular]"
+ {[Technika-Regular]}
\_wlog{\_detokenize{%
Modifiers:^^J
- \light ..... ligher variants: \rm\bf=light \bf\bi=normal
- \book ..... semi-ligher variants: \rm\bf=book \bf\bi=bold
+ \light ..... ligher variants: \rm\bf=light \bf\bi=normal^^J
+ \book ...... semi-ligher variants: \rm\bf=book \bf\bi=bold^^J
\caps ...... caps & small caps^^J
Special variant:^^J
- \stencil ... dashed leters (only uppercase)^J
+ \stencil ... dashed leters (only uppercase)^^J
}}
\_protected\def \Technika {%
\_def \_currfamily {Technika}%
- \_def \_fontnamegen {"[Technika\_stencilV-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[Technika\_stencilV-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV stencil={},caps={} \_fvars Regular Bold Italic BoldItalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-termes.opm b/Master/texmf-dist/tex/luatex/optex/f-termes.opm
index d64d6a463e5..e0ed0c63c45 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-termes.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-termes.opm
@@ -2,7 +2,7 @@
\_fontdecl [Termes] \Termes {TeX Gyre Termes fonts based on Times}
{\caps} {\rm \bf \it \bi} {Termes}
- "[texgyretermes-regular]"
+ {[texgyretermes-regular]}
\_wlog{\_detokenize{%
Modifier:^^J
@@ -11,7 +11,7 @@ Modifier:^^J
\_protected\def \Termes {%
\_def \_currfamily {Termes}%
- \_def \_fontnamegen {"[texgyretermes-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[texgyretermes-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/f-xcharter.opm b/Master/texmf-dist/tex/luatex/optex/f-xcharter.opm
index d7b4d475487..d889c8ba2b1 100644
--- a/Master/texmf-dist/tex/luatex/optex/f-xcharter.opm
+++ b/Master/texmf-dist/tex/luatex/optex/f-xcharter.opm
@@ -2,16 +2,17 @@
\_fontdecl [XCharter] \XCharter {An extension of Bitstream Charter}
{\caps \slant} {\rm \bf \it \bi} {}
- "[XCharter-Roman]"
+ {[XCharter-Roman]}
\_wlog{\_detokenize{%
-Modifier:^^J
+Modifiers:^^J
\caps ...... caps & small caps^^J
+ \slant ..... slanted variants used in \it, \bi^^J
}}
\_protected\def \XCharter {%
\_def \_currfamily {XCharter}%
- \_def \_fontnamegen {"[XCharter-\_currV]:\_capsV\_fontfeatures"}%
+ \_def \_fontnamegen {[XCharter-\_currV]:\_capsV\_fontfeatures}%
\_resetmod
}
\_moddef \resetmod {\_fsetV caps={} \_fvars Roman Bold Italic BoldItalic }
diff --git a/Master/texmf-dist/tex/luatex/optex/fams-ini.opm b/Master/texmf-dist/tex/luatex/optex/fams-ini.opm
index 096e32df5c2..fca923963c5 100644
--- a/Master/texmf-dist/tex/luatex/optex/fams-ini.opm
+++ b/Master/texmf-dist/tex/luatex/optex/fams-ini.opm
@@ -38,7 +38,7 @@
\_famtext {Other fonts:}
-\_faminfo [Linux Libertine] {Free fonts typicaly instaled in systems} {f-libertine}
+\_faminfo [Linux Libertine] {Free fonts typicaly installed in systems} {f-libertine}
{ -: {\rm\bf\it\bi} \semi: {\rm\it}
\caps,\sans,\mono,\caps\sans: {\rm\bf\it\bi} -: {\initials\displ\keybr} }
\_famalias [Libertine] \_famalias [LinLibertine]
@@ -84,7 +84,7 @@ registering it. But problem is that such families are not listed when
`\fontfam[?]` is used and it is not included in font catalogue when
`\fontfam[catalog]` is printed. The list of families taken in the catalogue and
listed on the terminal is declared in two files: `fams-ini.opm` and
-`fams-user.opm`. The second file is optional. User can create it and write to
+`fams-local.opm`. The second file is optional. User can create it and write to
it the information about user-defined families using the same syntax as in
existed file `fams-ini.opm`.
diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm b/Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm
index f771fe92ebe..f9cd2af6df8 100644
--- a/Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm
+++ b/Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm
@@ -3,8 +3,9 @@
\_initunifonts
\_begingroup
-\_noloadmath
+\_istoksempty\_catalogmathsample \_iftrue \_noloadmath \_fi
\_let\_ttfixed=\_tentt
+\_fontlet\_smalltt=\_tentt at7pt
\_suppressfontnotfounderror=1
\_lowercase\_ea{\_ea\_def\_ea\_cataloglist\_ea{\_the\_catalogonly}}
@@ -28,9 +29,14 @@
\_iftrue \def\_cataloglist{.}\_fi
\_ifx\_cataloglist\_empty
\_ifx^#4^\_else
- \_bigskip {\_qquad\_ttfixed\_string\fontfam [#1] -- (#2)\_par}
- \_fontfam[#1]
+ \_bigskip {\_ttfixed\_string\fontfam [#1] -- (#2)\_par}
+ \_input #3.opm
\_ifexistfam \_nobreak\_medskip \_dosamples #4:{}
+ \_ifx\_mathfaminfo\_empty
+ \_else \_istoksempty\_catalogmathsample
+ \_iftrue {\_ttfixed \$Default math font\$: \_mathfaminfo \_par}
+ \_else Default math font (\_mathfaminfo): \_the\_catalogmathsample \_par
+ \_fi\_fi
\_else {\_qquad\_ttfixed ... family skipped, fonts not found in your system.}
\_fi\_fi\_fi
\_egroup
@@ -55,6 +61,14 @@
\_ea \_dosamplesB \_fi
}
+\_def\_wlog#1{\_nobreak\_smallskip
+ \_hbox to\_hsize{\_hskip25pt
+ \_edef\_tmp{#1}\_replstring\_tmp{^^J}{\_par}%
+ \_smalltt \_noindent \_ea \string \_mainfamcommand
+ \_vtop{\leftskip=1em \_baselineskip=9pt \_tmp \_par}\_hss
+ }
+}
+
\_def\0#1{\_ifnum#1<10 0\_fi\_the#1}
\_footline={\_hfil\_ttfixed\_the\_pageno\_hfil}
\_headline={\_ttfixed Font Catalogue generated by \_OpTeX/ \_hfill \_the\_year-\0\_month-\0\_day}
@@ -62,7 +76,8 @@
\_ttfixed
\_input fams-ini.opm
-\_isfile {fams-user.opm}\_iftrue \_input fams-user.opm \_fi
+
+\_isfile {fams-local.opm}\_iftrue \_input fams-local.opm \_fi
\_endgroup
@@ -77,7 +92,20 @@ You can redeclare the printed sample of each font by:
\catalogsample={Hello world!}
\endtt
-before \code{\\fontfam[catalog]} command is used.
+before \code{\\fontfam[catalog]} command is used. You can specify
+\code{\\catalogmathsample} if you want to show default math fonts too, for example
+
+\begtt
+\catalogmathsample={Gamma function is defined as
+ $$
+ \Gamma(z) = \int_0^\infty x^{z-1} e^{-x}{\rm d}x, \quad \Re(z)>0.
+ $$}
+\endtt
+%
+The \code{\\catalogmathsample} is empty by default, so math fonts are not loaded,
+only the family of default math font is listed.
+
+\bigskip
You can restrict the families to be printed in catalogue by:
\begtt
@@ -95,7 +123,7 @@ The \code{\\cataogexclude} is empty by default.
\bigskip The font families printed in the catalogue must be declared by the
\code{\\_faminfo} command in the file \code{fams-ini.opm} (declarations used
-as default for \OpTeX/) or in the file \code{fams-user.opm}. The second file
+as default for \OpTeX/) or in the file \code{fams-local.opm}. The second file
does not exist by default but user can create it. The syntax rules are
described in the \code{fams-ini.opm} file.
diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm b/Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm
index 40f3f4dd50d..52afb97650f 100644
--- a/Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm
+++ b/Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm
@@ -46,11 +46,15 @@
\_mainbaselineskip=\_baselineskip
\_mainfosize=\_optsize
\_bf \_it \_bi \_rm \_normalmath % load fonts if \typosize is running firstly
- \_def \_setmainvalues{\_rm \_everymath={\_normalmath}\_everydisplay={\_normalmath}}%
+ \_let \_setmainvalues =\_setmainvaluesL
}
+\_def\_setmainvaluesL {\_rm \_everymath={\_normalmath}\_everydisplay={\_normalmath}}
\_def\_scalemain {%
- \_ifdim \_mainfosize >0pt
- \_optsize=\_mainfosize \_baselineskip=\_mainbaselineskip \fi
+ \_ifdim \_mainfosize=0pt
+ \_mainfosize=10pt \_mainbaselineskip=12pt
+ \_let \_setmainvalues=\_setmainvaluesL
+ \fi
+ \_optsize=\_mainfosize \_baselineskip=\_mainbaselineskip
}
\_newskip \_mainbaselineskip \_mainbaselineskip=0pt \_relax
@@ -82,6 +86,7 @@
\_let\_italcorr=\/
\_protected\_def \_boldify {%
+ \_let \_setmainvalues=\_setmainvaluesL
\_let\it =\_bi \_let\rm =\_bf \_let\normalmath =\_boldmath
\_let\_it=\_bi \_let\_rm=\_bf \_let\_normalmath=\_boldmath \_rm
}
@@ -90,80 +95,3 @@
\_endcode % -------------------------------------
-
-\sec Font size settings in general (high-level macros)
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-The commands for font size setting described here have local validity. If
-you put them into a group, the described features are selected locally. Don't use
-dimension unit in parameters in these commands. The dimension unit is
-`\ptunit` which is set by `1pt` by default. If you set this register to
-another value at begining of your document, all fonts and `\baselineskip`
-will be set to different sizes.
-
-The command `\typosize[<fontsize>/<baselineskip>]` sets the font size of text and
-math fonts and baselineskip. If one of these two parameters is empty, the
-corresponding feature stays unchanged. Examples:
-
-\begtt
- \typosize[10/12] % default in plainTeX and OpTeX
- \typosize[11/12.5] % font 11pt, baseline 12.5pt
- \typosize[8/] % font 8pt, baseline unchanged
-\endtt
-
-The command `\typoscale[<font-factor>/<baselineskip-factor>]` sets the text
-and math fonts size and baselineskip as a multiple of the current fonts size
-and baselineskip. The factor is written in `scaled`-like way, it means that
-1000 means factor one. The empty parameter is equal to the parameter 1000,
-i.e. the value stays unchanged. Examples:
-
-\begtt
- \typoscale[800/800] % fonts and baselineskip re-size to 80 %
- \typoscale[\magstep2/] % fonts bigger 1,44times
-\endtt
-
-First usage of `\typosize` or `\typoscale` macro in your document sets "main
-values", i.e. main font size and main baselineskip. They are saved in registers
-`\mainfosize` and `\mainbaselineskip`.
-
-The `\typoscale` comand does scaling in respect to current values. If you
-want to do it in respect to main values, type `\scalemain` immediately
-before `\typoscale` command.
-
-\begtt
- \typosize[12/14.4] % first usage in document, sets main values internally
- \typosize[15/18] % bigger font
- \scalemain \typoscale[800/800] % reduces from main values, no from current values.
-\endtt
-
-The size of the current text font can be changed by the command
-"\thefontsize[<font-size>]" or can be rescaled by
-"\thefontscale[<factor>]". These macros don't change math fonts sizes nor
-baselineskip.
-
-When you need titles in bold, you can use the `\boldify` macro with
-co-operation with `\typosize` or `\typoscale` command. The `\boldify` command
-sets `\rm` as `\bf`, `\it` as `\bi` a and math formulae are bolder too.
-Example:
-
-\begtt
- \def\titlefont{\boldify\typosize[15/18]}
- {\titlefont Here is big bold {\it italics is bold-italics} and
- math $a+b^2$ is bolder too.\par}
-\endtt
-
-The `\em` macro acts as `\it` if the current font is `\rm`, acts as `\rm` if
-the current font is `\it`, acts as `\bi` if the current font is `\bf` and
-acts as `\bf` if the current font is `\bi`. The "\/" spaces are inserted
-automatically. Example:
-
-\begtt
- This is {\em important} text. % = This is {\it important\/} text.
- \it This is {\em important} text. % = This is\/ {\rm important} text.
- \bf This is {\em important} text. % = This is {\bi important\/} text.
- \bi This is {\em important} text. % = This is\/ {\bf important} text.
-\endtt
-
-If you are interesting in font selection system used in \OpTeX/ then see
-`fonts-select.opm` file. If you are interesting in font size settings in
-detail, see `font-resize.opm` file.
diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-resize.opm b/Master/texmf-dist/tex/luatex/optex/fonts-resize.opm
index b537c2d7224..c686b85b798 100644
--- a/Master/texmf-dist/tex/luatex/optex/fonts-resize.opm
+++ b/Master/texmf-dist/tex/luatex/optex/fonts-resize.opm
@@ -10,10 +10,11 @@
\_else \_ea \_doresizefont \_fontselector \_fi
\_slet{_tryload#1}{_relax}%
}
-\_def\_doresizefont#1{\_logfont{#1}%
+\_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}
diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-select.opm b/Master/texmf-dist/tex/luatex/optex/fonts-select.opm
index ee8fa7709ba..0bdc0acfd48 100644
--- a/Master/texmf-dist/tex/luatex/optex/fonts-select.opm
+++ b/Master/texmf-dist/tex/luatex/optex/fonts-select.opm
@@ -11,22 +11,23 @@
}%
\_gdef\_rfskipatX ##1" ##2\_relax{"##1"}%
\_gdef\_doresizefont ##1{\_logfont{##1}%
- \_font##1=\_fontnamegen\_space \_sizespec \_relax}%
- \_def \_fontnamegen{ec-lmr10}%
+ \_ifx\_fontnamegen\_undefined \_doresizetfmfont##1\_else
+ \_font##1={\_fontnamegen} \_sizespec \_relax \_setwsp##1\_relax
+ \_fi}%
\_global\_let\_initunifonts=\_relax % we need not to do this work twice
\_global\_let\initunifonts=\_relax
}
-\_def\_fontdecl [#1]#2#3#4#5#6#7"#8"{%
+\_def\_fontdecl [#1]#2#3#4#5#6#7{%
\_initunifonts \_uniaccents
\_ifx #2\_undefined
- \_isfont"#8"\_iffalse
+ \_isfont{#7}\_iffalse
\_opwarning{Family [#1] skipped, font "#7" not found}\_ea\_ea\_ea\_endinput \_else
\_def\_textfamily{#1}%
\_edef\_currfamily {\_csstring #2}%
- \_def\_mainfamcommand{#2}%
+ \_def\_mainfamcommand{#2}\_def\_mathfaminfo{#6}%
\_wterm {FONT: [#1] -- \string#2 \_detokenize{(#3)^^J mods:{#4} vars:{#5} math:{#6}}}%
\_fi
- \_else \_ea \_endinput \_fi
+ \_else \_ea #2\_ea\_endinput \_fi
}
\_def\_regoptsizes #1 #2?#3 #4*{\_sdef{_optsizes:#1}{#2?#3 #4* }}
\_def\_optfontalias #1#2{\_slet{_optsizes:#1}{_optsizes:#2}}
@@ -43,16 +44,28 @@
\_def\_afterfifi #1\_fi\_fi{\_fi\_fi #1}
\_newifi \_ifexistfam
-\_def\_isfont"#1"#2{%
+\_def\_isfont#1#2{%
\_begingroup
\_suppressfontnotfounderror=1
- \_font\_testfont="#1"\_relax
+ \_font\_testfont={#1}\_relax
\_ifx\_testfont\_nullfont \_def\_tmp{\_existfamfalse \_unless}
\else \_def\_tmp{\_existfamtrue}\_fi
\_ea \_endgroup \_tmp #2%
}
-\_def\_fontfeatures{+tlig;}
+\_def \_defaultfontfeatures {+tlig;}
+\_def \_setff #1{%
+ \_ifx^#1^\_let \_fontfeatures=\_defaultfontfeatures
+ \_else \_edef\_fontfeatures{\_fontfeatures #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
+}
\_def\_fvars #1 #2 #3 #4 {%
\_sdef{_fvar:rm}{#1}%
\_sdef{_fvar:bf}{#2}%
@@ -110,7 +123,7 @@
\_ifx \_famfile\_empty \_listfamnames \_fi
\_isfile {f-\_famname.opm}\_iftrue
\_opinput {f-\_famname.opm}
- \_else \_isfile {fams-user.opm}\_iftrue \_opinput {fams-user.opm} \_fi
+ \_else \_isfile {fams-local.opm}\_iftrue \_opinput {fams-local.opm} \_fi
\_ifcsname _famf:\_famname\_endcsname \_edef\_famfile{\_cs{_famf:\_famname}}%
\_else \_edef\_famfile{f-\_famname}\_fi
\_isfile {\_famfile.opm}\_iftrue \_opinput {\_famfile.opm}
@@ -126,7 +139,7 @@
\_wterm{ \_space\_noexpand\fontfam [##1] -- ##2}%
\_let\_famalias=\_famaliasA}%
\_opinput {fams-ini.opm}
- \_isfile {fams-user.opm}\_iftrue \_opinput {fams-user.opm} \_fi
+ \_isfile {fams-local.opm}\_iftrue \_opinput {fams-local.opm} \_fi
\_message{^^J}%
\_endgroup
}
@@ -135,8 +148,8 @@
\_def\_famtext #1{}
\_def\_faminfo [#1]#2#3#4{%
- \_lowercase{\_edef\_famname{\_ea\_removespaces #1 {} }}%
- \_sdef{_famf:\_famname}{#3}%
+ \_lowercase{\_edef\_tmp{\_ea\_removespaces #1 {} }}%
+ \_sdef{_famf:\_tmp}{#3}%
\_def\_famfile{#3}%
}
\_def\_famalias [#1]{%
@@ -144,14 +157,45 @@
\_sdef{_famf:\_famname\_ea}\_ea{\_famfile}%
}
\_input fams-ini.opm
-\_newtoks \_catalogsample
+\_let\_famfile=\_undefined
+\_newtoks \_catalogsample
+\_newtoks \_catalogmathsample
\_newtoks \_catalogonly
\_newtoks \_catalogexclude
\_catalogsample={ABCDabcd Qsty fi fl áéíóúüů řžč ÁÉÍÓÚ ŘŽČ 0123456789}
+\_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 \_setletterspace #1{\_removefeature{letterspace=}%
+ \_if^#1^\_else \_edef\_fontfeatures{\_fontfeatures letterspace=#1;}\_fi
+ \_reloading
+}
+\_def \_setwordspace #1{%
+ \_if^#1^\_def\_setwsp##1{}\_removefeature{+Ws}%
+ \_else \def\_setwsp{\_setwspA{#1}}\_setff{+Ws}\_fi
+ \_reloading
+}
+\_def\_setwsp #1{}
+\_def\_setwspA #1#2{\_fontdimen2#2=#1\_fontdimen2#2%
+ \_fontdimen3#2=#1\_fontdimen3#2\_fontdimen4#2=#1\_fontdimen4#2}
+
+\_def\_calculatefontcolor#1{\_trycs{_fc:#1}{#1}} % you can define more smart macro ...
+\_sdef{_fc:red}{FF0000FF} \_sdef{_fc:green}{00FF00FF} \_sdef{_fc:blue}{0000FFFF}
+\_sdef{_fc:yellow}{FFFF00FF} \_sdef{_fc:cyan}{00FFFFFF} \_sdef{_fc:magenta}{FF00FFFF}
+\_sdef{_fc:white}{FFFFFFFF} \_sdef{_fc:grey}{00000080} \_sdef{_fc:lgrey}{00000025}
+\_sdef{_fc:black}{} % ... you can declare more colors...
+
\_public
- \fontfam \initunifonts \isfont \famvardef \moddef
- \catalogonly \catalogexclude \catalogsample ;
+ \fontfam \initunifonts \isfont
+ \setff \setfontcolor \setletterspace \setwordspace \famvardef \moddef
+ \catalogonly \catalogexclude \catalogsample \catalogmathsample ;
\_endcode %---------------------------------------------------
@@ -161,7 +205,7 @@
Try to write `\fontfam[?]`. All font families registered in \OpTeX/
font selection system are listed on the terminal and in the log file.
-You can choose one of them and use for example `\fontfam[Termes]` or
+You can choose one of them and use it, for example `\fontfam[Termes]` or
`\fontfam[LM Fonts]`. Then you can use four basic variant selectors `\rm` or
or `\bf` or `\it` or `\bi` and desired fonts are printed.
@@ -172,31 +216,25 @@ The fonts registered in \OpTeX/ have their macros in "font files", each family
in one font file with the name `f-famname.opm`. All families are collected
in `fams-ini.opm`. You can read the documentation in the file `fams-ini.opm`
and in the files `f-heros.opm`, `f-lmfonts.opm` for more information how
-to install and to register your own font family. Note that all families
+to install and how to register your own font family. Note that all families
registered in such files are Unicode fonts. Non-Unicode fonts are not
preferred in \OpTeX/ but you can use them using classical `\font` primitive,
of course.
-Each font family is connected with a preferred unicode-math font. This
-unicode-math is activated when font family is loaded. If you don't prefer
-this and you are satisfied with 8bit math CM+AMS fonts preloaded in the
-\OpTeX/ format then you can use command `\noloadmath` before you load a first
-font family.
-
There are two equal possibilities how to load a font family: `\fontfam[Family]`
or `\input f-fontfamily.opm`.
There are "main family command", "font modifiers" and "variant selectors" in
-each family. Each family provides four variant selectors mentioned above
-(may be, in few cases a missing variant is substituded by `\rm` or
-`\it`). A few families provides more than these four variant selectors.
+each family. Each family provides four default variant selectors mentioned above
+(may be, in few cases a missing variants are substituded)
+A few families provides more than these four variant selectors.
Mostly all families provides "font modifiers" like `\caps`, `\light`,
-`\cond`. Which font modifiers are provided is listed in terminal or in the
+`\cond`. Supported font modifiers are listed in terminal or in the
catalogue. A font modifier does nothing with current font, but the next
variant selectors select a modified font. You can combine more than one
font modifiers followed by a variant selector. The font is reloaded at the
-moment when variant selector is in its process. The following example
+moment when variant selector is processed. The following example
supposes that we are working with a font family where `\caps` and `\cond`
font modifiers are provided.
@@ -217,9 +255,9 @@ independent, so there are four variants: normal, condensed, caps and
caps-condensed, all these variants are present in four standard
variants: regular, bold, italics, bold-italics.
-There is one special command `\currvar` which respects the current
-variant and the font of such variant is reloaded with respect to previously
-given font modifiers.
+There is one special command `\currvar` which acts as variant selector.
+It keeps the current variant and the font of such variant is
+reloaded with respect to previously given font modifiers.
You can use the `\setfontsize{<sizespec>}` command in the same sense as
other font modifiers. It means that the command itself does nothing with the
@@ -234,7 +272,7 @@ in 14pt size too \bf bold too.
Note that much more comfortable is to resize fonts using OPmac-like command
`\typosize`, `\typoscale`. These commands prepare the right sizes for math
fonts too and re-calculates many internal parameters like `\baselineskip`. See
-`opmac-fonts.opm` file for more information.
+the section \ref[typosize] for more information.
\secc More than one font families loaded
@@ -249,7 +287,7 @@ family comand. For example, when Heros and Termes are loaded then:
\Heros \rm here is Heros font \it italics is in Heros too.
\endtt
-Summary: To select a font you can use (in this order):
+To select a font you can use (in this order):
\begtt
\<main-family-command> \<font-modifiers> \<variant-selector-or-currvar>
@@ -269,16 +307,18 @@ modifiers are working in context of current used family. For example
font family using different internal definitions.
Maybe, one needs a context switching between `\rm`<-->`\bf` and
-`\it`<-->`\bi`. This is done by `\em` macro, see opmac-fonts.ofm.
+`\it`<-->`\bi`. This is done by `\em` and `\boldify` macros, see
+section \ref[fonts].
\secc Math Fonts
%---------------
-First usage of `\fontfam` loads UnicodeMath fonts too if the specified font
-family is configured with an UnicodeMath font. If you neeed not this feature
-(because preloaded 8bit math fonts seem to be sufficient for you) then write
-`\noloadmath` before first `\fontfam`.
+Most font families are connected with a preferred unicode-math font. This
+unicode-math is activated when the font family is loaded. If you don't prefer
+this and you are satisfied with 8bit math CM+AMS fonts preloaded in the
+\OpTeX/ format then you can use command `\noloadmath` before you load a first
+font family.
If you want to use your specially selected UnicodeMath font then use
`\loadmath{[<font_file>]}` or `\loadmath{<font_name>}` before first
@@ -288,9 +328,6 @@ If you want to use your specially selected UnicodeMath font then use
\secc Defining a font commands
%-----------------------------
-You can define your own font selectors as a combination of font modifiers
-followed by a font selector or by `\currvar` command.
-
You can declare a "font switch" like `\font` primitive does it,
but you need not to know nothing about names of font files:
@@ -336,39 +373,91 @@ applies variant selector (loads the font now), closes the group but keeps
the selected font and use it. Moreover, such `\selector` is declared as
family-dependent in the same sense as font modifiers.
-You can use `\isfont "<fontname>"\iftrue` or `\isfont "<fontname>"\iffalse`
-to test if the specified font is present in your system.
-
\secc Example of modifying font features
%---------------------------------------
-Each OTF fionts provides "font features". You can list these font features
+Each OTF font provides "font features". You can list these font features
by `otfinfo -f font.otf`. For example LinLibertine fonts provide `frac` font
feature. If it is active then fractions like 1/2 are printed in a special
-fonrm.
+form.
-If you need to activate or deactivate a font feature then you must to
-re-load the font with new collection of features. Actual collection of
-features are stored in `\_fontfeatures` macro. The features are separated by
-semicolon and prefixed by `+` (to activate it) or `-` (to deactivate it).
-If you want to print fractions in LinLibertine create a font modifier using
-`\moddef` of variant selector using `\famvardef`:
+The macro `\setff{<feature>}` acts like family independent font modifier and
+prepares a new <feature>. You must use a variant selector in order to
+reinitialize the font with the new font feature. For example
+`\setff{+frac}\rm` or `\setff{+frac}\currvar`. You can declare a new variant
+selector too:
\begtt
\fontfam[LinLibertine]
- \moddef \fracmod {\addto\_fontfeatures{+frac;}}
- {Compare 1/2 or 1/10 \fracmod\currvar to 1/2 or 1/10.}
- or:
- \famvardef \fraclig {\addto\_fontfeatures{+frac;}\currvar}
- {Compare 1/2 or 1/10 \fraclig to 1/2 or 1/10.}
+ \famvardef \fraclig {\setff{+frac}\currvar}
+ Compare 1/2 or 1/10 \fraclig to 1/2 or 1/10.
\endtt
+If the used font does not supports given font feature then font is realoaded
+without warning nor error. Silently: font feature is not activated.
+
The `onum` font feature (old style digits) is connected to `\caps` macro for
Caps+SmallCaps variant in \OpTeX/ font-definition-files. So you need not to
create a new modifier, just use `{\caps\currvar 012345}`.
+\secc Special font modifiers
+%---------------------------
+
+Despite the font modifiers declared in the font-file (and dependent on
+the font family), we have following font modifiers:
+
+\begtt
+\setfontsize{<sizespec>} % sets the font size
+\setff{<font_feature>} % adds the font feature
+\setfontcolor{<color>} % sets font color
+\setletterspace{<number>} % sets letter spacing
+\setwordspace{<scaling>} % modifies word spacing
+\endtt
+
+The `\setfontsize` command is described in section \ref[fontsize].
+The `\setff` command was described in previous subsection.
+
+`\setfontcolor{<color>}` specifies the color and the opacity of the text.
+The <color> parameter should be in hexadecimal format of four bytes
+`<red><green><blue><opacity>`, for example `FF0080FF` means full red, zero
+green, half blue and full opacity. You can use names `red`, `green`, `blue`,
+`yellow`, `cyan`, `magenta`, `white`, `grey`, `lgrey` instead of the hexadecimal
+specification. The emtpy parameter <color> means default black color.
+
+That colors of fonts are implemented using \LuaTeX/ internal font feature. This
+is different approach than using colors in section \ref[colors].
+
+`\setletterspace{<number>}` specifies letter spacing of the font. The
+<number> is decimal number without unit. The unit is supposed as 1/100 of
+the font size. I.e. `2.5` means 0.25 pt when the font is at 10 pt size. The
+empty parameter <num> means no letter spacing which is default.
+
+`\setwordspace{<scaling>}` scale the default interword space (defined in the
+font) and its stretching and shrinking parameters by given <scaling>
+factor. For example `\setwordspace{2.5}` multiplies interword space by 2.5.
+
+If you need another font transformations, you can use `\setff`
+with following font features provided by Lua\TeX/:
+
+\begtt
+ \setff{embolden=1.5}\rm % font is bolder because outline has nonzero width
+ \setff{slant=0.2}\rm % font is slanted by a linear transformation
+ \setff{extend=1.2}\rm % font is extended by a linear transformation.
+\endtt
+
+Use font transformations mentioned above and `\setletterspace`,
+`\setwordspace` with care. The best setting of these values is default
+setting in every font, of course. If you really needs to set a different
+letter spacing then it is strongly reccomended to add `\setff{-liga}` in
+order to disable ligatures. And setting a positive letter spacing probably
+needs to scale interword spacing too.
+
+All mentioned font modifiers (with the exception of `\setfontsize`) work only
+with Unicode fonts loaded by `\fontfam`.
+
+
\secc Example of usage more vaiants
%----------------------------------
@@ -384,7 +473,7 @@ Then you can define:
Now, you can select between eight variants. But the context between similar
variants like `\bf`--`\bfcond` is lost. Maybe you will find more usefull to
-create only a two cond--nocond swithers which respect the current variant.
+create only a two cond--nocond simple macros which respect the current variant.
And use only four standard variant selectors:
\begtt
@@ -394,6 +483,9 @@ And use only four standard variant selectors:
\it here is italics-condensed \useNormal here is italics-normal.
\endtt
+Another example of decalaration of `\mr` (medium-regular) and `\mi`
+(medium-italics) variant selectors is in the file f-lido.opm.
+
\secc Example of usage more than one family
%------------------------------------------
@@ -405,7 +497,7 @@ Supose we have load Termes and Heros families. Then you can define
\def\useHeros {\Heros\currvar} % switch to Heros with respect curent variant
\endtt
-Or you can declare fonts-like macros:
+Or you can declare font selectors:
\begtt
\fontdef \titlefont {\setfontsize{at14pt}\Heros\bf}
@@ -415,7 +507,7 @@ Or you can declare fonts-like macros:
If you are mixing fonts from various font families then the ex height can
be different and optical unfit. You can compensate exheight of such fonts
-for example by:
+by `mag` keyword in the `\setfontsize` macro. For example by:
\begtt
\Termes
@@ -424,15 +516,15 @@ for example by:
\endtt
-\secc Fontfam processing in detail
-%-----------------------/---------
+\secc \code{\\fontfam} processing in detail
+%------------------------------------------
The `\fontfam` macro lists all declared families if parameter is empty or
`?`. If not, then `\fontfam` transforms the given parameter to lowercase and
without spaces. If exists the file `f-<parameter>.opm` then it is read. If
does not exists such file then `\fontfam` internally lists the families
declared by `\_faminfo` and `\_famalias`, firstly from `fams-ini.opm` file
-and secondly from `fams-user.opm` (if such file exists). The last
+and secondly from `fams-local.opm` (if such file exists). The last
declaration from this internal list (which mathes the given <parameter>)
wins. If the parameter does not match then font-macro-file is not found and
the warning is printed and no new family is loaded.
@@ -441,11 +533,35 @@ When the font-macro-file is found, then `\fontfam` tries an existence of fonts i
system. If they does not exist, a warning on the terminal is printed and no
family is loaded.
-Note, that `fams-user.opm` has higher precedence that internal
+Note, that `fams-local.opm` has higher precedence that internal
`fams-ini.file`. You can declare families with the same name as internal
names and your declaration wins.
+\secc Others
+
+You can use `\isfont {<fontname>}\iftrue` or `\isfont {<fontname>}\iffalse`
+to test if the specified font is present in your system.
+
+The macro `\initunifonts` should be used before usage of first `\font` primitive
+when you need to lodad Unicode fonts directly wihout support of the `\fontfam` or
+`\loadmath` \"high level" macros\fnote
+{The `\initunifonts` macro initializes an extension features of the
+\code{\\font} primitive using Lua code. Without this only 8\,bit fonts can be
+loaded.}.
+
+The `\boldify` macro can be used for titles. It sets `\it` to `\bi` and
+`\rm` to `\bf`. It means that user can write `{\it something}` in the title
+and the result is the same as `{\bi something}`. Math formulae are in bold
+variant too. The `\boldify` macro has local validity like others font
+modifiers. Example:
+
+\begtt
+{\boldify\typosize[14/16] Title in {\it bold}\par}
+\endtt
+
+
+
\secc Implementation notes
%-------------------------
diff --git a/Master/texmf-dist/tex/luatex/optex/hyperlinks.opm b/Master/texmf-dist/tex/luatex/optex/hyperlinks.opm
new file mode 100644
index 00000000000..891ae41f492
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/optex/hyperlinks.opm
@@ -0,0 +1,137 @@
+%% This is part of OpTeX project, see http://petr.olsak.net/optex
+
+\_codedecl \urllink {references <2020-02-22>}
+
+%> \dest
+
+\_def\_destheight{1.4em}
+\_def\_destactive[#1:#2]{\_if$#2$\_else\_ifvmode
+ \_tmpdim=\_prevdepth \_prevdepth=-1000pt
+ \_destbox[#1:#2]\_prevdepth=\_tmpdim
+ \_else \_destbox[#1:#2]%
+ \_fi\_fi
+}
+\_def\_destbox[#1]{\_vbox to0pt{\_kern-\_destheight \_pdfdest name{#1} xyz\_vss}}
+\_def\_dest[#1]{}
+\_public \dest ;
+
+%> \_link, \ilink
+
+\_protected\_def\_linkactive[#1:#2]#3#4{\_leavevmode\_pdfstartlink height.9em depth.3em
+ \_pdfborder{#1} goto name{#1:#2}\_relax {#3#4}\_pdfendlink
+}
+\_protected\_def\_link[#1]#2#3{\_leavevmode{#3}}
+\_protected\_def\_ilink[#1]#2{\_leavevmode{#2}}
+\_public \ilink ;
+
+%> \ulink
+
+\_protected\_def\_urlactive[#1:#2]#3#4{\_leavevmode{\_escapechar=-1
+ \_pdfstartlink height.9em depth.3em \_pdfborder{#1}%
+ user{/Subtype/Link/A <</Type/Action/S/URI/URI(\_detokenize{#2})>>}\relax
+ {#3#4}\pdfendlink}%
+}
+\_def\_ulink[#1]#2{\_leavevmode{#2}}
+\_def\_urlcolor{}
+\_public \ulink ;
+
+%> \_pdfborder
+
+\_def\_pdfborder#1{\_if^#1^\_else \_isdefined{#1border}\_iftrue
+ \_if^\_csname#1border\_endcsname^\_else
+ attr{/C[\_csname#1border\_endcsname] /Border[0 0 .6]}\_fi
+ \_else attr{/Border[0 0 0]}\_fi\_fi
+}
+
+%> \hyperlinks
+
+\_def\_hyperlinks#1#2{%
+ \_let\_dest=\_destactive \_let\_link=\_linkactive
+ \_def\_ilink[##1]##2{\_link[##1]{\_localcolor#1}{##2}}%
+ \_def\_ulink[##1]##2{\_urlactive[url:##1]{\_localcolor#2}{##2}}%
+ \_public \dest \ilink \ulink ;%
+}
+\_public \hyperlinks ;
+
+%> \url
+
+\_def\_url#1{{%
+ \_def\_tmpa{#1}\_replstring\_tmpa {\|}{}%
+ \_def\_tmpb{#1}\_replstring\_tmpb {\|}{\\|}%
+ {\_escapechar=-1 \_ea}\_ea\_edef\_ea\_tmpb\_ea{\detokenize\_ea{\_tmpb}}%
+ \_let\_tmpa=\_tmpb
+ \_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\_urlfont{\_tt}
+\_def\_urlskip{\_null\_nobreak\_hskip0pt plus0.05em\_relax}
+\_def\_urlbskip{\_penalty100 \_hskip0pt plus0.05em\_relax}
+\_def\_urlslashslash{/\_urlskip/}
+
+\_public \url ;
+
+\_endcode % -------------------------------------
+
+\%> \dest
+
+`\dest[<type>:<label>]` creates a destination of internal links. The
+destination is declared by `<type>:<label>`. If `\hyperlinks` are not
+declared, then `\dest` does nothing else it is set to `\_destactive`.
+The `\_destactive` is implemented by `\_pdfdest` primitive. It creates a box
+in which the destination is shifted by `\_destheight`. The reason is that
+the destination is exactly at top border of the PDF viewer but we want to se
+the line where destination is. The destination box is positioned by
+different way dependent on current vertical or horizontal mode.
+
+\%> \_link \ilink
+
+`\_link[<type>:<label>]{<color>}{<text>}` creates an internal link to `\dest`
+with the same `<type>:<label>`. You can have more links with the same
+`<type>:<label>` but only one `\dest` in the document. If `\hyperlinks` are
+not declared, then `\link` only prints <text> else it is set to `\_linkactive`.
+The `\_linktactive` is implemented by `\_pdfstartlink...\_pdfendlink`
+primitives.
+
+`\ilink[<type>:<label>]{<text>}` is equivalent to `\_link` but <color> is
+used from `\hyperlinks` decaration.
+
+\%> \ulink
+
+`\ulink[<url>]{<text>}` creates external link. It only <text> by default but
+the `\hyperlinks` declaration defines it as `\_urlactive[url:<url>]{<text>}`.
+The external link is created by `\_pdfstartlink...\pdfendlink` primitives.
+The <url> is detokenized with `\escapechar=-1` before it is used, so
+`\%`, `\#` etc. can be used in the <url>.
+
+\%> \_pdfborder
+
+The `\_pdfstartink` primitive uses `\_pdfborder{<type>}` in its parameter
+(see `\_linkactive` or `\_urlactive` macros). The `\_pdfbordef{<type>}`
+expands to `attr{/C[? ? ?] /Border[0 0 .6]} if the
+`\<type>border` is defined. User 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).
+
+\%> \hyperlinks
+
+`\hyperlinks{<ilink_color>}{<ulink_color>}` activates `\dest`, `\link`,
+`\ilink`, `\ulink` in order they create links. These macros are redefined
+here to their \"active" version.
+
+\%> \url
+
+`\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 a breakpoints in special places of the
+<url>. For example `//` is replaced by `\_urlskip/\_urlskip/\_urlbskip`
+where `\urlskip` adds a small nobreakable glue between these two slashes and
+before them and `\_urlbskip` adds a breakable glue after them.
+
diff --git a/Master/texmf-dist/tex/luatex/optex/if-macros.opm b/Master/texmf-dist/tex/luatex/optex/if-macros.opm
index 5f3f4d91cf0..ea2f84ee41d 100644
--- a/Master/texmf-dist/tex/luatex/optex/if-macros.opm
+++ b/Master/texmf-dist/tex/luatex/optex/if-macros.opm
@@ -2,7 +2,7 @@
\_codedecl \newif {Special if-macros, is-macros and loops <2020-01-23>}
-% \newif like in plain\TeX/:
+%> \newif
\_def\_newif #1{\_ea\_newifA \_string #1\_relax#1}
\_ea\_def \_ea\_newifA \_string\if #1\_relax#2{%
@@ -17,7 +17,7 @@
\_let#2=\_iffalse
}
-% \loop like in plain\TeX/:
+%> \loop
\_def \_loop #1\_repeat{\_def\_body{#1}\_iterate}
\_def \loop #1\repeat{\_def\_body{#1}\_iterate}
@@ -25,7 +25,14 @@
\_let \repeat=\_fi
\_def \_iterate {\_body \_ea \_iterate \_fi}
-% \isempty{text}\iftrue, \isempty{text}\iffalse:
+%> \isnextchar <char>{exec if true}{exec if false}
+
+\_long\_def\_isnextchar#1#2#3{\_begingroup\_toks0={\_endgroup#2}\_toks1={\_endgroup#3}%
+ \_let\_tmp=#1\_futurelet\_next\_isnextcharA
+}
+\_def\_isnextcharA{\_the\_toks\_ifx\_tmp\_next0\_else1\_fi\_space}
+
+%> \isempty{text}\iftrue, \isempty{text}\iffalse:
\_def \_isempty #1#2{\_ea\_ifx\_ea\_relax\_detokenize{#1}\_relax
\_else \_ea\_unless \_fi #2}
@@ -33,52 +40,46 @@
\_ea\_unless \_fi #2}
\_def \_istoksempty #1{\_ea\_isempty\_ea{\_the#1}}
-% \isinlist\list{text}\iftrue, \isinlist\list{text}\false:
-
-\_long\_def\_isinlist#1#2{\_begingroup
- \_long\_def\_tmp##1#2##2\_end/_{\_endgroup\_isnoempty{##2}}%
- \_ea\_tmp#1\_endlistsep#2\_end/_%
-}
-
-% \isequal{text}{text}\iftrue ...
+%> \isequal{text}{text}\iftrue ...
\_def\_isequal#1#2#3{\_directlua{%
- if "\_luaescapestring{#1}"=="\_luaescapestring{#2}" then else tex.print("\_nbb unless") end}#3}
+ if "\_luaescapestring{\_detokenize{#1}}"=="\_luaescapestring{\_detokenize{#2}}"
+ then else tex.print("\_nbb unless") end}#3}
-% \ismacro\macro{text}\iftrue ...
+%> \ismacro\macro{text}\iftrue ...
\_def\_ismacro#1{\_ea\_isequal\_ea{#1}}
-% \isnextchar <char>{exec if true}{exec if false}
+%> \isdefined{csname}\iftrue
-\_long\_def\_isnextchar#1#2#3{\_begingroup\_toks0={\_endgroup#2}\_toks1={\_endgroup#3}%
- \_let\_tmp=#1\_futurelet\_next\_isnextcharA
+\_def\_isdefined #1#2{\_ifcsname #1\_endcsname \_else \_ea\_unless \_fi #2}
+
+%> \isinlist\list{text}\iftrue ...
+
+\_long\_def\_isinlist#1#2{\_begingroup
+ \_long\_def\_tmp##1#2##2\_end/_{\_endgroup\_isnoempty{##2}}%
+ \_ea\_tmp#1\_endlistsep#2\_end/_%
}
-\_def\_isnextcharA{\_the\_toks\_ifx\_tmp\_next0\_else1\_fi\_space}
-% \isfile{name}\iftrue
+%> \isfile{name}\iftrue ...
\_newread \_testin
\_def\_isfile #1{%
- \_openin\_testin =#1
+ \_openin\_testin ={#1}\_relax
\_ifeof\_testin \_ea\_unless
\_else \_closein\_testin
\_fi
}
-% \removespaces text with spaces {} -> textwithspaces
-
-\_def\_removespaces #1 {\_isempty{#1}\_iffalse #1\_ea\_removespaces\_fi}
-
-
\_public
- \newif \isempty \istoksempty \isinlist \isnextchar
- \isfile \ismacro \isequal \removespaces ;
+ \newif \isnextchar \isempty \isequal \ismacro \isdefined \isinlist \isfile ;
\_endcode %---------------------------------------------------------
-The `\newif` macro works like in plain\TeX. It means that
+\%> \newif
+
+The `\newif` macro works like in plain \TeX. It means that
after `\newif\ifxxx` you can use `\xxxtrue` or
`\xxxfalse` to set the boolean value and use `\ifxxx true\else false\fi`
to test this value. The defalut value is false.
@@ -86,21 +87,60 @@ to test this value. The defalut value is false.
The macro `\_newifi` enables to declare `\_ifxxx` and to use `\_xxxtrue` and
`\_xxxfalse`. This means that it is usable for _prefixed macros.
+\%> \loop
+
The `\loop <codeA> \ifsomething <codeB> \repeat` loops `<codeA> <codeB>`
until `\ifsomething` is false. Then `<codeB>` is not executed and loop is
-finished. This works like in plain\TeX.
+finished. This works like in plain \TeX, but implementation is soewhat
+better (you can use `\else` clause after the `\ifsomething`).
-The macro `\isempty{<text>}\iftrue <codeA>\else <codeB>\fi` executes <codeA>
-if <text> is empty and <codeB> if it is nonempty. You can use
-`\isempty{<text>}\iffalse <codeB>\else <codeA>\fi` too. This macro is
-expandable.
+There are public version `\loop...\repeat` and private version
+`\_loop...\_repeat`. You canot mix both versions in one loop.
-The macro `\isinlist\list{<text>}\iftrue` acts like `\iftrue` if the
-`<text>` is included the macro body of `\list`. Else it acts like
-`\ifflase`. You can write `\isinlist\list{<text>}\iffalse` to reverse the
-boolean value of this condition. THe macro is not expandable.
+\%> \isnextchar
The macro `\isnextchar <char>{<codeA>}{<codeB>}` executes `<codeA>` if next
character is equal to <char>. Else the `<codeB>` is executed. The macro is
not expandable.
+\%> \isempty
+
+The macro `\isempty{<text>}\iftrue <codeA>\else <codeB>\fi` executes <codeA>
+if <text> is empty and <codeB> if it is non-empty. You can use
+`\isempty{<text>}\iffalse <codeB>\else <codeA>\fi` too. This macro is
+expandable.
+
+There are a collection of macros with commnon syntax:
+`\issomething<params>\iftrue` or `\issomething<params>\iffalse`.
+The `\iftrue` or `\iffalse` is a part of this syntax because we need to keep
+skippable nested `\if` conditions.
+
+We read this `\iftrue` or `\iffalse` into unseparated parameter and repeat
+it because we need to remove an optional space before this command.
+
+\%> \isequal
+
+`\isequal{<textA>}{<textB>}\iftrue` is true if the <textA> and <textB> are
+equal, only from strings point of view, category codes are ignored.
+The macro is expandable.
+
+\%> \ismacro
+
+`\ismacro\macro{text}\iftrue` is true if macro is defined as {<text>}.
+Category codes are ignored in this testing. The macro is expandable.
+
+\%> \isdefined
+
+`\isdefined{<csname>}\iftrue` is true if `\<csname>` is defined.
+
+\%> \isinlist
+
+`\isinlist\list{<text>}\iftrue` is true if the
+`<text>` is included the macro body of the `\list`.
+The catogory code are relevant here. THe macro is not expandable.
+
+\%> \isfile
+
+`\isfile{<filename>}\iftrue` is true if the file <filename> exists and are
+readable by \TeX.
+
diff --git a/Master/texmf-dist/tex/luatex/optex/luatex-ini.opm b/Master/texmf-dist/tex/luatex/optex/luatex-ini.opm
index d84e0da8b1a..872d808ee99 100644
--- a/Master/texmf-dist/tex/luatex/optex/luatex-ini.opm
+++ b/Master/texmf-dist/tex/luatex/optex/luatex-ini.opm
@@ -133,6 +133,4 @@
\_endcode
-Non-TeX82 primitives are initialized here in non-prefix and _prefixed form.
-Macros for emulation of pdfTeX primitives are set here too.
-
+Common pdf\TeX/ primitives equivalnets are declared here. Initial values is set.
diff --git a/Master/texmf-dist/tex/luatex/optex/maketoc.opm b/Master/texmf-dist/tex/luatex/optex/maketoc.opm
new file mode 100644
index 00000000000..05df7d0d647
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/optex/maketoc.opm
@@ -0,0 +1,92 @@
+%% This is part of OpTeX project, see http://petr.olsak.net/optex
+
+\_codedecl \maketoc {maketoc <2020-02-14>}
+
+\_def\_toclist{}
+\_newifi \_ifischap \_ischapfalse
+
+\def\_Xtoc#1#2#3#4{\_ifnum#1=0 \_ischaptrue\_fi
+ \_addto\_toclist{\_tocline{#1}{#2}{#3}{#4}}
+ \_ea\_addto\_ea\_toclist\_ea{\_currpage}%
+}
+\def\_tocline#1#2#3#4#5#6{\_bgroup
+ \_leftskip=\_iindent \_rightskip=2\_iindent
+ \_ifischap \_advance\_leftskip by \_iindent \_fi
+ \_def\_pg{\_ilink[pg:#5]}%
+ \_pretocline \_the\_tochook
+ \_ifcsname _tocl:#1\_endcsname
+ \_cs{_tocl:#1}{#3}{#4}{#6}\_nobreak \_hskip-2\_iindent\_null \_par
+ \_fi
+ \_egroup
+ \_advance\_tocrefnum by1
+}
+\_sdef{_tocl:1}#1#2#3{\_nofirst\_bigskip \_bf\_llaptoclink{#1}{#2}\_hfill \_pg{#3}}
+\_sdef{_tocl:2}#1#2#3{\_llaptoclink{#1}{#2}\_tocdotfill \_pg{#3}}
+\_sdef{_tocl:3}#1#2#3{\_advance\_leftskip by\_iindent \_cs{_tocl:2}{#1}{#2}{#3}}
+
+\_def\_llaptoclink#1{\_noindent \_llap{\_ilink[toc:\_the\_tocrefnum]{#1\enspace}}}
+\_def\_tocdotfill{\_leaders\_hbox to.8em{\_hss.\_hss}\_hskip 1em plus1fill\_relax}
+\_def\_nofirst #1{\_ifnum \_lastpenalty=11333 \_else #1\_fi}
+
+\_def\_pretocline{}
+
+\_def\_maketoc{\_par \_ifx\_toclist\_empty
+ \_opwarning{\_noexpand\maketoc -- data unavailable, TeX me again}\_openref
+ \_else \_begingroup \_tocrefnum=0 \_penalty11333 \_toclist \_endgroup \_fi}
+
+\_newtoks \_tochook
+
+\_public \maketoc \tochook ;
+
+\_endcode % -------------------------------------
+
+`\_Xtoc{<level>}{<type>}{<number>}{<text>}` reads the specified
+data from REF file and saves it to `\_toclist` as
+
+\begtt
+\_tocline{<level>}{<type>}{<number>}{<text>}{<gpageno>}{<pageno>}
+where:
+<level>: 0 reserved, 1: chapter, 2: section, 3: subsection
+<type>: the type of the level, i.e. chap, sec, secc (unused)
+<number>: the number of the chapret/section/subsection in the format 1.2.3
+<text>: the title text
+<gpageno>: the page number numbered from 1 independently of pagination
+<pageno>: the page number used in the pagination
+\endtt
+
+The last two parameters are restored from previous
+`\_Xpage{<pageno>}{<gpageno>}`, data are saved in the `\_currpage` macro.
+
+`\_tocline{<level>}{<type>}{<number>}{<text>}{<gpageno>}{<pageno>}` prints
+the record to the table of contents. It opens group, reduces `\_leftskip`,
+`\_rightskip`, runs the `\tochook` (user can customise the design o TOC
+here) and runs `\_tocl:<level> {<number>}{<text>}{<page>}` macro.
+This macro starts with vertical mode,
+inserts one record with given <level> and ends in horizontal mode. Then
+`\_tocline` appends `\_nobreak \_hskip-2\_iindent\_null \_par`. This causes
+that the last line of the record is shifted outside the margin given by
+`\_rightskip`. A typical record (with long <text>) looks like:
+
+\begtt
+ | |
+\llap{<number>} text text text text text
+ text text text text text
+ text text .................... <pageno>
+\endtt
+
+Margins given by `\leftskip` and `\rightskip` are denoted by `|` in the
+examle above.
+
+You can re-define default macros for each level if you want.
+
+`\_llaptoclink<text>` does `\_noindent\_llap{<linked text>}`.
+
+`\_tocdotfill` creates dots in the TOC.
+
+`\_nofirst\macro` applies the `\macro` only if we don't print the first
+record of the TOC.
+
+`\_pg{<pageno>}` creates <pageno> as link to real <gpage> saved in `#6`.
+
+`\maketoc` prints warning if TOC data is empty, lse it creates TOC by
+running `\_toclist`
diff --git a/Master/texmf-dist/tex/luatex/optex/math-macros.opm b/Master/texmf-dist/tex/luatex/optex/math-macros.opm
index 27bea8dcc41..ea33dc396e5 100644
--- a/Master/texmf-dist/tex/luatex/optex/math-macros.opm
+++ b/Master/texmf-dist/tex/luatex/optex/math-macros.opm
@@ -375,45 +375,46 @@
\_mathchardef\_colon="603A % colon as a punctuation mark
\_public \ldotp \cdotp \colon ;
-\_newdimen \_pt
-\_def\_setpt{\_pt=.1\_fontdimen6\_textfont1 }
\_protected\_def\_ldots{\_mathinner{\_ldotp\_ldotp\_ldotp}}
\_protected\_def\_cdots{\_mathinner{\_cdotp\_cdotp\_cdotp}}
-\_protected\_def\_vdots{\_setpt \_vbox{\_baselineskip=4\_pt \_lineskiplimit=0pt
- \_kern6\_pt \_hbox{.}\_hbox{.}\_hbox{.}}}
-\_protected\_def\_ddots{\_mathinner{\_setpt
- \_mkern1mu\_raise7\_pt\_vbox{\_kern7\_pt\_hbox{.}}\_mkern2mu
- \_raise4\_pt\_hbox{.}\_mkern2mu\_raise1\_pt\_hbox{.}\_mkern1mu}}
+\_protected\_def\_vdots{\_vbox{\_baselineskip=.4em \_lineskiplimit=0pt
+ \_kern.6em \_hbox{.}\_hbox{.}\_hbox{.}}}
+\_protected\_def\_ddots{\_mathinner{%
+ \_mkern1mu\_raise.7em\_vbox{\_kern.7em\_hbox{.}}\_mkern2mu
+ \_raise.4em\_hbox{.}\_mkern2mu\_raise.1em\_hbox{.}\_mkern1mu}}
+
\_public \ldots \cdots \vdots \ddots ;
-\_protected\_def\_acute{\_mathaccent"7013 }
-\_protected\_def\_grave{\_mathaccent"7012 }
-\_protected\_def\_ddot{\_mathaccent"707F }
-\_protected\_def\_tilde{\_mathaccent"707E }
-\_protected\_def\_bar{\_mathaccent"7016 }
-\_protected\_def\_breve{\_mathaccent"7015 }
-\_protected\_def\_check{\_mathaccent"7014 }
-\_protected\_def\_hat{\_mathaccent"705E }
-\_protected\_def\_vec{\_mathaccent"017E }
-\_protected\_def\_dot{\_mathaccent"705F }
-\_protected\_def\_widetilde{\_mathaccent"0365 }
-\_protected\_def\_widehat{\_mathaccent"0362 }
+\_protected\_def\acute{\_mathaccent"7013 }
+\_protected\_def\grave{\_mathaccent"7012 }
+\_protected\_def\ddot{\_mathaccent"707F }
+\_protected\_def\tilde{\_mathaccent"707E }
+\_protected\_def\bar{\_mathaccent"7016 }
+\_protected\_def\breve{\_mathaccent"7015 }
+\_protected\_def\check{\_mathaccent"7014 }
+\_protected\_def\hat{\_mathaccent"705E }
+\_protected\_def\vec{\_mathaccent"017E }
+\_protected\_def\dot{\_mathaccent"705F }
+\_protected\_def\widetilde{\_mathaccent"0365 }
+\_protected\_def\widehat{\_mathaccent"0362 }
\_def\_math{\_mathsurround0pt }
-\_protected\_def\_overrightarrow #1{\_vbox{\_setpt\_math\_ialign{##\_crcr
- \_rightarrowfill\_crcr\_noalign{\_kern-\_pt\_nointerlineskip}
+\_protected\_def\_overrightarrow #1{\_vbox{\_math\_ialign{##\_crcr
+ \_rightarrowfill\_crcr\_noalign{\_kern-.1em \_nointerlineskip}
$\_hfil\_displaystyle{#1}\_hfil$\_crcr}}}
-\_protected\_def\_overleftarrow #1{\_vbox{\_setpt\_math\_ialign{##\_crcr
- \_leftarrowfill\_crcr\_noalign{\_kern-\_pt\_nointerlineskip}
+\_protected\_def\_overleftarrow #1{\_vbox{\_math\_ialign{##\_crcr
+ \_leftarrowfill\_crcr\_noalign{\_kern-.1em \_nointerlineskip}
$\_hfil\_displaystyle{#1}\_hfil$\_crcr}}}
-\_protected\_def\_overbrace #1{\_mathop{\_vbox{\_setpt\_math\_ialign{##\_crcr\_noalign{\_kern3\_pt}
- \_downbracefill\_crcr\_noalign{\_kern3\_pt\_nointerlineskip}
+\_protected\_def\_overbrace #1{\_mathop{%
+ \_vbox{\_math\_ialign{##\_crcr\_noalign{\_kern.3em}
+ \_downbracefill\_crcr\_noalign{\_kern.3em \_nointerlineskip}
$\_hfil\_displaystyle{#1}\_hfil$\_crcr}}}\_limits}
-\_protected\_def\_underbrace #1{\_mathop{\_vtop{\_setpt\_math\_ialign{##\_crcr
- $\_hfil\_displaystyle{#1}\_hfil$\_crcr\_noalign{\_kern3\_pt\_nointerlineskip}
- \_upbracefill\_crcr\_noalign{\_kern3\_pt}}}}\_limits}
+\_protected\_def\_underbrace #1{\_mathop{\_vtop{\_math\_ialign{##\_crcr
+ $\_hfil\_displaystyle{#1}\_hfil$\_crcr\_noalign{\_kern.3em \_nointerlineskip}
+ \_upbracefill\_crcr\_noalign{\_kern.3em}}}}\_limits}
\_protected\_def\_skew #1#2#3{{\_muskip0=#1mu\_divide\_muskip0=by2 \_mkern\_muskip0
#2{\_mkern-\_muskip0{#3}\_mkern\_muskip0}\_mkern-\_muskip0}{}}
+
\_public \overrightarrow \overleftarrow \overbrace \underbrace \skew ;
\_protected\_def\lmoustache{\_delimiter"437A340 } % top from (, bottom from )
@@ -476,12 +477,12 @@
\_public \mathpalette \vphantom \hphantom \phantom \mathstrut \smash ;
\_protected\_def\_cong{\_mathrel{\_mathpalette\_overeq\_sim}} % congruence sign
-\_def\_overeq#1#2{\_setpt\_lower.5\_pt\_vbox{\_lineskiplimit\_maxdimen\_lineskip=-.5\_pt
+\_def\_overeq#1#2{\_lower.05em\_vbox{\_lineskiplimit\_maxdimen\_lineskip=-.05em
\_ialign{$\_math#1\_hfil##\_hfil$\_crcr#2\_crcr=\_crcr}}}
\_protected\_def\_notin{\_mathrel{\_mathpalette\_cancel\_in}}
\_def\_cancel#1#2{\_math\_ooalign{$\_hfil#1\_mkern1mu/\_hfil$\_crcr$#1#2$}}
\_protected\_def\_rightleftharpoons{\_mathrel{\_mathpalette\_rlhp{}}}
-\_def\_rlhp#1{\_vcenter{\_setpt\_math\_hbox{\_ooalign{\_raise2\_pt
+\_def\_rlhp#1{\_vcenter{\_math\_hbox{\_ooalign{\_raise.2em
\_hbox{$#1\_rightharpoonup$}\_crcr
$#1\_leftharpoondown$}}}}
\_protected\_def\_buildrel#1\over#2{\_mathrel{\_mathop{\_kern0pt #2}\_limits^{#1}}}
@@ -502,17 +503,16 @@
\_protected\_def\_pmatrix#1{\_left(\_matrix{#1}\_right)}
\_newdimen\_ptrenwd
\_ptrenwd=0.875\fontdimen6\textfont1 % width of the big left (
-\_protected\_def\_bordermatrix#1{\_begingroup \_math\_setpt
- \_setbox0=\_vbox{\_setpt
- \_def\_cr{\_crcr\_noalign{\_kern2\_pt\_global\_let\_cr\_endline}}%
- \_ialign{$##$\_hfil\_kern2\_pt\_kern\_ptrenwd&\_thinspace\_hfil$##$\_hfil
+\_protected\_def\_bordermatrix#1{\_begingroup \_math
+ \_setbox0=\_vbox{\_def\_cr{\_crcr\_noalign{\_kern.2em\_global\_let\_cr\_endline}}%
+ \_ialign{$##$\_hfil\_kern.2em\_kern\_ptrenwd&\_thinspace\_hfil$##$\_hfil
&&\_quad\_hfil$##$\_hfil\_crcr
\_omit\_strut\_hfil\_crcr\_noalign{\_kern-\_baselineskip}%
#1\_crcr\_omit\_strut\_cr}}%
\_setbox2=\_vbox{\_unvcopy0 \_global\_setbox1=\_lastbox}%
\_setbox2=\_hbox{\_unhbox1 \_unskip\_global\_setbox1=\_lastbox}%
\_setbox2=\_hbox{$\_kern\_wd1 \_kern-\_ptrenwd\_left(\_kern-\_wd1
- \_global\_setbox1=\_vbox{\_box1 \_kern2\_pt}%
+ \_global\_setbox1=\_vbox{\_box1 \_kern.2em}%
\_vcenter{\_kern-\_ht1 \_unvbox0 \_kern-\_baselineskip}\_thinsk\_right)$}%
\_null\_thicksk\_vbox{\_kern\_ht1 \_box2}\_endgroup}
\_public \cases \matrix \pmatrix \bordermatrix ;
@@ -797,8 +797,8 @@
\_ifx #1<\_nless \_else
\_ifx #1>\_ngtr \_else
\_edef\_tmpn{\_csstring#1}%
- \_ifcsname _not\tmpn\_endcsname \_csname _not\tmpn\_endcsname
- \_else \_ifcsname _n\tmpn\_endcsname \_csname _n\tmpn\_endcsname
+ \_ifcsname _not\_tmpn\_endcsname \_csname _not\_tmpn\_endcsname
+ \_else \_ifcsname _n\_tmpn\_endcsname \_csname _n\_tmpn\_endcsname
\_else \_mathrel{\_mathord{\_notchar}\_mathord{#1}}%
\_fi \_fi \_fi \_fi}
\_private
@@ -857,9 +857,7 @@ plain\TeX/, but they are `\protected`.
These macros are defined similarly as in plain\TeX. Only internal macro
names from plain\TeX/ with `@` character are we-written in more readable
-form. The macro `\_setpt` is introduced. This sets `\_pt` dimen to 1 pt if
-10 point font is used. In another cases the appropriate scaling is applied.
-
+form.
\secc Matchchardefs from AMS fonts
%---------------------------------
diff --git a/Master/texmf-dist/tex/luatex/optex/math-preload.opm b/Master/texmf-dist/tex/luatex/optex/math-preload.opm
index a2a5669831e..8ced2c1cc07 100644
--- a/Master/texmf-dist/tex/luatex/optex/math-preload.opm
+++ b/Master/texmf-dist/tex/luatex/optex/math-preload.opm
@@ -135,8 +135,9 @@
\_suppressfontnotfounderror=0
\_public
- \normalmath \boldmath \setmathsizes
- \bf \it \bi \tt \mit \cal \bbchar \frak \script \ptunit ;
+ \setmathsizes \bf \it \bi \tt \mit \cal \bbchar \frak \script \ptunit ;
+
+\_def \normalmath {\_normalmath} \_def\boldmath {\_boldmath}
\_endcode %---------------------------------------------------
diff --git a/Master/texmf-dist/tex/luatex/optex/math-unicode.opm b/Master/texmf-dist/tex/luatex/optex/math-unicode.opm
index 9b4cf60acbc..cf800ca5408 100644
--- a/Master/texmf-dist/tex/luatex/optex/math-unicode.opm
+++ b/Master/texmf-dist/tex/luatex/optex/math-unicode.opm
@@ -10,22 +10,15 @@
\_def\_loadmath#1{%
\_ifmathloading
\_initunifonts
- \_isfont"#1"\_iffalse
+ \_isfont{#1}\_iffalse
\_opwarning{Math font "#1" not found, skipped...}%
\_else
\_def\_unimathfont{#1}%
- \_def\_normalmath{%
- \_loadumathfamily 1 {\_unimathfont}{} % Base font
- \_loadmathfamily 4 rsfs % script
- \_setmathdimens
- }%
- \_let\_boldmath=\_normalmath
- \_addto\_boldmath{\_pdfliteral direct {2 Tr .3 w}\_aftergroup\_noboldmath}%
- \_def\_noboldmath{\_pdfliteral direct {0 Tr 0 w}}% faked bold only :-(
- \_normalmath
- \_wterm {MATH-FONT: "#1" -- unicode math prepared.}%
- \_setctable\_optexcatcodes \_input unimath-codes.opm \_restorectable
- \_mathloadingfalse
+ \_let\_normalmath = \_normalunimath \_let\_boldmath = \_boldunimath
+ \_normalmath
+ \_wterm {MATH-FONT: "#1" -- unicode math prepared.}%
+ \_setctable\_optexcatcodes \_input unimath-codes.opm \_restorectable
+ \_mathloadingfalse
\_fi\_fi}
\_def\_loadboldmath#1#2\to #3{%
@@ -34,14 +27,25 @@
\_opwarning{Bold-Math font "#1" not found, skipped...}
\_else
\_def\_unimathboldfont{#1}%
- \_def\_boldmath{%
- \_loadumathfamily 1 {\_unimathboldfont}{} % Base font
- \_loadmathfamily 4 rsfs % script
- \_setmathdimens
- }%
\_wterm {MATH-FONT: "#1" -- unicode math bold prepared.}%
\_fi\_fi}
+\_def\_normalunimath{%
+ \_loadumathfamily 1 {\_unimathfont}{} % Base font
+ \_loadmathfamily 4 rsfs % script
+ \_setmathdimens
+}%
+\_def\_boldunimath{%
+ \_ifx\_unimathboldfont \_undefined
+ \_loadumathfamily 1 {\_unimathfont}{embolden=1.7;} % Base faked bold
+ \_else
+ \_loadumathfamily 1 {\_unimathboldfont}{} % Base real bold font
+ \_fi
+ \_loadmathfamily 4 rsfs % script
+ \_setmathdimens
+}%
+
+
\_def\_umathname#1#2{"#1:\_mfontfeatures#2"}
\_def\_mfontfeatures{mode=base;script=math;}
@@ -56,13 +60,13 @@
\_optsize=\_optsizesave \_relax
}
-\_newcount\umathnumA \_newcount\umathnumB
+\_newcount\_umathnumA \_newcount\_umathnumB
-\def\umathcorr#1#2{\expandafter#1\expandafter{\the#2}}
-\def\umathprepare#1{\def\umathscanholes##1[#1]##2##3\relax{##2}}
-\def\umathvalue#1{\expandafter\umathscanholes\umathcharholes[#1]{#1}\relax}
+\_def\_umathcorr#1#2{\_ea#1\_ea{\_the#2}}
+\_def\_umathprepare#1{\_def\_umathscanholes##1[#1]##2##3\_relax{##2}}
+\_def\_umathvalue#1{\_ea\_umathscanholes\_umathcharholes[#1]{#1}\_relax}
-\def\umathcharholes{% holes in math alphabets:
+\_def\_umathcharholes{% holes in math alphabets:
[119893]{"210E}[119965]{"212C}[119968]{"2130}[119969]{"2131}%
[119971]{"210B}[119972]{"2110}[119975]{"2112}[119976]{"2133}[119981]{"211B}%
[119994]{"212F}[119996]{"210A}[120004]{"2134}%
@@ -70,25 +74,25 @@
[120122]{"2102}[120127]{"210D}[120133]{"2115}[120135]{"2119}
[120136]{"211A}[120137]{"211D}[120145]{"2124}%
}
-\def\umathrange#1#2{\umathnumB=#2\relax \umathrangeA#1}
-\def\umathrangeA#1-#2{\umathnumA=`#1\relax
- \loop
- \umathcorr\umathprepare\umathnumB
- \Umathcode \umathnumA = 7 1 \umathcorr\umathvalue{\umathnumB}
- \ifnum\umathnumA<`#2\relax
- \advance\umathnumA by1 \advance\umathnumB by1
- \repeat
+\_def\_umathrange#1#2{\_umathnumB=#2\_relax \_umathrangeA#1}
+\_def\_umathrangeA#1-#2{\_umathnumA=`#1\_relax
+ \_loop
+ \_umathcorr\_umathprepare\_umathnumB
+ \_Umathcode \_umathnumA = 7 1 \_umathcorr\_umathvalue{\_umathnumB}
+ \_ifnum\_umathnumA<`#2\_relax
+ \_advance\_umathnumA by1 \_advance\_umathnumB by1
+ \_repeat
}
-\def\umathrangeGREEK{\begingroup
- \lccode`A="0391 \lccode`Z="03A9
- \lowercase{\endgroup\umathrange{A-Z}}}
-\def\umathrangegreek{\begingroup
- \lccode`A="03B1 \lccode`Z="03D6
- \lowercase{\endgroup\umathrange{A-Z}}}
-\def\greekdef#1{\ifx#1\relax \else
- \begingroup \lccode`X=\umathnumB \lowercase{\endgroup \def#1{X}}%
- \advance\umathnumB by 1
- \expandafter\greekdef \fi
+\_def\_umathrangeGREEK{\_begingroup
+ \_lccode`A="0391 \_lccode`Z="03A9
+ \_lowercase{\_endgroup \_umathrange{A-Z}}}
+\_def\_umathrangegreek{\_begingroup
+ \_lccode`A="03B1 \_lccode`Z="03D6
+ \_lowercase{\_endgroup \_umathrange{A-Z}}}
+\_def\_greekdef#1{\_ifx#1\_relax \_else
+ \_begingroup \_lccode`X=\_umathnumB \_lowercase{\_endgroup \_def#1{X}}%
+ \_advance\_umathnumB by 1
+ \_expandafter\_greekdef \_fi
}
\_public
@@ -120,27 +124,6 @@ accepts only codes less than 255.
See http://tex.stackexchange.com/questions/308749/ for more technical details.
-The poor bold is used for complete bold vaiant of the font. If the selected
-font has its bold vaiant (like xits-math), you can re-define \boldmath macro
-by:
-
-\def\boldmath{%
- \loadumathfamily 1 {[xitsmath-bold]}{} % Base font
- \loadmathfamily 4 rsfs % script
- \setmathdimens
-}
-
-XITSmath-bold needs correction: the norm symbol ||x|| is missing here. So, you
-can define:
-
-\def\boldmath{%
- \loadumathfamily 1 {[xitsmath-bold]}{} % Base font
- \loadmathfamily 4 rsfs % script
- \loadumathfamily 5 {[xitsmath-regular]}{}
- \def\|{\Udelimiter 0 5 "02016 }% % norm delimiter from family 5
- \setmathdimens
-}
-
--------------------
\loadmath{[XITSMath-Regular]} ... XITS MATH^^J
diff --git a/Master/texmf-dist/tex/luatex/optex/op-macros.opm b/Master/texmf-dist/tex/luatex/optex/op-macros.opm
index 659abfe8750..00c8f587052 100644
--- a/Master/texmf-dist/tex/luatex/optex/op-macros.opm
+++ b/Master/texmf-dist/tex/luatex/optex/op-macros.opm
@@ -44,7 +44,6 @@
\_newtoks\_opt
-
% \eoldef \foo #1{thex to end of line is: #1}
\_def\_eoldef #1{\_def #1{\_begingroup \_catcode`\^^M=12 \_eoldefA #1}%
@@ -84,11 +83,23 @@
\_def\_enquotes{\_chardef\"="201C } % use \"text" for English quotes
+%> \removespaces text with spaces {} -> textwithspaces
+
+\_def\_removespaces #1 {\_isempty{#1}\_iffalse #1\_ea\_removespaces\_fi}
+
+%> \trycs{<csname>}{<text>}
+
+\_def \_trycs#1#2{\_ifcsname #1\_endcsname \_csname #1\_endcsname \_else #2\_fi}
+
\public
\setctable \restorectable
\normalcatodes \opt \optdef \eoldef \replstring
- \keepinputnames \lastinputname \enquotes ;
+ \keepinputnames \lastinputname \enquotes \removespaces \trycs ;
\_endcode % -------------------------------------
+
+\%> \trycs
+
+`\trycs{<csname>}{<text>} expands to \<csname> if it is defined else to <text>.
diff --git a/Master/texmf-dist/tex/luatex/optex/opmac-rest.opm b/Master/texmf-dist/tex/luatex/optex/opmac-rest.opm
index 4f9dbd1aaf0..4353f891e2c 100644
--- a/Master/texmf-dist/tex/luatex/optex/opmac-rest.opm
+++ b/Master/texmf-dist/tex/luatex/optex/opmac-rest.opm
@@ -10,15 +10,13 @@
\ifx\OPmacversion\undefined \else \endinput \fi
\def\OPmacversion{Jul. 2019}
-\immediate\write16{This is OPmac (Olsak's Plain macros), version <\OPmacversion>}
+\immediate\write16{This is OPmac-rest, version <\OPmacversion>}
%%%%%%%%%%%%%% Basic macros, sec. 3.1 in opmac-d.pdf
\newcount\tmpnum % auxiliary count
\newdimen\tmpdim % auxiliary dimen
-\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
-
\def\protectlist{}
\def\addprotect#1{\addto\protectlist{\doprotect#1}}
\addprotect~
@@ -27,41 +25,14 @@
\let\pdfoutput=\outputmode \def\pdfcolorstackinit{\pdffeedback colorstackinit}\fi
\newif\ifpdftex \pdftextrue
-\ifx\pdfoutput\undefined \pdftexfalse \else \ifnum\pdfoutput=0 \pdftexfalse \fi \fi
-\ifx\XeTeXversion\undefined \else \pdftextrue \fi
-
-\def\sdef#1{\expandafter\def\csname#1\endcsname}
-\def\sxdef#1{\expandafter\xdef\csname#1\endcsname}
-\def\slet#1#2{\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname}
-
-\def\adef#1{\catcode`#1=13 \begingroup \lccode`\~=`#1\lowercase{\endgroup\def~}}
-
-\def\isdefined #1#2{\expandafter\ifx \csname#1\endcsname \relax
- \csname iffalse\expandafter\endcsname
- \else
- \csname iftrue\expandafter\endcsname
- \fi
-}
-\long\def\isinlist#1#2#3{\begingroup \long\def\tmp##1#2##2\end{\def\tmp{##2}%
- \ifx\tmp\empty \endgroup \csname iffalse\expandafter\endcsname \else
- \endgroup \csname iftrue\expandafter\endcsname \fi}% end of \def\tmp
- \expandafter\tmp#1\endlistsep#2\end
-}
-\long\def\isnextchar#1#2#3{\begingroup\toks0={\endgroup#2}\toks1={\endgroup#3}%
- \let\tmp=#1\futurelet\next\isnextcharA
-}
-\def\isnextcharA{\the\toks\ifx\tmp\next0\else1\fi\space}
\def\maybebreak{\afterassignment\maybebreakA\tmpdim=}
\def\maybebreakA{\ifvmode \vskip0pt plus\tmpdim \penalty-130 \vskip0pt plus-\tmpdim
\else \hskip0pt plus\tmpdim \penalty-130 \hskip0pt plus-\tmpdim \fi \relax
}
-%\long\def\uv#1{\clqq#1\crqq}
\let\\=\undefined
-{\lccode`\?=`\% \lowercase{\gdef\percent{?}}}
-{\lccode`\?=`\\ \lowercase{\gdef\bslash{?}}}
\def\,{\relax\ifmmode \mskip\thinmuskip \else \thinspace \fi}
-\addprotect\percent \addprotect\bslash \addprotect\, \addprotect\exfont
+\addprotect\, \addprotect\exfont
\bgroup \catcode`!=3 \catcode`?=3
\gdef\replacestrings#1#2{\long\def\replacestringsA##1#1{\def\tmpb{##1}\replacestringsB}%
@@ -79,8 +50,9 @@
\showboxdepth=7
\showboxbreadth=30
-\newdimen\iindent \iindent=\parindent
+\newdimen\_iindent \_iindent=\parindent
% indentation of items, TOC, captions, list of bib. references
+\_public \iindent ;
\def\iiskip{\medskip} % space above and below \begitems...\enditems
\def\itemhook{} % hook in \startitem
@@ -120,10 +92,8 @@
%%%%%%%%%%%%%% Multilingual support, sec. 3.5 in opmac-d.pdf
-\def\mtext#1{\_ifcsname _mt:#1:\csname _lan:\_the\_language\_endcsname\_endcsname
- \_csname _mt:#1:\_csname _lan:\_the\_language\_endcsname\_endcsname
- \_else \_csname _mt:#1:en\_endcsname \_fi
-}
+\def\mtext#1{\_csname _mt:#1:\_trycs{_lan:\_the\_language}{en}\_endcsname}
+
\sdef{_mt:chap:en}{Chapter} \sdef{_mt:chap:cs}{Kapitola} \sdef{_mt:chap:sk}{Kapitola}
\sdef{_mt:t:en}{Table} \sdef{_mt:t:cs}{Tabulka} \sdef{_mt:t:sk}{Tabuľka}
\sdef{_mt:f:en}{Figure} \sdef{_mt:f:cs}{Obrázek} \sdef{_mt:f:sk}{Obrázok}
@@ -131,59 +101,9 @@
%%%%%%%%%%%%%% REF file, sec 3.6 in opmac-d.pdf
-\newwrite\reffile
-\newread\testin
-
-\def\wrefrelax#1#2{}
-\let\wref=\wrefrelax
-
-\def\inputref{
- \openin\testin=\jobname.ref
- \ifeof\testin \else
- \closein\testin
- \input \jobname.ref
- \fnotenum=0 \mnotenum=0
- \openrefA{\string\inputref}%
- \fi
-}
-\def\openref{%
- \ifx\wref\wrefrelax \openrefA{\string\openref}\fi
- \gdef\openref{}%
-}
-\def\openrefA#1{%
- \immediate\openout\reffile=\jobname.ref
- \gdef\wref##1##2{\write\reffile{\string##1##2}}%
- \immediate\write\reffile {\percent\percent\space OPmac - REF file (#1)}%
- \immediate\wref\Xrefversion{{\REFversion}}%
-}
-\def\REFversion{2}
-\def\Xrefversion#1{\ifnum#1=\REFversion\relax \else \endinput \fi}
%%%%%%%%%%%%%% \label, \ref, \pgref, sec. 3.7 in opmac-d.pdf
-\def\label[#1]{\isdefined{l0:#1}%
- \iftrue \opwarning{duplicated label [#1], ignored}\else \xdef\lastlabel{#1}\fi
- \ignorespaces}
-
-\def\wlabel#1{%
- \ifx\lastlabel\undefined \else
- \dest[ref:\lastlabel]%
- {\protectlist\edef\tmp{\wref\Xlabel{{\lastlabel}{#1}}}\expandafter}\tmp
- \sxdef{lab:\lastlabel}{#1}\sxdef{l0:\lastlabel}{}%
- \global\let\lastlabel=\undefined
- \fi
-}
-\def\ref[#1]{\isdefined{lab:#1}%
- \iftrue \reflink[#1]{\csname lab:#1\endcsname}%
- \else ??\opwarning{label [#1] unknown. Try to TeX me again}\openref
- \fi
-}
-\def\pgref[#1]{\isdefined{pgref:#1}%
- \iftrue \pglink{\csname pgref:#1\endcsname}%
- \else ??\opwarning{pg-label [#1] unknown. Try to TeX me again}\openref
- \fi
-}
-\def\Xlabel#1#2{\sdef{lab:#1}{#2}\sxdef{pgref:#1}{\the\lastpage}}
%%%%%%%%%%%%%% Chapters, sections, subsections -- sec. 3.8 in opmac-d.pdf
@@ -216,39 +136,45 @@
\eoldef\chap#1{\ifnonum\else \global\advance\chapnum by1 \fi
\chaphook {\globaldefs=1 \secnum=0 \seccnum=0 \tnum=0 \fnum=0 \dnum=0}\relax
- \edef\thechapnum{\the\chapnum}\let\thetocnum=\thechapnum
+ \edef\thechapnum{\ifnonum\space\else\the\chapnum\fi}\let\thetocnum=\thechapnum
\edef\thesecnum{\othe\chapnum.\the\secnum}%
- \def\dotocnumafter{\wtotoc0\bfshape{#1}}%
+ \def\dotocnumafter{\ea\wtotoc\ea{\thechapnum}1{chap}{#1}}%
\printchap{#1}\resetnonumnotoc
}
\eoldef\sec#1{\ifnonum\else \global\advance\secnum by1 \fi
\sechook {\globaldefs=1 \seccnum=0 \tnum=0 \fnum=0 \dnum=0}\relax
- \edef\thesecnum{\othe\chapnum.\the\secnum}\let\thetocnum=\thesecnum
- \def\dotocnumafter{\wtotoc1\rm{#1}}%
+ \edef\thesecnum{\ifnonum\space\else\othe\chapnum.\the\secnum\fi}\let\thetocnum=\thesecnum
+ \def\dotocnumafter{\ea\wtotoc\ea{\thesecnum}2{sec}{#1}}%
\printsec{#1}\resetnonumnotoc
}
\eoldef\secc#1{\ifnonum\else \global\advance\seccnum by1 \fi
\secchook {}\relax
- \edef\theseccnum{\othe\chapnum.\the\secnum.\the\seccnum}\let\thetocnum=\theseccnum
- \def\dotocnumafter{\wtotoc2\rm{#1}}%
+ \edef\theseccnum{\ifnonum\space\else\othe\chapnum.\the\secnum.\the\seccnum\fi}\let\thetocnum=\theseccnum
+ \def\dotocnumafter{\ea\wtotoc\ea{\theseccnum}3{secc}{#1}}%
\printsecc{#1}\resetnonumnotoc
}
-\def\wtotoc#1#2#3{% #1 = level, #2 = info, #3 = titletext
+
+\def\wtotoc#1#2#3#4{% #1 = number, #2 = level, #3 = info, #4 = text
\ifnotoc\else
- \def\act{\wref{\Xtoc{#1}{\noexpand#2}}}%
- \expandafter\act\expandafter{\expandafter{\thetocnum}{#3}{\the\pageno}}%
+ \_wref\_Xtoc{{#2}{#3}{#1}{\detokenize{#4}}}%
+ \_incr\_tocrefnum
\fi
}
+\_def\_incr#1{\_global\_advance#1by1 }
+
+\_newcount\_tocrefnum
+
\def\wcontents#1#2{% #1 = sequence to REF, #2 = titletext
\ifnotoc\else
- \expandafter\wref\expandafter#1\expandafter
+ \expandafter\_wref\expandafter#1\expandafter
{\expandafter{\thetocnum}{#2}{\the\pageno}}%
\fi
}
\def\dotocnum#1{%
\leavevmode
{\ifnonum \global\advance\nonumnum by1 \edef\thetocnum{!\the\nonumnum}\fi
- \wlabel\thetocnum \dest[toc:\tocilabel.\thetocnum]%
+ \wlabel\thetocnum
+ \ifnotoc \else \_dest[toc:\_the\_tocrefnum]\fi
\dotocnumafter}\ifnonum\else#1\fi
\global\let\dotocnumafter=\relax
}
@@ -272,6 +198,9 @@
\let\firstnoindent=\afternoindent
\def\nbpar{{\interlinepenalty=10000\endgraf}}
\def\nl{\hfil\break}
+\addto\_begoutput{\_def\nl{\_unskip\_space}}
+\addto\_pretocline{\_def\nl{\_unskip\_space}}
+
%%%%%%%%%%%%%% Captions, equations -- sec. 3.9 in opmac-d.pdf
@@ -286,8 +215,8 @@
\else \opwarning{Unknown caption /#1}%
\fi
\bgroup
- \leftskip=\iindent plus1fil
- \rightskip=\iindent plus-1fil
+ \leftskip=\_iindent plus1fil
+ \rightskip=\_iindent plus-1fil
\parfillskip=0pt plus2fil
\def\par{\nbpar\egroup}%
\captionhook{#1}\noindent
@@ -309,7 +238,7 @@
\def\begitems{\par\iiskip\bgroup
\itemnum=0 \adef*{\startitem}
- \advance\leftskip by\iindent
+ \advance\leftskip by\_iindent
\let\printitem=\normalitem
}
\def\enditems{\par\egroup\iiskip}
@@ -340,27 +269,10 @@
%%%%%%%%%%%%%% TOC -- sec. 3.11 in opmac-d.pdf
-\def\_toclist{} \newif\ifischap \ischapfalse
-
-\def\Xtoc#1#2#3#4#5{\ifnum#1=0 \ischaptrue\fi \addto\_toclist{\_tocline{#1}{#2}{#3}{#4}{#5}}}
-\def\Xchap{\Xtoc0\bfshape} \def\Xsec{\Xtoc1\rm} \def\Xsecc{\Xtoc2\rm}
-
-\def\_tocline#1#2#3#4#5{{\leftskip=#1\iindent \rightskip=2\iindent
- \ifischap\advance\leftskip by\iindent\fi
- \ifnum#1>1 \advance\leftskip by\iindent\fi
- \toclinehook \noindent\llap{#2\toclink{#3}\enspace}%
- {#2#4}\nobreak\tocdotfill\pglink{#5}\nobreak\hskip-2\iindent\null\par}}
-\def\tocdotfill{\leaders\hbox to.8em{\hss.\hss}\hskip 1em plus1fill\relax}
-
-\def\maketoc{\par \ifx\_toclist\empty
- \opwarning{\noexpand\maketoc -- data unavailable, TeX me again}\openref
- \else \_toclist \fi}
-
-\def\toclinkA#1{\def\tmp##1!##2\end{\if^##1^\kern.8em \else##1\fi}\tmp#1!\end}
%%%%%%%%%%%%%% Index -- sec. 3.12 on opmac-d.pdf
-\def\iindex#1{\openref\wref\Xindex{{#1}{\the\pageno}}}
+\def\iindex#1{\_openref\_wref\_Xindex{{#1}{\the\pageno}}}
\def\ii #1 {\leavevmode\def\tmp{#1}\iiA #1,,}
@@ -375,15 +287,15 @@
\def\iid #1 {\leavevmode\iindex{#1}#1\futurelet\tmp\iiD}
\def\iiD{\ifx\tmp,\else\ifx\tmp.\else\space\fi\fi}
-\def\Xindex{\Xindexg,}
-\def\Xindexg#1#2#3{\bgroup \def~{ }% #1=prefix, #2=index-item, #3=pageno
+\def\_Xindex{\_Xindexg,}
+\def\_Xindexg#1#2#3{\bgroup \def~{ }% #1=prefix, #2=index-item, #3=pageno
\isdefined{#1#2}\iftrue
\ifx^#3^\else
- \expandafter\firstdata \csname#1#2\endcsname \XindexA
+ \expandafter\firstdata \csname#1#2\endcsname \_XindexA
\ifnum#3=\tmpa % \ii on the same page
\else
\tmpnum=#3 \advance\tmpnum by\pgfolioB-1
- \expandafter\seconddata \csname#1#2\endcsname \XindexB
+ \expandafter\seconddata \csname#1#2\endcsname \_XindexB
\ifx\tmp\empty
\sxdef{#1#2}{{#3/+}{\pgfolioA{#3}}} % previous item: empty page
\else
@@ -417,8 +329,8 @@
\def\seconddata#1#2{\expandafter\expandafter\expandafter #2\expandafter\seconddataA#1}
\def\seconddataA#1#2{#2&}
-\def\XindexA#1/#2&{\def\tmpa{#1}\let\tmpb=#2}
-\def\XindexB#1&{\def\tmp{#1}}
+\def\_XindexA#1/#2&{\def\tmpa{#1}\let\tmpb=#2}
+\def\_XindexB#1&{\def\tmp{#1}}
\def\pgfolioA#1{\ifnum#1<0 \romannumeral-\fi#1}
\def\pgfolioB{\ifnum\tmpnum<0-\fi}
@@ -429,7 +341,7 @@
\bgroup
\setprimarysorting
\def\act##1{\ifx##1\relax \else
- \firstdata##1\XindexA \seconddata##1\XindexB
+ \firstdata##1\_XindexA \seconddata##1\_XindexB
\if\tmpb+%
\preparesorting##1% converted item by sorting data in \tmpb
\xdef##1{{\tmpb}{\tmp}}
@@ -442,7 +354,7 @@
\egroup
\dosorting % sorting is in progress
\bgroup
- \rightskip=0pt plus1fil \exhyphenpenalty=10000 \leftskip=\iindent
+ \rightskip=0pt plus1fil \exhyphenpenalty=10000 \leftskip=\_iindent
\def\act##1{\ifx##1\relax \else \prepii##1%
\seconddata##1\printiipages \expandafter\act \fi}
\expandafter \act \iilist \relax
@@ -466,7 +378,7 @@
\def\iispeclist{}
\def\printii #1&{\gdef\currii{#1}\noindent\everyii
- \hskip-\iindent \ignorespaces\printiiA#1//}
+ \hskip-\_iindent \ignorespaces\printiiA#1//}
\def\printiiA #1/{\if^#1^\let\previi=\currii \else
\expandafter\scanprevii\previi/&\def\tmpb{#1}\edef\tmpb{\meaning\tmpb}%
\ifx\tmpa\tmpb \iiemdash \else#1 \gdef\previi{}\fi
@@ -706,6 +618,8 @@
\newif\iflocalcolor \localcolorfalse
\let\localcolor=\localcolortrue
+\let\_localcolor=\localcolortrue
+
% for backward compatibility:
\let\longlocalcolor=\localcolor \let\locpgcolor=\relax
@@ -769,77 +683,6 @@
%%%%%%%%%%%%%% Hyperrefs -- sec. 3.16 in opmac-d.pdf
-\def\destheight{1.4em}
-\def\destactive[#1:#2]{\if$#2$\else\ifvmode
- \tmpdim=\prevdepth \prevdepth=-1000pt
- \destbox[#1:#2]\prevdepth=\tmpdim
- \else \destbox[#1:#2]%
- \fi\fi
-}
-\def\destbox[#1]{\vbox to0pt{\kern-\destheight \pdfdest name{#1} xyz\vss}}
-\def\dest[#1]{}
-
-\def\linkactive[#1:#2]#3#4{\leavevmode\pdfstartlink height.9em depth.3em
- \pdfborder{#1} goto name{#1:#2}\relax {#3#4}\pdfendlink
-}
-\def\link[#1]#2#3{\leavevmode{#3}}
-
-\def\urllink[#1:#2]#3{{\let~=\relax \let\\=\relax \let\{=\relax \let\}=\relax
- \leavevmode\pdfstartlink height.9em depth.3em
- \pdfborder{#1}user{/Subtype/Link/A <</Type/Action/S/URI/URI(#2)>>}\relax
- {\def~{\nobreak\space}\_urlcolor#3}\pdfendlink}%
-}
-\def\toclink#1{\toclinkA{#1}}
-\def\pglink#1{\leavevmode{\pgfolioA{#1}}}
-\def\citelink#1#2{\leavevmode{#2}}
-\def\reflink[#1]#2{\leavevmode{#2}}
-\def\ulink[#1]#2{\leavevmode{#2}}
-\def\_urlcolor{}
-
-\def\hyperlinks#1#2{%
- \let\dest=\destactive \let\link=\linkactive
- \def\toclink##1{\link[toc:\tocilabel.##1]{\localcolor#1}{\toclinkA{##1}}}%
- \def\pglink##1{\link[pg:\pgilabel.##1]{\localcolor#1}{\pgfolioA{##1}}}%
- \def\citelink##1##2{\link[cite:##1]{\localcolor#1}{##2}}%
- \def\reflink[##1]##2{\link[ref:##1]{\localcolor#1}{##2}}%
- \def\ulink[##1]##2{\urllink[url:##1]{##2}}%
- \def\_urlcolor{\localcolor#2}%
-}
-\def\tocilabel{} \def\pgilabel{}
-
-\def\pdfborder#1{\if^#1^\else \isdefined{#1border}\iftrue
- \if^\csname#1border\endcsname^\else attr{/C[\csname#1border\endcsname] /Border[0 0 .6]}\fi
- \else attr{/Border[0 0 0]}\fi\fi
-}
-
-\ifpdftex \else
- \def\link[#1]#2#3{#3}
- \def\urllink[#1]#2{#2}
- \def\hyperlinks#1#2{\opwarning{No pdfTeX detected, \noexpand\hyperlinks ignored}}
-\fi
-
-\def\url#1{{\def\tmpb{#1}%
- \replacestrings{//}{{\urlskip\urlslashslash\urlbskip}}%
- \replacestrings{/}{{\urlskip/\urlbskip}}%
- \replacestrings{.}{{\urlskip.\urlbskip}}%
- \replacestrings{?}{{\urlskip?\urlbskip}}%
- \replacestrings{=}{{\urlskip=\urlbskip}}%
- \replacestrings{~}{{\char`\~}}%
- \replacestrings{_}{{\char`\_}}%
- \replacestrings{^}{{\char`\^}}%
- \replacestrings{\\}{\bslash}%
- \replacestrings{\{}{{\char`\{}}%
- \replacestrings{\}}{{\char`\}}}%
- \replacestrings{&}{{\urlbskip\char`\& \urlskip}}%
- \def\|{}\ulink[#1]{\urlfont\tmpb\null}%
-}}
-\def\urlfont{\tt \let\|=\urlspecchar}
-\def\urlspecchar{\penalty10 }
-\def\urlskip{\null\nobreak\hskip0pt plus0.05em\relax}
-\def\urlbskip{\penalty100 \hskip0pt plus0.05em\relax}
-\def\urlslashslash{/\urlskip/}
-\addprotect\url
-
%%%%%%%%%%%%%% Outlines -- sec. 3.17 in opmac-d.pdf
%%%%%%%%%%%%%% Verbatim, \begtt, \endtt -- sec. 3.18 in opmac-d.pdf
@@ -996,43 +839,44 @@
%%%%%%%%%%%%%% \fnote, \mnote -- sec 3.22 in opmac-d.pdf
-\newcount\fnotenum \fnotenum=0
-\newcount\fnotenumlocal
+\newcount\_fnotenum \_fnotenum=0
+\newcount\_fnotenumlocal
\newif\iflocfnum \locfnumtrue
-\long\def\fnoteG#1#2{\global\advance \fnotenum by1
+\long\def\fnoteG#1{\global\advance \_fnotenum by1
\ifx\relax#1\relax\else\leavevmode\fi
- \iflocfnum \openref\wref\Xfnote{}%
- \isdefined{fn:\the\fnotenum}\iftrue
+ \iflocfnum \_openref\_wref\_Xfnote{}%
+ \isdefined{fn:\the\_fnotenum}\iftrue
\else\opwarning{unknown \noexpand\fnote mark. TeX me again}\fi\fi
- #1{\everypar={}\fnotehook\scalemain\typoscale[800/800]\vfootnote\fnmarkx{#2}}%
+ #1\_opfootnote\fnset\fnmarkx
}
+\def\fnset{\everypar={}\fnotehook\scalemain\typoscale[800/800]}
\def\fnote{\fnoteG\fnmarkx}
\def\fnotetext{\fnoteG{}}
-\def\fnotemark#1{{\advance\fnotenum by#1\relax \fnmarkx}}
-\def\fnmarkx{\isdefined{fn:\the\fnotenum}\iftrue\thefnote\else$^?$\fi}
+\def\fnotemark#1{{\advance\_fnotenum by#1\relax \fnmarkx}}
+\def\fnmarkx{\isdefined{fn:\the\_fnotenum}\iftrue\thefnote\else$^?$\fi}
\def\thefnote{$^{\locfnum}$}
-\def\locfnum{\csname fn:\the\fnotenum\endcsname}
+\def\locfnum{\csname fn:\the\_fnotenum\endcsname}
-\def\Xfnote{\advance\fnotenumlocal by1 \advance\fnotenum by1
- \sxdef{fn:\the\fnotenum}{\the\fnotenumlocal}}
+\def\_Xfnote{\advance\_fnotenumlocal by1 \advance\_fnotenum by1
+ \sxdef{fn:\the\_fnotenum}{\the\_fnotenumlocal}}
-\def\runningfnotes{\locfnumfalse\def\locfnum{\the\fnotenum}\def\fnmarkx{\thefnote}}
+\def\runningfnotes{\locfnumfalse\def\locfnum{\the\_fnotenum}\def\fnmarkx{\thefnote}}
-\newcount\mnotenum \mnotenum=0 % global counter of mnotes
+\newcount\_mnotenum \_mnotenum=0 % global counter of mnotes
\newdimen\mnoteskip \mnoteskip=0pt
\long\def\mnote#1{\ifvmode \hbox{\vbox to\ht\strutbox{}\mnoteA{#1}}\nobreak\vskip-\baselineskip
\else \strut\vadjust{\kern-\dp\strutbox \mnoteA{#1}\kern\dp\strutbox}%
\fi
}
-\long\def\mnoteA#1{\global\advance \mnotenum by1
+\long\def\mnoteA#1{\global\advance \_mnotenum by1
\ifx\mnotesfixed\undefined
- \isdefined{mn:\the\mnotenum}\iftrue
+ \isdefined{mn:\the\_mnotenum}\iftrue
\else\opwarning{unknown \noexpand\mnote side. TeX me again}\fi
- \edef\tmp{\csname mn:\the\mnotenum\endcsname}%
- \openref\wref\Xmnote{}\ifvmode\nobreak\fi
+ \edef\tmp{\csname mn:\the\_mnotenum\endcsname}%
+ \_openref\_wref\_Xmnote{}\ifvmode\nobreak\fi
\else \let\tmp=\mnotesfixed \fi
\expandafter\ifx\tmp \left
\hbox to0pt{\kern-\mnotesize \kern-\mnoteindent
@@ -1046,11 +890,14 @@
\dp0=0pt \box0 \kern\mnoteskip \global\mnoteskip=0pt}\hss}%
\fi
}
-\def\Xmnote{\advance\mnotenum by1
- \sxdef{mn:\the\mnotenum}{\ifodd\lastpage \right \else \left \fi}}
+\def\_Xmnote{\advance\_mnotenum by1
+ \sxdef{mn:\the\_mnotenum}{\ifodd\lastpage \right \else \left \fi}}
\def\fixmnotes#1{\def\mnotesfixed{#1}}
+\_addto\_begoutput{\def\fnote##1{}\def\fnotemark##1{}}
+\_addto\_pretocline{\def\fnote##1{}\def\fnotemark##1{}}
+
%%%%%%%%%%%%%% \cite, \bib, \usebibtex, \usebbl -- sec. 3.23 in opmac-d.pdf
\newwrite\auxfile % AUX file for BibTeX
@@ -1067,7 +914,7 @@
\if *#1\addcitelist{*}\expandafter \skiptorelax \fi
\isdefined{bib:#1#2}\iftrue \else
\addcitelist{#1#2}%
- \opwarning{The cite [#1#2] unknown. Try to TeX me again}\openref
+ \opwarning{The cite [#1#2] unknown. Try to TeX me again}\_openref
\addto\savedcites{?,}\def\sortcitesA{}\lastcitenum=0
\expandafter\gdef\csname bib:#1#2\endcsname {}%
\expandafter \skiptorelax \fi
@@ -1128,8 +975,8 @@
}
\def\shortcitations{\lastcitenum=1 }
-\def\printcite#1{\citesep\citelink{#1}{\citelinkA{#1}}\def\citesep{,\hskip.2em\relax}}
-\def\printdashcite#1{\ifmmode-\else\hbox{--}\fi\citelink{#1}{\citelinkA{#1}}}
+\def\printcite#1{\citesep\_ilink[cite:#1]{\citelinkA{#1}}\def\citesep{,\hskip.2em\relax}}
+\def\printdashcite#1{\ifmmode-\else\hbox{--}\fi\_ilink[cite:#1]{\citelinkA{#1}}}
\def\citesep{}
\def\nonumcitations{\lastcitenum=0\def\sortcitesA{}\def\etalchar##1{$^{##1}$}%
@@ -1139,7 +986,7 @@
\def\citelinkA{}
\def\ecite[#1]{\bgroup\citeA#1,,,\expandafter\eciteB\savedcites;}
-\def\eciteB#1,#2;#3{\if?#1\relax #3\else \citelink{#1}{#3}\fi\egroup}
+\def\eciteB#1,#2;#3{\if?#1\relax #3\else \_ilink[cite:#1]{#3}\fi\egroup}
\def\bib[#1]{\def\tmp{\isnextchar={\bibA[#1]}{\bibmark={}\bibB[#1]}}%
\expandafter\tmp\romannumeral-`\.} % ignore optional space
@@ -1149,23 +996,23 @@
\noindent \def\tmpb{#1}\wbib{#1}{\the\bibnum}{\the\bibmark}%
\printbib \ignorespaces
}
-\def\wbib#1#2#3{\dest[cite:\the\bibnum]%
- \ifx\wref\wrefrelax\else \immediate\wref\Xbib{{#1}{#2}{#3}}\fi}
+\def\wbib#1#2#3{\_dest[cite:\the\bibnum]%
+ \ifx\_wref\wrefrelax\else \immediate\_wref\_Xbib{{#1}{#2}{#3}}\fi}
-\def\Xbib#1#2#3{\sdef{bib:#1}{\bibnn{#2}&}\if^#3^\else\sdef{bim:#2}{#3}\fi\def\lastbibnum{#2}}
+\def\_Xbib#1#2#3{\sdef{bib:#1}{\bibnn{#2}&}\if^#3^\else\sdef{bim:#2}{#3}\fi\def\lastbibnum{#2}}
-\def\printbib{\hangindent=\iindent
- \ifx\citelinkA\empty \noindent\hskip\iindent \llap{[\the\bibnum] }%
+\def\printbib{\hangindent=\_iindent
+ \ifx\citelinkA\empty \noindent\hskip\_iindent \llap{[\the\bibnum] }%
\else \noindent \fi
}
\def\addcitelist#1{\global\addto\citelist{\citeI[#1]}}
\def\writeaux#1{\immediate\write\auxfile{\string\citation{#1}}}
-\def\writeXcite#1{\openref\immediate\wref\Xcite{{#1}}}
+\def\writeXcite#1{\_openref\immediate\_wref\_Xcite{{#1}}}
\def\citelist{} \def\citelistB{}
\def\usebibtex#1#2{%
- \openref \openauxfile{#1}{#2}%
+ \_openref \openauxfile{#1}{#2}%
\def\citeI[##1]{\writeaux{##1}}\citelist
\global\let\addcitelist=\writeaux
\bgroup \readbblfile{\jobname}\egroup
@@ -1173,7 +1020,7 @@
\def\openauxfile#1#2{%
\immediate\openout\auxfile=\jobname.aux
\immediate\write\auxfile
- {\percent\percent\space Opmac: AUX file reserved for bibtex only}%
+ {\_pcent\_pcent\space Opmac: AUX file reserved for bibtex only}%
\immediate\write\auxfile{\string\bibdata{#1}}%
\immediate\write\auxfile{\string\bibstyle{#2}}%
}
@@ -1188,7 +1035,7 @@
\def\httpAddr##1{\url{http:##1}}\def\\{\hfill\break}%
\def\newblock{\hskip .11em plus.33em minus.07em}%
\def\mbox{\leavevmode\hbox}\def\emph##1{{\it##1}}%
- \parindent=\iindent \bibtexhook\relax
+ \parindent=\_iindent \bibtexhook\relax
\input #1.bbl
\par
\fi
@@ -1204,7 +1051,7 @@
\def\genbbl#1#2{\openauxfile{#1}{#2}%
\immediate\write\auxfile{\string\citation{*}}%
\bgroup
- \iindent=4em
+ \_iindent=4em
\def\bibitemC##1{\par\ifnum\bibnum>0 \bibskip \fi
\advance\bibnum by1
\noindent \hangindent=\parindent
@@ -1245,7 +1092,7 @@
\global\let\addcitelist=\writeXcite
\egroup
}
-\def\Xcite#1{\addto\citelistB{\citeI[#1]}}
+\def\_Xcite#1{\addto\citelistB{\citeI[#1]}}
\newcatcodetable\savedcatcodes
@@ -1253,19 +1100,12 @@
%%%%%%%%%%%%%% output -- sec. 3.24 in opmac-d.pdf
-\addto\_begoutput{%
- \immediate\wref\Xpage{{\the\pageno}}%
- \def\nl{ }\def\fnote##1{}\def\fnotemark##1{}%
-}
\def\doprotect#1{\let#1=\relax}
-\def\_pagedest{\def\destheight{25pt}\dest[pg:\pgilabel.\the\pageno]}
+\def\_pagedest{\def\destheight{25pt}\_dest[pg:\_the\_gpageno]}
%\footline={\hss\_tenrm\thefontsize[10]\folio\hss}
-\newcount\lastpage \lastpage=0 % the last page of the document
-\def\Xpage#1{\lastpage=#1 \fnotenumlocal=0 }
-
%%%%%%%%%%%%%% margins -- sec. 3.25 in opmac-d.pdf
@@ -1287,7 +1127,7 @@
\eoldef\author##1{\removelastskip\bigskip
{\leftskip=0pt plus1fill \rightskip=\leftskip \it \noindent ##1\par}\nobreak\bigskip
}
- \parindent=1.2em \iindent=\parindent \_ttindent=\parindent
+ \parindent=1.2em \_iindent=\parindent \_ttindent=\parindent
\footline={\global\footline={\hss\_tenrm\thefontsize[10]\folio\hss}}
\runningfnotes
}
diff --git a/Master/texmf-dist/tex/luatex/optex/optex.ini b/Master/texmf-dist/tex/luatex/optex/optex.ini
index 280dd347ca0..802e6ccc2eb 100644
--- a/Master/texmf-dist/tex/luatex/optex/optex.ini
+++ b/Master/texmf-dist/tex/luatex/optex/optex.ini
@@ -20,7 +20,7 @@
% OpTeX version
-\def\optexversion{Alpha 0.03 Feb 2020}
+\def\optexversion{Alpha 0.05 Feb 2020}
% Engine testing:
@@ -62,8 +62,12 @@
\input fonts-opmac.opm % font managing macros from OPmac
\input outlines.opm % PDF outlines
\input pdfuni-string.opm % PDFunicode strings for outlines
+\input maketoc.opm % maketoc
\input output.opm % output routine
\input margins.opm % macros for margins setting
+\input ref-file.opm % ref file
+\input references.opm % references
+\input hyperlinks.opm % hyperlinks
\input verbatim.opm % verbatim
\input logos.opm % standard logos
\input uni-lcuc.opm % Setting lccodes and uccodes for Unicode characters
@@ -74,7 +78,7 @@
\_everyjob = {%
\_message{This is OpTeX (Olsak's Plain TeX), version <\optexversion>^^J}%
\_mathsbon % replaces \int_a^b to \int _a^b
- \inputref % inputs \jobname.ref if exists
+ \_inputref % inputs \jobname.ref if exists
}
\let\loadmathfonts=\relax % TODO: unicode-math
diff --git a/Master/texmf-dist/tex/luatex/optex/outlines.opm b/Master/texmf-dist/tex/luatex/optex/outlines.opm
index e95f4ec9c5f..5a5529a0858 100644
--- a/Master/texmf-dist/tex/luatex/optex/outlines.opm
+++ b/Master/texmf-dist/tex/luatex/optex/outlines.opm
@@ -2,23 +2,25 @@
\_codedecl \pdfunidef {PDFunicode strings for outlines <2019-05-21>}
-\_def\_outlines#1{\_pdfcatalog{/PageMode/UseOutlines}\openref
+\_def\_outlines#1{\_pdfcatalog{/PageMode/UseOutlines}\_openref
\_ifx\_toclist\_empty
\_opwarning{\noexpand\outlines -- data unavailable. TeX me again}%
\_else
- \_ifx\_urlcolor\_empty
+ \_ifx\_dest\_destactive \_else
\opwarning{\_noexpand\outlines doesn't work when \_noexpand\hyperlinks isn't declared}\_fi
{\_let\_tocline=\_outlinesA
- \_count0=0 \_count1=0 \_toclist % calculate numbers o childs
+ \_count0=0 \_count1=0 \_count2=0 \_count3=0 \_toclist % calculate numbers o childs
\_def\_outlinelevel{#1}\_let\_tocline=\_outlinesB
- \_count0=0 \_count1=0 \_toclist}% create outlines
+ \_tocrefnum=0 \_count0=0 \_count1=0 \_count2=0 \_count3=0 \_toclist}% create outlines
\_fi
}
-\_def\_outlinesA#1#2#3#4#5{%
+\_def\_outlinesA#1#2#3#4#5#6{%
\_advance\_count#1 by1
\_ifcase#1\_or
- \_addoneol{_ol:\_the\_count0}\_or
- \_addoneol{_ol:\_the\_count0:\_the\_count1}\_fi
+ \_addoneol{_ol:\_the\_count0}\_or
+ \_addoneol{_ol:\_the\_count0:\_the\_count1}\_or
+ \_addoneol{_ol:\_the\_count0:\_the\_count1:\_the\_count2}\_or
+ \_addoneol{_ol:\_the\_count0:\_the\_count1:\_the\_count2:\_the\_count3}\_fi
}
\_def\_addoneol#1{%
\_ifcsname #1\_endcsname
@@ -27,21 +29,24 @@
\_else \_sxdef{#1}{1}%
\_fi
}
-\_def\_outlinesB#1#2#3#4#5{%
+\_def\_outlinesB#1#2#3#4#5#6{%
\_advance\_count#1 by1
- \_ifcase#1\_tmpnum=\_csifdefined{_ol:\_the\_count0}{0}\_relax\_or
- \_tmpnum=\_csifdefined{_ol:\_the\_count0:\_the\_count1}{0}\_relax\_or
- \_tmpnum = 0\_relax\_fi
+ \_ifcase#1%
+ \_tmpnum=\_trycs{_ol:\_the\_count0}{0}\_or
+ \_tmpnum=\_trycs{_ol:\_the\_count0:\_the\_count1}{0}\_relax\_or
+ \_tmpnum=\_trycs{_ol:\_the\_count0:\_the\_count1:\_the\_count2}{0}\_relax\_or
+ \_tmpnum=\_trycs{_ol:\_the\_count0:\_the\_count1:\_the\_count2:\_the\_count3}{0}\_relax\_or
+ \_tmpnum = 0\_relax\_fi
\_pdfunidef\_tmp{#4}%
- \_outlinesC{#1}{toc:\tocilabel.#3}{\_ifnum#1<\_outlinelevel\_space\_else-\_fi}{\_tmpnum}{\_tmp}%
+ \_outlinesC{#1}{toc:\_the\_tocrefnum}{\_ifnum#1<\_outlinelevel\_space\_else-\_fi}{\_tmpnum}{\_tmp}%
+ \_advance\_tocrefnum by1
}
-\_def\_csifdefined#1#2{\_ifcsname #1\_endcsname \_csname#1\_endcsname \_else #2\_fi}
\_def\_outlinesC#1#2#3#4#5{\_pdfoutline goto name{#2} count #3#4{#5}\_relax}
\_newcount\_oulnum
\_def\_insertoutline#1{\_global\_advance\_oulnum by1
- \_pdfdest name{oul:\_the\_oulnum} xyz\_relax
- \_pdfoutline goto name{oul:\_the\_oulnum} count0 {#1}\_relax
+ \_pdfdest name{_oul:\_the\_oulnum} xyz\_relax
+ \_pdfoutline goto name{_oul:\_the\_oulnum} count0 {#1}\_relax
}
\_public
@@ -49,14 +54,44 @@
\_endcode % ----------------------------
-The PDF format provides ``outlines'' which are notes placed in the special frame of
-the PDF viewer. These notes can be managed as structured and hyperlinked
-table of contents of the document. The command "\outlines{<level>}" creates
-such outlines from data used for table of contents in the document. The
-"<level>" parameter gives the level of opened sub-outlines
-in the default view. The deeper levels can be open by mouse click on the
-triangle symbol after that.
-
-The command "\insertoutline{<text>}" inserts next entry into PDF outlines at
-the main level~0. This entry can be placed before table of contents (created
-by "\outlines") or after it.
+The problem is that PDF format needs to know the number of direct
+descendants of each outline if we need to create the tree of structured
+outlines. But we know only the level of each outline. The required data
+should be calculated from TOC data. We use two steps over TOC data saved in
+the `\_toclist` where each record is represented by one `\_tocline`.
+
+First step, the `\outline` macro sets `\_tocline` to `\_outlineA` and
+calculates the number of direct descendants of each record. Second step,
+the `\outline` macro sets `\_tocline` to `\_codlineB` and it uses prepared
+data and crete outlines.
+
+Each ouline is mapped to the control sequence of the type
+`\_ol:<num>` or `\_ol:<num>:<num>` or `\_ol:<num>:<num>:<num>` or etc.
+The first one is reserved for level 0, the second one for level 1 (chapters), third
+one for level 2 (sections) etc. The number of direct descentants will be stored
+in these macros after first step i finished. Each new outline of given level
+incerases the <num> at given level. When the first step is processed then
+(above that) the `\_ol:..` sequence of the parent inceases its value too. The
+`_ol:...` sequences are implemented by `\_ol:\_count0:\_count1:\count2` etc.
+For example, when section (level 2) is processed in the fisrst step then we do:
+
+\begtt
+ \advance \count2 by 1
+ % incerases the mapping pointer of the type
+ % \_ol:<\_count0:\_count1:\_count2> of this section
+ \advance \<_ol:\_count0:\_count1> by 1
+ % incerases the number of descendants connected
+ % to the parent of this section.
+\endtt
+
+When second step is processed, then we only read the stored data about the
+number of descentants. Ad we use it in `count` parameter of `\_pdfoutline`
+primitive.
+
+For linking we use the same links as in TOC, i.e. the `_toc:\_the\_tocrefnum`
+labels are used.
+
+`\insertoutline {<text>}` inserts one outline with zero direct descendants.
+It creates link destination of the type `_oul:<num>` into the document
+(where `\isertoutline` is used) and the link itself is created too in the
+outline.
diff --git a/Master/texmf-dist/tex/luatex/optex/output.opm b/Master/texmf-dist/tex/luatex/optex/output.opm
index e8028abcf13..a22afe68973 100644
--- a/Master/texmf-dist/tex/luatex/optex/output.opm
+++ b/Master/texmf-dist/tex/luatex/optex/output.opm
@@ -10,9 +10,9 @@
\_shipout\_vbox{%
\_istoksempty \_pgbackground
\_iffalse \_backgroundbox {\_the\_pgbackground}\_nointerlineskip \_fi
- \_istoksempty \_headline \_iffalse \_ensureblack{\_makeheadline}\_fi
+ \_ensureblack{\_makeheadline}%
\_vbox to\_vsize {\_boxmaxdepth=\_maxdepth \_pagecontents}%
- \_istoksempty \_footline \_iffalse \_ensureblack{\_makefootline}\_fi }%
+ \_ensureblack{\_makefootline}}%
\_advancepageno
\_ifnum\_outputpenalty>-20000 \_else\_dosupereject\_fi
}
@@ -21,10 +21,16 @@
\_def \_prepoffsets {} % will be re-defined by margins macros
\_def \_backgroundbox #1{\_moveleft\_hoffset\_vbox to0pt{\_kern-\voffset #1\_vss}}
-\_def\_makeheadline {\_vbox to0pt{\_vskip-\_headlinedist
- \_line{\_copy\_strutbox \_the\_headline}\_vss}\_nointerlineskip}
-\_def\_makefootline{\_baselineskip=\_footlinedist
- \_lineskiplimit=-\maxdimen \_line{\_the\_footline}}
+\_def\_makeheadline {\_istoksempty \_headline \_iffalse
+ \_vbox to0pt{\_vskip-\_headlinedist
+ \_line{\_copy\_strutbox \_the\_headline}\_vss}\_nointerlineskip
+ \_fi
+}
+\_def\_makefootline{\_istoksempty \_footline \_iffalse
+ \_baselineskip=\_footlinedist
+ \_lineskiplimit=-\maxdimen \_line{\_the\_footline}
+ \_fi
+}
\_def\_pagecontents{\_pagedest % destination of the page
\_ifvoid\_topins \_else \_ensureblack{\_unvbox\_topins}\_fi
\_dimen0=\dp255 \_unvbox255 % open up \box255
@@ -48,8 +54,9 @@
\_countdef\_pageno=0 \_pageno=1 % first page is number 1
\_def \_folio {\_ifnum\_pageno<0 \_romannumeral-\_pageno \_else \_number\_pageno \_fi}
\_def \_nopagenumbers {\_footline={}}
-\_def \_advancepageno {\_ifnum\_pageno<0 \_global\_advance\_pageno by-1
- \_else \_global \_advance\_pageno by1 \_fi } % increase |pageno|
+\_def \_advancepageno {%
+ \_ifnum\_pageno<0 \_global\_advance\_pageno by-1 \_else \_incr\_pageno \_fi
+} % increase |pageno|
\_newifi\_ifraggedbottom
\_def \_raggedbottom {\_topskip=10pt plus60pt \_raggedbottomtrue}
\_def \_normalbottom {\_topskip=10pt \_raggedbottomfalse} % undoes \raggedbottom
@@ -60,12 +67,13 @@
\_def \_footnote #1{\_let\_osf=\_empty % parameter #2 (the text) is read later
\_ifhmode \_edef\_osf{\_spacefactor\_the\_spacefactor}\/\_fi
#1\_osf\_vfootnote{#1}}
-\_def \_vfootnote #1{\_insert\_footins\_bgroup
+\_def\_vfootnote#1{\_opfootnote{}{#1}}
+\_def \_opfootnote #1#2{\_insert\_footins\_bgroup
\_interlinepenalty=\_interfootnotelinepenalty
\_splittopskip=\_ht\_strutbox % top baseline for broken footnotes
\_splitmaxdepth=\_dp\_strutbox \_floatingpenalty=20000
- \_leftskip=0pt \_rightskip=0pt \_spaceskip=0pt \_xspaceskip=0pt \_relax
- \_textindent{#1}\_footstrut
+ \_leftskip=0pt \_rightskip=0pt \_spaceskip=0pt \_xspaceskip=0pt \_relax
+ #1\_textindent{#2}\_footstrut
\_isnextchar \_bgroup {\_bgroup \_aftergroup\_vfootA \_let\_next=}{\_vfootB}%
}
\_def\_vfootA{\_strut\_egroup}
@@ -97,6 +105,7 @@
\_ifupage \_dimen0=\_dp0
\_vbox to\_vsize {\_unvbox0 \_kern-\_dimen0}% depth is zero
\_else \_box0 \_nobreak \_bigskip \_fi}\_fi\_endgroup}
+
\_public
\topins \topinsert \midinsert \pageinsert \endinsert ;
diff --git a/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm b/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm
index dac1c5c3b82..923a08fc86f 100644
--- a/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm
+++ b/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm
@@ -12,9 +12,14 @@
}}
\_def\_pdfunidef#1#2{%
\_begingroup
- \_catcode`\\=12 \_let\\=\_nbackslash
+ \_catcode`\\=12 \_let\\=\_bslash
\_the\_pdfstringout % extra defnitions of logos etc.
+ \_the\_outlineshook % user definitions
\_edef#1{#2}%
+ \_ea\_edef \_ea#1\_ea{\_ea\_removeoutmath #1$\_end$}% $x$ -> x
+ \_ea\_edef \_ea#1\_ea{\_ea\_removeoutbraces #1{\_end}}% {x} -> x
+ \_escapechar=-1
+ \_edef#1{\_detokenize\_ea{#1}}%
\_replstring#1{ }{{ }}% text text -> text{ }text
\_edef\_out{\\376\\377}%
\_ea\_pdfunidefB#1^% text -> \_out in octal
@@ -25,14 +30,23 @@
\_def\_pdfunidefB#1{%
\_ifx^#1\_else
\_tmpnum=`#1
- \_ea\_ifx\_nbackslash#1\_pdfunidefC{#1#1}\_else\_pdfunidefC{#1}\_fi
+ \_pdfunidefC{\_luaescapestring{#1}}%
\_ea\_pdfunidefB \_fi
}
\_def\_pdfunidefC #1{\_edef\_out{\_out \\\_ea\_octalprint\_ea{\_the\_tmpnum}{#1}}}
-\_newtoks \_pdfstringout
+\_def\_removeoutbraces #1#{#1\_removeoutbracesA}
+\_def\_removeoutbracesA #1{\_ifx\_end#1\_else #1\_ea\_removeoutbraces\_fi}
+\_def\_removeoutmath #1$#2${#1\_ifx\_end#2\_else #2\_ea\_removeoutmath\_fi}
-\public \pdfunidef \pdfstringout ;
+\_newtoks \_pdfstringout \_newtoks \_outlineshook
+
+\_pdfstringout={\_let\em=\_empty \_let\rm=\_empty \_let\bf=\_empty
+ \_let\it=\_empty \_let\bi=\_empty \_let\tt=\_empty \_let\/=\_empty
+ \_let~=\_space \let\nl=\_space
+}
+
+\public \pdfunidef \outlineshook ;
\_endcode % --------------------------------
diff --git a/Master/texmf-dist/tex/luatex/optex/prefixed.opm b/Master/texmf-dist/tex/luatex/optex/prefixed.opm
index ca84181f6ea..c545c29f1ad 100644
--- a/Master/texmf-dist/tex/luatex/optex/prefixed.opm
+++ b/Master/texmf-dist/tex/luatex/optex/prefixed.opm
@@ -7,7 +7,7 @@
\let\_directlua = \directlua
\_directlua {
- % enable all primitives with _ prefix
+ % enable all TeX primitives with _ prefix
tex.enableprimitives('_', tex.extraprimitives('tex'))
% enable all primitives without prefixing
tex.enableprimitives('', tex.extraprimitives())
diff --git a/Master/texmf-dist/tex/luatex/optex/ref-file.opm b/Master/texmf-dist/tex/luatex/optex/ref-file.opm
new file mode 100644
index 00000000000..e16e89ab7b5
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/optex/ref-file.opm
@@ -0,0 +1,61 @@
+%% This is part of OpTeX project, see http://petr.olsak.net/optex
+
+\_codedecl \_openref {references <2020-02-14>}
+
+\_newwrite\_reffile
+
+\_def\_wrefrelax#1#2{}
+\_let\_wref=\_wrefrelax
+
+\_def\_inputref {%
+ \_isfile{\_jobname.ref}\_iftrue
+ \input {\jobname.ref}
+ \_fnotenum=0 \_mnotenum=0
+ \_openrefA{\_string\inputref}%
+ \_fi
+}
+\_def\_openref {%
+ \_ifx \_wref\_wrefrelax \_openrefA{\_string\openref}\_fi
+ \_gdef\_openref{}%
+}
+\_def\_openrefA #1{%
+ \_immediate\_openout\_reffile="\_jobname.ref"\_relax
+ \_gdef\_wref ##1##2{\_write\_reffile{\_string##1##2}}%
+ \_immediate\_write\_reffile {\_pcent\_pcent\_space OPTeX - REF file (#1)}%
+ \_immediate\_wref \_Xrefversion{{\_REFversion}}%
+}
+\_def\_REFversion{3}
+\_def\_Xrefversion#1{\_ifnum #1=\_REFversion\_relax \_else \_endinput \_fi}
+\_def\_Xprocess#1{#1}
+
+\_public \Xrefversion ;
+
+\_endcode % -------------------------------------
+
+The `\_inputref` macro is used in `\everyjob`. It reads `\jobname.ref` file
+if it exists. After the file is read then it is removed and opened to write
+a new contents to this file.
+
+If the file does not exists then it is not created. It means that if you
+process a document without any forward references then no `\jobname.ref`
+file is created because it is unusable. The `\_wref` macro is unusable in
+such case.
+
+If a macro needs to ceate and to use REF file then such file must be created by
+`\_openref`. When the file is created (using internal `\_openrefA`) then
+`\_opneref` destroys itself, because we need not to open the file again.
+
+We are using a convention that the macros used in REF file are named
+`\_X<foo>`. If there is a new wersion of \OpTeX/ with different collection
+of such macros then we don't want to read the REF files produced by an
+old version of \OpTeX/. So first line of REF line is in the form
+
+\begtt
+\_Xrefversion{<version>}
+\endtt
+
+We can check the verion compatibility by this macro.
+
+User can write the `\_openref\_wref\_Xpocess{<comething>}` at beginning of
+the document if he/she needs to define a macros used in REF file later.
+
diff --git a/Master/texmf-dist/tex/luatex/optex/references.opm b/Master/texmf-dist/tex/luatex/optex/references.opm
new file mode 100644
index 00000000000..8eb1fba2e27
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/optex/references.opm
@@ -0,0 +1,113 @@
+%% This is part of OpTeX project, see http://petr.olsak.net/optex
+
+\_codedecl \ref {references <2020-02-22>}
+
+%> \_Xpage
+
+\_newcount\_lastpage \_lastpage=0 % the last page of the document
+\_newcount\_fnotenumlocal
+\_def\_Xpage#1#2{\_def\_currpage{{#1}{#2}}\_lastpage=#2 \_fnotenumlocal=0 }
+
+%> \_Xlabel
+
+\_def\_Xlabel#1#2{\_sdef{_lab:#1}{#2}\_sxdef{_pgref:#1}{\_ea\_bracketspg\_currpage}}
+\_def\_bracketspg#1#2{[pg:#1]{#2}}
+
+%> \label \wlabel
+
+\_def\_label[#1]{\_isdefined{l0:#1}%
+ \_iftrue \_opwarning{duplicated label [#1], ignored}\_else \_xdef\_lastlabel{#1}\_fi
+ \_ignorespaces
+}
+\_def\_wlabel#1{%
+ \_ifx\_lastlabel\_undefined \_else
+ \_dest[ref:\_lastlabel]%
+ \_edef\_tmp{{\_lastlabel}{#1}}%
+ \_ea\_wref \_ea\_Xlabel \_ea{\_tmp}%
+ \_sxdef{_lab:\_lastlabel}{#1}\_sxdef{l0:\_lastlabel}{}%
+ \_global\_let\_lastlabel=\_undefined
+ \_fi
+}
+
+%> \ref \pgref
+
+\_def\_ref[#1]{\_isdefined{_lab:#1}%
+ \_iftrue \_ilink[ref:#1]{\_csname _lab:#1\_endcsname}%
+ \_else ??\_opwarning{label [#1] unknown. Try to TeX me again}\_openref
+ \_fi
+}
+\_def\_pgref[#1]{\isdefined{_pgref:#1}%
+ \_iftrue \_ea\_ea\_ea\_ilink \_csname _pgref:#1\_endcsname
+ \_else ??\_opwarning{pg-label [#1] unknown. Try to TeX me again}\_openref
+ \_fi
+}
+
+%> \begoutput
+
+\addto\_begoutput{%
+ \_incr \_gpageno % global pageno from one independent on pagination
+ \immediate\_wref\_Xpage{{\the\gpageno}{\_the\_pageno}}%
+}
+
+\_newcount\_gpageno
+
+\_public
+ \label \wlabel \ref \pgref \gpageno ;
+
+
+\_endcode % -------------------------------------
+
+The REF file looks like:
+
+\begtt
+\_Xpage{<gpageno>}{<pageno>}
+\_Xlabel{<label>}{<text>}
+\_Xlabel{<label>}{<text>}
+\_Xlabel{<label>}{<text>}
+...
+\_Xpage{<gpageno>}{<pageno>}
+\_Xlabel{<label>}{<text>}
+...
+\endtt
+
+where <gpageno> is internal page number numbered from one and <pageno> is
+a page number used in pagination. Each page begins with `\_Xpage`.
+The <label> is <label> used by user in `\label[<label>]` and <text> is a
+<text> which shoul be referenced (the number of section or table, for
+example).
+
+The REF file is scanned at the begining of the document using `\inputref`
+invoked by `\everyjob`.
+
+\%> \_Xpage
+
+`\_Xpage {<gpageno>}{<pageno>}` saves the patameter pair into `\_currpage`
+and actualizes `\lastpage`. Resets `\_fnotenumlocal` used if footnotes are
+numbered from one at each page.
+
+\%> \_Xlabel
+
+`\_Xlabel {<label>}{<text>}` saves <text> to `\_lab:<label>` nad saves
+`[<gpageno>]{<pageno>}` to `\_pgref:<label>`.
+
+\%> \label \wlabel
+
+`\label[<label>]` saves decalred labet to `\_lastlabel` and `\wlabel{<text>}`
+uses `\lastlabel` and activetes `\wref\_Xlabel{<label>}{<text>}`.
+
+\%> \ref \pgref
+
+`\ref[<label>]` uses saved `\_lab:<label>` and prints (linked) <text>.
+If the reference is backwarded then we know `\lab:<label>` without any need
+to read REF file. On the other hand, if the reference is forwarded, then we
+doesn't know `\_lab:<label>` in first run of \TeX/ and we print warning and
+do `\_openref`.
+
+`\pgref[<label>]` uses `{<gpageno>}{<pageno>}` from `\_pgref:<label>` and
+prints (linked) <pageno> using `\_ilink` macro.
+
+\%> \begoutput
+
+We add to `\_begoutput` incrementing `<gpageno>` and writting
+`\_Xpage {<gpageno>}{<pageno>}`.
+
diff --git a/Master/texmf-dist/tex/luatex/optex/unimath-codes.opm b/Master/texmf-dist/tex/luatex/optex/unimath-codes.opm
index 816584022ec..b6d9226a954 100644
--- a/Master/texmf-dist/tex/luatex/optex/unimath-codes.opm
+++ b/Master/texmf-dist/tex/luatex/optex/unimath-codes.opm
@@ -2,261 +2,271 @@
% This file is read when \loadmath is used.
-\_ifx \ncharrmA\undefined \_else \_endinput \_fi
+\_ifx \_ncharrmA\_undefined \_else \_endinput \_fi
-\umathnumB="0391
-\greekdef \Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta \Iota \Kappa
+\_umathnumB="0391
+\_greekdef \Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta \Iota \Kappa
\Lambda \Mu \Nu \Xi \Omicron \Pi \Rho \varTheta \Sigma \Tau \Upsilon \Phi
- \Chi \Psi \Omega \relax
+ \Chi \Psi \Omega \_relax
-\umathnumB="03B1
-\greekdef \alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa
+\_umathnumB="03B1
+\_greekdef \alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa
\lambda \mu \nu \xi \omicron \pi \rho \varsigma \sigma \tau \upsilon
- \varphi \chi \psi \omega \varbeta \vartheta \phi \varpi \relax
-
-\chardef\ncharrmA=`A \chardef\ncharrma=`a
-\chardef\ncharbfA="1D400 \chardef\ncharbfa="1D41A
-\chardef\ncharitA="1D434 \chardef\ncharita="1D44E
-\chardef\ncharbiA="1D468 \chardef\ncharbia="1D482
-\chardef\ncharclA="1D49C \chardef\ncharcla="1D4B6
-\chardef\ncharbcA="1D4D0 \chardef\ncharbca="1D4EA
-\chardef\ncharfrA="1D504 \chardef\ncharfra="1D51E
-\chardef\ncharbrA="1D56C \chardef\ncharbra="1D586
-\chardef\ncharbbA="1D538 \chardef\ncharbba="1D552
-\chardef\ncharsnA="1D5A0 \chardef\ncharsna="1D5BA
-\chardef\ncharbsA="1D5D4 \chardef\ncharbsa="1D5EE
-\chardef\ncharsiA="1D608 \chardef\ncharsia="1D622
-\chardef\ncharsxA="1D63C \chardef\ncharsxa="1D656
-\chardef\ncharttA="1D670 \chardef\nchartta="1D68A
-
-\protected\def\rmvariables {\umathrange{A-Z}\ncharrmA \umathrange{a-z}\ncharrma}
-\protected\def\bfvariables {\umathrange{A-Z}\ncharbfA \umathrange{a-z}\ncharbfa}
-\protected\def\nitvariables {\umathrange{A-Z}\ncharitA \umathrange{a-z}\ncharita}
-\protected\def\bivariables {\umathrange{A-Z}\ncharbiA \umathrange{a-z}\ncharbia}
-\protected\def\calvariables {\umathrange{A-Z}\ncharclA \umathrange{a-z}\ncharcla}
-\protected\def\bcalvariables {\umathrange{A-Z}\ncharbcA \umathrange{a-z}\ncharbca}
-\protected\def\frakvariables {\umathrange{A-Z}\ncharfrA \umathrange{a-z}\ncharfra}
-\protected\def\bfrakvariables {\umathrange{A-Z}\ncharbrA \umathrange{a-z}\ncharbra}
-\protected\def\bbvariables {\umathrange{A-Z}\ncharbbA \umathrange{a-z}\ncharbba}
-\protected\def\sansvariables {\umathrange{A-Z}\ncharsnA \umathrange{a-z}\ncharsna}
-\protected\def\bsansvariables {\umathrange{A-Z}\ncharbsA \umathrange{a-z}\ncharbsa}
-\protected\def\isansvariables {\umathrange{A-Z}\ncharsiA \umathrange{a-z}\ncharsia}
-\protected\def\bisansvariables {\umathrange{A-Z}\ncharsxA \umathrange{a-z}\ncharsxa}
-\protected\def\ttvariables {\umathrange{A-Z}\ncharttA \umathrange{a-z}\nchartta}
-
-\chardef\greekrmA="0391 \chardef\greekrma="03B1
-\chardef\greekbfA="1D6A8 \chardef\greekbfa="1D6C2
-\chardef\greekitA="1D6E2 \chardef\greekita="1D6FC
-\chardef\greekbiA="1D71C \chardef\greekbia="1D736
-\chardef\greeksnA="1D756 \chardef\greeksna="1D770
-\chardef\greeksiA="1D790 \chardef\greeksia="1D7AA
-
-\protected\def\nitgreek {\umathrangeGREEK\greekrmA \umathrangegreek\greekita}
-\protected\def\rmgreek {\umathrangeGREEK\greekrmA \umathrangegreek\greekrma}
-\protected\def\bfgreek {\umathrangeGREEK\greekbfA \umathrangegreek\greekbfa}
-\protected\def\bigreek {\umathrangeGREEK\greekbfA \umathrangegreek\greekbia}
-\protected\def\sansgreek {\umathrangeGREEK\greeksnA \umathrangegreek\greeksna}
-\protected\def\isansgreek {\umathrangeGREEK\greeksnA \umathrangegreek\greeksia}
-
-% Another possibility (slanted capitals in \nitgreek, \bigreek, \isansgreek):
-%\protected\def\nitgreek {\umathrangeGREEK\greekitA \umathrangegreek\greekita}
-%\protected\def\rmgreek {\umathrangeGREEK\greekrmA \umathrangegreek\greekrma}
-%\protected\def\bfgreek {\umathrangeGREEK\greekbfA \umathrangegreek\greekbfa}
-%\protected\def\bigreek {\umathrangeGREEK\greekbiA \umathrangegreek\greekbia}
-%\protected\def\sansgreek {\umathrangeGREEK\greeksnA \umathrangegreek\greeksna}
-%\protected\def\isansgreek {\umathrangeGREEK\greeksiA \umathrangegreek\greeksia}
-
-\chardef\digitrmO=`0
-\chardef\digitbfO="1D7CE
-\chardef\digitbbO="1D7D8
-\chardef\digitsnO="1D7E2
-\chardef\digitbsO="1D7EC
-\chardef\digitttO="1D7F6
-
-\protected\def\rmdigits {\umathrange{0-9}\digitrmO}
-\protected\def\bfdigits {\umathrange{0-9}\digitbfO}
-\protected\def\bbdigits {\umathrange{0-9}\digitbbO}
-\protected\def\sansdigits {\umathrange{0-9}\digitsnO}
-\protected\def\bsansdigits {\umathrange{0-9}\digitbsO}
-\protected\def\ttdigits {\umathrange{0-9}\digitttO}
-
-\protected\def\inmath#1{\relax \ifmmode#1\fi} % to keep off \loop processing in text mode
+ \varphi \chi \psi \omega \varbeta \vartheta \phi \varpi \_relax
+
+\_chardef\_ncharrmA=`A \_chardef\_ncharrma=`a
+\_chardef\_ncharbfA="1D400 \_chardef\_ncharbfa="1D41A
+\_chardef\_ncharitA="1D434 \_chardef\_ncharita="1D44E
+\_chardef\_ncharbiA="1D468 \_chardef\_ncharbia="1D482
+\_chardef\_ncharclA="1D49C \_chardef\_ncharcla="1D4B6
+\_chardef\_ncharbcA="1D4D0 \_chardef\_ncharbca="1D4EA
+\_chardef\_ncharfrA="1D504 \_chardef\_ncharfra="1D51E
+\_chardef\_ncharbrA="1D56C \_chardef\_ncharbra="1D586
+\_chardef\_ncharbbA="1D538 \_chardef\_ncharbba="1D552
+\_chardef\_ncharsnA="1D5A0 \_chardef\_ncharsna="1D5BA
+\_chardef\_ncharbsA="1D5D4 \_chardef\_ncharbsa="1D5EE
+\_chardef\_ncharsiA="1D608 \_chardef\_ncharsia="1D622
+\_chardef\_ncharsxA="1D63C \_chardef\_ncharsxa="1D656
+\_chardef\_ncharttA="1D670 \_chardef\_nchartta="1D68A
+
+\_protected\_def\_rmvariables {\_umathrange{A-Z}\_ncharrmA \_umathrange{a-z}\_ncharrma}
+\_protected\_def\_bfvariables {\_umathrange{A-Z}\_ncharbfA \_umathrange{a-z}\_ncharbfa}
+\_protected\_def\_nitvariables {\_umathrange{A-Z}\_ncharitA \_umathrange{a-z}\_ncharita}
+\_protected\_def\_bivariables {\_umathrange{A-Z}\_ncharbiA \_umathrange{a-z}\_ncharbia}
+\_protected\_def\_calvariables {\_umathrange{A-Z}\_ncharclA \_umathrange{a-z}\_ncharcla}
+\_protected\_def\_bcalvariables {\_umathrange{A-Z}\_ncharbcA \_umathrange{a-z}\_ncharbca}
+\_protected\_def\_frakvariables {\_umathrange{A-Z}\_ncharfrA \_umathrange{a-z}\_ncharfra}
+\_protected\_def\_bfrakvariables {\_umathrange{A-Z}\_ncharbrA \_umathrange{a-z}\_ncharbra}
+\_protected\_def\_bbvariables {\_umathrange{A-Z}\_ncharbbA \_umathrange{a-z}\_ncharbba}
+\_protected\_def\_sansvariables {\_umathrange{A-Z}\_ncharsnA \_umathrange{a-z}\_ncharsna}
+\_protected\_def\_bsansvariables {\_umathrange{A-Z}\_ncharbsA \_umathrange{a-z}\_ncharbsa}
+\_protected\_def\_isansvariables {\_umathrange{A-Z}\_ncharsiA \_umathrange{a-z}\_ncharsia}
+\_protected\_def\_bisansvariables {\_umathrange{A-Z}\_ncharsxA \_umathrange{a-z}\_ncharsxa}
+\_protected\_def\_ttvariables {\_umathrange{A-Z}\_ncharttA \_umathrange{a-z}\_nchartta}
+
+\_chardef\_greekrmA="0391 \_chardef\_greekrma="03B1
+\_chardef\_greekbfA="1D6A8 \_chardef\_greekbfa="1D6C2
+\_chardef\_greekitA="1D6E2 \_chardef\_greekita="1D6FC
+\_chardef\_greekbiA="1D71C \_chardef\_greekbia="1D736
+\_chardef\_greeksnA="1D756 \_chardef\_greeksna="1D770
+\_chardef\_greeksiA="1D790 \_chardef\_greeksia="1D7AA
+
+\_protected\_def\_nitgreek {\_umathrangeGREEK\_greekrmA \_umathrangegreek\_greekita}
+\_protected\_def\_rmgreek {\_umathrangeGREEK\_greekrmA \_umathrangegreek\_greekrma}
+\_protected\_def\_bfgreek {\_umathrangeGREEK\_greekbfA \_umathrangegreek\_greekbfa}
+\_protected\_def\_bigreek {\_umathrangeGREEK\_greekbfA \_umathrangegreek\_greekbia}
+\_protected\_def\_sansgreek {\_umathrangeGREEK\_greeksnA \_umathrangegreek\_greeksna}
+\_protected\_def\_isansgreek {\_umathrangeGREEK\_greeksnA \_umathrangegreek\_greeksia}
+
+% Another possibility (slanted capitals in \_nitgreek, \_bigreek, \_isansgreek):
+%\_protected\_def\_nitgreek {\_umathrangeGREEK\_greekitA \_umathrangegreek\_greekita}
+%\_protected\_def\_rmgreek {\_umathrangeGREEK\_greekrmA \_umathrangegreek\_greekrma}
+%\_protected\_def\_bfgreek {\_umathrangeGREEK\_greekbfA \_umathrangegreek\_greekbfa}
+%\_protected\_def\_bigreek {\_umathrangeGREEK\_greekbiA \_umathrangegreek\_greekbia}
+%\_protected\_def\_sansgreek {\_umathrangeGREEK\_greeksnA \_umathrangegreek\_greeksna}
+%\_protected\_def\_isansgreek {\_umathrangeGREEK\_greeksiA \_umathrangegreek\_greeksia}
+
+\_chardef\_digitrmO=`0
+\_chardef\_digitbfO="1D7CE
+\_chardef\_digitbbO="1D7D8
+\_chardef\_digitsnO="1D7E2
+\_chardef\_digitbsO="1D7EC
+\_chardef\_digitttO="1D7F6
+
+\_protected\_def\_rmdigits {\_umathrange{0-9}\_digitrmO}
+\_protected\_def\_bfdigits {\_umathrange{0-9}\_digitbfO}
+\_protected\_def\_bbdigits {\_umathrange{0-9}\_digitbbO}
+\_protected\_def\_sansdigits {\_umathrange{0-9}\_digitsnO}
+\_protected\_def\_bsansdigits {\_umathrange{0-9}\_digitbsO}
+\_protected\_def\_ttdigits {\_umathrange{0-9}\_digitttO}
+
+\_protected\_def\_inmath#1{\_relax \_ifmmode#1\_fi} % to keep off \loop processing in text mode
% You can redefine these macros to follow your wishes.
% For example you need upgright lowercase greek letters, you don't need
% \bf and \bi behaves as sans serif in math, ...
-\protected\def\rm {\_tryloadrm \_tenrm \inmath{\rmvariables \rmdigits}}
-\protected\def\it {\_tryloadit \_tenit \inmath{\nitvariables}}
-\protected\def\bf {\_tryloadbf \_tenbf \inmath{\bsansvariables \sansgreek \bsansdigits}}
-\protected\def\bi {\_tryloadbi \_tenbi \inmath{\bisansvariables \isansgreek \bsansdigits}}
-\protected\def\tt {\_tryloadtt \_tentt \inmath{\ttvariables \ttdigits}}
-\protected\def\bbchar {\bbvariables \bbdigits}
-\protected\def\cal {\calvariables}
-\protected\def\frak {\frakvariables}
-\protected\def\misans {\isansvariables \isansgreek \sansdigits}
-\protected\def\mbisans {\bisansvariables \isansgreek \bsansdigits}
-\protected\def\script {\rmvariables \fam4 }
+\_protected\_def\_rm {\_tryloadrm \_tenrm \_inmath{\_rmvariables \_rmdigits}}
+\_protected\_def\_it {\_tryloadit \_tenit \_inmath{\_nitvariables}}
+\_protected\_def\_bf {\_tryloadbf \_tenbf \_inmath{\_bsansvariables \_sansgreek \_bsansdigits}}
+\_protected\_def\_bi {\_tryloadbi \_tenbi \_inmath{\_bisansvariables \_isansgreek \_bsansdigits}}
+\_protected\_def\_tt {\_tryloadtt \_tentt \_inmath{\_ttvariables \_ttdigits}}
+\_protected\_def\_bbchar {\_bbvariables \_bbdigits}
+\_protected\_def\_cal {\_calvariables}
+\_protected\_def\_frak {\_frakvariables}
+\_protected\_def\_misans {\_isansvariables \_isansgreek \_sansdigits}
+\_protected\_def\_mbisans {\_bisansvariables \_isansgreek \_bsansdigits}
+\_protected\_def\_script {\_rmvariables \_fam4 }
+
+\_public
+ \rm \it \bf \bi \tt \bbchar \cal \frak \misans \mbisans \script ;
% Math codes:
-\begingroup % \input mathclass.opm (which is a copy of MathClass.txt):
- \def\p#1;#2{\edef\tmp{\pB#2}\ifx\tmp\empty \else\pA#1....\end#2\fi}
- \def\pA#1..#2..#3\end#4{%
- \ifx\relax#2\relax \pset{"#1}{#4}\else
- \umathnumA="#1
- \loop
- \pset{\umathnumA}{#4}%
- \ifnum\umathnumA<"#2 \advance\umathnumA by1
- \repeat
- \fi
+\_begingroup % \input mathclass.opm (which is a copy of MathClass.txt):
+ \_def\_p#1;#2{\_edef\_tmp{\_pB#2}\_ifx\_tmp\_empty \_else\_pA#1....\_end#2\_fi}
+ \_def\_pA#1..#2..#3\_end#4{%
+ \_ifx\_relax#2\_relax \_pset{"#1}{#4}\_else
+ \_umathnumA="#1
+ \_loop
+ \_pset{\_umathnumA}{#4}%
+ \_ifnum\_umathnumA<"#2 \_advance\_umathnumA by1
+ \_repeat
+ \_fi
}
- \def\pB#1{\if#1L1\fi \if#1B2\fi \if#1V2\fi \if#1R3\fi \if#1N0\fi \if#1U0\fi
- \if#1F0\fi \if#1O4\fi \if#1C5\fi \if#1P6\fi \if#1A7\fi}
- \def\pset#1#2{\global\Umathcode#1=\tmp\space 1 #1\relax
- \if#2O\global\Udelcode#1=1 #1\relax\fi
- \if#2C\global\Udelcode#1=1 #1\relax\fi
- \if#2F\global\Udelcode#1=1 #1\relax\fi
+ \_def\_pB#1{\_if#1L1\_fi \_if#1B2\_fi \_if#1V2\_fi \_if#1R3\_fi \_if#1N0\_fi \_if#1U0\_fi
+ \_if#1F0\_fi \_if#1O4\_fi \_if#1C5\_fi \_if#1P6\_fi \_if#1A7\_fi}
+ \_def\_pset#1#2{\_global\_Umathcode#1=\_tmp\_space 1 #1\_relax
+ \_if#2O\_global\_Udelcode#1=1 #1\_relax\_fi
+ \_if#2C\_global\_Udelcode#1=1 #1\_relax\_fi
+ \_if#2F\_global\_Udelcode#1=1 #1\_relax\_fi
}
- \catcode`#=14
- \everypar={\setbox0=\lastbox \par \p}
- \input mathclass.opm
-\endgroup
-
-\begingroup % \input unimath-table.opm (it is a copy of unicode-math-table.tex):
- \def\UnicodeMathSymbol #1#2#3#4{%
- \global\Umathcharnumdef#2=\Umathcodenum#1\relax
- \ifx#3\mathopen \gdef#2{\Udelimiter 4 1 #1 }\fi
- \ifx#3\mathclose \gdef#2{\Udelimiter 5 1 #1 }\fi
- \ifx#3\mathaccent \gdef#2{\Umathaccent fixed 7 1 #1 }\fi
+ \_catcode`#=14
+ \_everypar={\_setbox0=\_lastbox \_par \_p}
+ \_input mathclass.opm
+\_endgroup
+
+\_begingroup % \input unimath-table.opm (it is a copy of unicode-math-table.tex):
+ \_def\UnicodeMathSymbol #1#2#3#4{%
+ \_global\_Umathcharnumdef#2=\_Umathcodenum#1\_relax
+ \_ifx#3\_mathopen \_gdef#2{\_Udelimiter 4 1 #1 }\_fi
+ \_ifx#3\_mathclose \_gdef#2{\_Udelimiter 5 1 #1 }\_fi
+ \_ifx#3\_mathaccent \_gdef#2{\_Umathaccent fixed 7 1 #1 }\_fi
}
- \input unimath-table.opm
-\endgroup
+ \_input unimath-table.opm
+\_endgroup
-\nitgreek \nitvariables \rmdigits % default setting
+\_nitgreek \_nitvariables \_rmdigits % default setting
-\Umathcode `- = 2 1 "2212
-\let\{=\lbrace \let\}=\rbrace
+\_Umathcode `- = 2 1 "2212
+\_let\{=\lbrace \_let\}=\rbrace
-\def\sqrt {\Uradical 1 "0221A }
-\def\cuberoot {\Uradical 1 "0221B }
-\def\fourthroot {\Uradical 1 "0221C }
+\_protected\_def \_sqrt {\_Uradical 1 "0221A }
+\_protected\_def \_cuberoot {\_Uradical 1 "0221B }
+\_protected\_def \_fourthroot {\_Uradical 1 "0221C }
-\def\intwithnolimits#1{\ifx#1\relax \escapechar=`\\ \else \escapechar=-1
- \expandafter\let\csname\string#1op\endcsname=#1%
- \expandafter\def\expandafter#1\expandafter{\csname\string#1op\endcsname \nolimits}%
- \expandafter \intwithnolimits \fi
+\_public \sqrt \cuberoot \fourthroot ;
+
+\_def\_intwithnolimits#1#2 {\_ifx#1\_relax \_else
+ \_ea\_let\_csname\_csstring#1op\_endcsname=#1%
+ \_ea\_def\_ea #1\_ea{\_csname\_csstring#1op\_endcsname \_nolimits}%
+ \_bgroup \_lccode`\~=#2 \_lowercase{\_egroup \_mathcode`~="8000 \_let ~=#1}%
+ \_ea \_intwithnolimits \_fi
}
-\intwithnolimits \int \iint \iiint \oint \oiint \oiiint \intclockwise
- \varointclockwise \ointctrclockwise \sumint \iiiint \intbar \intBar \fint
- \pointint \sqint \intlarhk \intx \intcap \intcup \upint \lowint \relax
-
-\def\vert {\Udelimiter 0 1 "07C }
-\def\Vert {\Udelimiter 0 1 "02016 }
-\def\Vvert {\Udelimiter 0 1 "02980 }
-
-\def\overbrace #1{\mathop {\Umathaccent 7 1 "023DE{#1}}\limits}
-\def\underbrace #1{\mathop {\Umathaccent bottom 7 1 "023DF{#1}}\limits}
-\def\overparen #1{\mathop {\Umathaccent 7 1 "023DC{#1}}\limits}
-\def\underparen #1{\mathop {\Umathaccent bottom 7 1 "023DD{#1}}\limits}
-\def\overbracket #1{\mathop {\Umathaccent 7 1 "023B4{#1}}\limits}
-\def\underbracket #1{\mathop {\Umathaccent bottom 7 1 "023B5{#1}}\limits}
-
-\def\widehat {\Umathaccent 7 1 "00302 }
-\def\widetilde {\Umathaccent 7 1 "00303 }
-\def\overleftharpoon {\Umathaccent 7 1 "020D0 }
-\def\overrightharpoon {\Umathaccent 7 1 "020D1 }
-\def\overleftarrow {\Umathaccent 7 1 "020D6 }
-\def\overrightarrow {\Umathaccent 7 1 "020D7 }
-\def\overleftrightarrow {\Umathaccent 7 1 "020E1 }
+\_intwithnolimits \int "0222B \iint "0222C \iiint "0222D
+ \oint "0222E \oiint "0222F \oiiint "02230
+ \intclockwise "02231 \varointclockwise "02232 \ointctrclockwise "02233
+ \sumint "02A0B \iiiint "02A0C \intbar "02A0D \intBar "02A0E \fint "02A0F
+ \pointint "02A15 \sqint "02A16 \intlarhk "02A17 \intx "02A18
+ \intcap "02A19 \intcup "02A1A \upint "02A1B \lowint "02A1C \_relax "0
+
+\_protected\_def \vert {\_Udelimiter 0 1 "07C }
+\_protected\_def \Vert {\_Udelimiter 0 1 "02016 }
+\_protected\_def \Vvert {\_Udelimiter 0 1 "02980 }
+
+\_protected\_def \_overbrace #1{\mathop {\Umathaccent 7 1 "023DE{#1}}\limits}
+\_protected\_def \_underbrace #1{\mathop {\Umathaccent bottom 7 1 "023DF{#1}}\limits}
+\_protected\_def \_overparen #1{\mathop {\Umathaccent 7 1 "023DC{#1}}\limits}
+\_protected\_def \_underparen #1{\mathop {\Umathaccent bottom 7 1 "023DD{#1}}\limits}
+\_protected\_def \_overbracket #1{\mathop {\Umathaccent 7 1 "023B4{#1}}\limits}
+\_protected\_def \_underbracket #1{\mathop {\Umathaccent bottom 7 1 "023B5{#1}}\limits}
+
+\_public \overbrace \underbrace \overparen \underparen \overbracket \underbracket ;
+
+\_protected\def \widehat {\Umathaccent 7 1 "00302 }
+\_protected\def \widetilde {\Umathaccent 7 1 "00303 }
+\_protected\def \overleftharpoon {\Umathaccent 7 1 "020D0 }
+\_protected\def \overrightharpoon {\Umathaccent 7 1 "020D1 }
+\_protected\def \overleftarrow {\Umathaccent 7 1 "020D6 }
+\_protected\def \overrightarrow {\Umathaccent 7 1 "020D7 }
+\_protected\def \overleftrightarrow {\Umathaccent 7 1 "020E1 }
% corrections:
-\mathchardef\ldotp="612E
-\let\|=\Vert
-
-\let\setminus=\smallsetminus
-\let\diamond=\smwhtdiamond
-\let\bullet=\smblkcircle
-\let\circ=\vysmwhtcircle
-\let\bigcirc=\mdlgwhtcircle
-\let\to=\rightarrow
-\let\le=\leq
-\let\ge=\geq
-\let\neq=\ne
-\protected\def\triangle{\mathord{\bigtriangleup}}
-\let\emptyset=\varnothing
-\let\hbar=\hslash
-\let\land=\wedge
-\let\lor=\vee
-\let\owns=\ni
-\let\gets=\leftarrow
-\let\mathring=\ocirc
-\let\lnot=\neg
-\let\longdivision=\longdivisionsign
-\let\backepsilon=\upbackepsilon
-\let\eth=\matheth
-\let\dbkarow=\dbkarrow
-\let\drbkarow=\drbkarrow
-\let\hksearow=\hksearrow
-\let\hkswarow=\hkswarrow
-
-\let\varepsilon=\epsilon
-\let\upalpha=\mupalpha
-\let\upbeta=\mupbeta
-\let\upgamma=\mupgamma
-\let\updelta=\mupdelta
-\let\upepsilon=\mupvarepsilon
-\let\upvarepsilon=\mupvarepsilon
-\let\upzeta=\mupzeta
-\let\upeta=\mupeta
-\let\uptheta=\muptheta
-\let\upiota=\mupiota
-\let\upkappa=\mupkappa
-\let\uplambda=\muplambda
-\let\upmu=\mupmu
-\let\upnu=\mupnu
-\let\upxi=\mupxi
-\let\upomicron=\mupomicron
-\let\uppi=\muppi
-\let\uprho=\muprho
-\let\upvarrho=\mupvarrho
-\let\upvarsigma=\mupvarsigma
-\let\upsigma=\mupsigma
-\let\uptau=\muptau
-\let\upupsilon=\mupupsilon
-\let\upvarphi=\mupvarphi
-\let\upchi=\mupchi
-\let\uppsi=\muppsi
-\let\upomega=\mupomega
-\let\upvartheta=\mupvartheta
-\let\upphi=\mupphi
-\let\upvarpi=\mupvarpi
-
-\protected\def\not#1{%
- \expandafter\ifx \csname not!\string#1\endcsname \relax
- \mathrel{\mathord{\rlap{\kern1pt/}}\mathord{#1}}%
- \else \csname not!\string#1\endcsname
- \fi
+\_mathchardef\ldotp="612E
+\_let\|=\Vert
+
+\_let \setminus=\smallsetminus
+\_let \diamond=\smwhtdiamond
+\_let \bullet=\smblkcircle
+\_let \circ=\vysmwhtcircle
+\_let \bigcirc=\mdlgwhtcircle
+\_let \to=\rightarrow
+\_let \le=\leq
+\_let \ge=\geq
+\_let \neq=\ne
+\_protected\_def \triangle {\mathord{\bigtriangleup}}
+\_let \emptyset=\varnothing
+\_let \hbar=\hslash
+\_let \land=\wedge
+\_let \lor=\vee
+\_let \owns=\ni
+\_let \gets=\leftarrow
+\_let \mathring=\ocirc
+\_let \lnot=\neg
+\_let \longdivision=\longdivisionsign
+\_let \backepsilon=\upbackepsilon
+\_let \eth=\matheth
+\_let \dbkarow=\dbkarrow
+\_let \drbkarow=\drbkarrow
+\_let \hksearow=\hksearrow
+\_let \hkswarow=\hkswarrow
+
+\_let \varepsilon=\epsilon
+\_let \upalpha=\mupalpha
+\_let \upbeta=\mupbeta
+\_let \upgamma=\mupgamma
+\_let \updelta=\mupdelta
+\_let \upepsilon=\mupvarepsilon
+\_let \upvarepsilon=\mupvarepsilon
+\_let \upzeta=\mupzeta
+\_let \upeta=\mupeta
+\_let \uptheta=\muptheta
+\_let \upiota=\mupiota
+\_let \upkappa=\mupkappa
+\_let \uplambda=\muplambda
+\_let \upmu=\mupmu
+\_let \upnu=\mupnu
+\_let \upxi=\mupxi
+\_let \upomicron=\mupomicron
+\_let \uppi=\muppi
+\_let \uprho=\muprho
+\_let \upvarrho=\mupvarrho
+\_let \upvarsigma=\mupvarsigma
+\_let \upsigma=\mupsigma
+\_let \uptau=\muptau
+\_let \upupsilon=\mupupsilon
+\_let \upvarphi=\mupvarphi
+\_let \upchi=\mupchi
+\_let \uppsi=\muppsi
+\_let \upomega=\mupomega
+\_let \upvartheta=\mupvartheta
+\_let \upphi=\mupphi
+\_let \upvarpi=\mupvarpi
+
+\_protected\_def\_not#1{%
+ \_ifcsname _not!\_csstring#1\_endcsname \_csname _not!\_csstring#1\_endcsname
+ \_else \_mathrel{\_mathord{\_rlap{\_kern1pt/}}\_mathord{#1}}%
+ \_fi
}
-\def\negationof#1#2{\expandafter\let \csname not!\string#1\endcsname =#2}
-\negationof = \neq
-\negationof < \nless
-\negationof > \ngtr
-\negationof \gets \nleftarrow
-\negationof \simeq \nsime
-\negationof \equal \ne
-\negationof \le \nleq
-\negationof \ge \ngeq
-\negationof \greater \ngtr
-\negationof \forksnot \forks
-\negationof \in \notin
+\_def\_negationof #1#2{\_ea\_let \_csname _not!\_csstring#1\_endcsname =#2}
+\_negationof = \neq
+\_negationof < \nless
+\_negationof > \ngtr
+\_negationof \gets \nleftarrow
+\_negationof \simeq \nsime
+\_negationof \equal \ne
+\_negationof \le \nleq
+\_negationof \ge \ngeq
+\_negationof \greater \ngtr
+\_negationof \forksnot \forks
+\_negationof \in \notin
+
+\_public \not ;
% we need no more 8bit math fonts
\mathcode`\_="8000
-\mathcode`\∫="8000
-{\catcode`\∫=13 \_ea}\_ea \_let \_noexpand ∫ = \int
\_private
\ldotp \cdotp \triangleleft \trianglerigt \mapstochar \rightarrow \prime
@@ -265,9 +275,6 @@
\longrightarrow \Longleftrightarrow \vdots \ddots ;
-\def\boldmath{\pdfliteral direct {2 Tr .3 w}\aftergroup\noboldmath}
-\def\noboldmath{\pdfliteral direct {0 Tr 0 w}} % faked bold only :-(
-
\_endcode
--------------------------------------------
@@ -282,20 +289,12 @@ accepts only codes less than 255.
See http://tex.stackexchange.com/questions/308749/ for more technical details.
-The poor bold is used for complete bold vaiant of the font. If the selected
-font has its bold vaiant (like xits-math), you can re-define \boldmath macro
-by:
-
-\def\boldmath{%
- \loadumathfamily 1 {[xitsmath-bold]}{} % Base font
- \loadmathfamily 4 rsfs % script
- \setmathdimens
-}
+-----
XITSmath-bold needs correction: the norm symbol ||x|| is missing here. So, you
can define:
-\def\boldmath{%
+\def\_boldmath{%
\loadumathfamily 1 {[xitsmath-bold]}{} % Base font
\loadmathfamily 4 rsfs % script
\loadumathfamily 5 {[xitsmath-regular]}{}
diff --git a/Master/texmf-dist/tex/luatex/optex/verbatim.opm b/Master/texmf-dist/tex/luatex/optex/verbatim.opm
index acc7922a8da..121ec0698e6 100644
--- a/Master/texmf-dist/tex/luatex/optex/verbatim.opm
+++ b/Master/texmf-dist/tex/luatex/optex/verbatim.opm
@@ -2,21 +2,31 @@
\_codedecl \begtt {Verbatim <2020-02-14>}
-\_newdimen\_ttindent \_ttindent=\_parindent
- % indentation in \begtt...\endtt and \verbinput
-\_def\_ttskip{\medskip} % space above and below \begtt, \verbinput
-\_mathchardef\_ttpenalty=100 % penalty between lines in \begtt, \verbinput
+%> parameters
+
+\_newdimen\_ttindent \_ttindent=\_parindent % indentation in \begtt...\endtt and \verbinput
+\_def\_ttskip{\_medskip} % space above and below \begtt, \verbinput
+\_mathchardef\_ttpenalty=100 % penalty between lines in \begtt, \verbinput
+
+\_newcount\_ttline \_ttline=-1 % last line number in \begtt...\endtt
+\_newcount\_viline % last line number in \verbinput
+\_newread\_vifile % file fgiven by \verinput
+\_newtoks\_tthook % tokens procesed in \begtt...\endtt
+\_newtoks\_intthook % toens procesed in \code or in `...`
+
+\_public \ttline \tthook \intthook ;
+
+%> \code
\_def\_code#1{\_unexpanded\_ea{\_csname _code \_endcsname{#1}}}
-\_protected\_sdef{_code }#1{{\_escapechar=-1 \_ea}%
- \_ea\_printinverbatim\_ea{\_detokenize{#1}}}
-\_def\_printinverbatim#1{\_leavevmode\_hbox{\_tt \_the\_intthook\_relax #1}}
+\_protected\_sdef{_code }#1{{\_escapechar=-1 \_tt \_the\_intthook \_relax
+ \_ea\_printinverbatim\_ea{\_detokenize{#1}}}}
+\_def\_printinverbatim#1{\_leavevmode\_hbox{#1}}
+\_toksapp \_pdfstringout{\_let\code=\_detokenize \_let\_code=\_detokenize}
\_public \code ;
-\_newcount\_ttline \_ttline=-1
-\_newcount\_viline
-\_newread\_vifile
+%> \_setverb
\_newcatcodetable \_verbatimcatcodes
\_def\_setverb{\_begingroup
@@ -28,45 +38,49 @@
\_setverb
\_def\_setverb{\_catcodetable\_verbatimcatcodes }%
-% \begtt ... \endtt
-
-\_eoldef \_begtt #1{%
- \_par \_vskip\_parskip \_ttskip \_bgroup \_wipeepar
- \_setverb \_adef{ }{\ }%
- \_parindent=\_ttindent \_parskip=0pt
- \_the\_tthook #1%
- \_ifnum\_ttline<0 \_else
- \_tenrm \_thefontscale[700]\_ea\_let\_ea\_sevenrm\_the\_font
- \_toksapp\_everypar{\_global\_advance\_ttline by1 \_printttline}\_fi
- \_def\par##1{\_endgraf\_ifx##1\_egroup\_else\_penalty\_ttpenalty\_leavevmode\_fi ##1}%
- \_obeylines \_startverb}
-
-\_catcode`\|=0 \_catcode`\\=12
- |_def|_startverb#1\endtt{|_tt|_the|_ptthook#1|_endtt}
-|_normalcatcodes
-
-\def\_endtt{\_egroup\_par\_ttskip\_testparA}
-\_def\_testparA{\_ea\_testparB\_romannumeral-`\.}
-\_def\_testparB{\_futurelet\_tmpa\_testparC}
-\_def\_testparC{\_ifx\_tmpa\_par\_else\afternoindent\_fi}
-
-\_def\_printttline{\_llap{\_sevenrm\_the\_ttline\_kern.9em}}
-
-\_newtoks\_tthook
-\_newtoks\_ptthook
-\_newtoks\_intthook
+%> \activettchar
\_def\_activettchar#1{%
\_ifx\_savedttchar\_undefined\_else \_catcode\_savedttchar=\_savedttcharc \_fi
- \_chardef\_savedttchar=`#1%
- \_chardef\_savedttcharc=\_catcode`#1%
- \_adef{#1}{{\_setverb\_adef{ }{\ }\_catcode`#1=13 \_ea}\_readverb}%
- \_bgroup\_lccode`\~=`#1\_lowercase{\_egroup\_def\_readverb ##1~}{\_printinverbatim{##1}}%
- \_catcode`#1=13
+ \_chardef\_savedttchar=`#1
+ \_chardef\_savedttcharc=\_catcode`#1
+ \_adef{#1}{\_begingroup \_setverb \_adef{ }{\ }\_tt \_the\_intthook\_relax \_readverb}%
+ \_def\_readverb ##1#1{\_printinverbatim{##1}\_endgroup}%
}
+\_public \activettchar ;
-\_newcount\_viline
-\_newread\_vifile
+%> \begtt ... \endtt
+
+\_eoldef \begtt#1{\_par \_wipeepar
+ \_begingroup
+ \_vskip\_parskip \_ttskip
+ \_setverb
+ \_ifnum\_ttline<0 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi
+ \_adef{ }{\ }\_parindent=\_ttindent \_parskip=0pt
+ \_the\_tthook #1\_relax \_tt
+ \_endlinechar=`^^J
+ \_startverb
+}
+\_ea\_def\_ea\_startverb \_ea#\ea1\_csstring\\endtt#2^^J{%
+ \_prepareverbdata\_tmpb{#1^^J}%
+ \_ea\_printverb \_tmpb\_end
+ \_par\_ttskip
+ \_endgroup
+ \_noindent \_setbox0=\_lastbox
+}
+\_def\_printverb #1^^J#2{\_ifx\_end#2
+ \_bgroup \_adef{ }{}\_if\_relax#1\_relax\_egroup \_else\_egroup \_printverbline{#1}\_fi
+ \_else
+ \_printverbline{#1}%
+ \_ea \_printverb \_ea #2%
+ \_fi
+}
+\_def\_prepareverbdata#1#2{\_def#1{#2}}
+\_def\_printverbline#1{\_penalty \_ttpenalty \_indent \_printverblinenum #1 \par}
+\_def\_initverblinenum{\_tenrm \_thefontscale[700]\_ea\_let\_ea\_sevenrm\_the\_font}
+\_def\_printverblinenum{\_global\_advance\_ttline by1 \_llap{\_sevenrm \_the\_ttline\_kern.9em}}
+
+%> \verbinput
\_def\_verbinput (#1) #2 {\_par \_def\_tmpa{#2}%
\_ifx\_vifilename\_tmpa \_else
@@ -114,76 +128,145 @@
\_else
\_edef\_vinolines{\_the\_tmpnum}%
\_fi
- \_vskip\_parskip \_ttskip \_bgroup \_wipeepar
- \_setverb \_adef{ }{\ }%
- \_ifx\_savedttchar\_undefined \_else \_catcode\_savedttchar=12 \_fi
- \_parindent=\_ttindent \_parskip=0pt
- \_the\_tthook\_relax
- \_ifnum\_ttline<-1 \_else
- \_tenrm \_thefontscale[700]\_ea\_let\_ea\_sevenrm\_the\_font
- \_everypar\_ea{\_the\_everypar \_glob\_advance\_ttline by1 \_printttline}\_fi
- \_def\par##1{\_endgraf\_ifx##1\_egroup\_else\_penalty\_ttpenalty\_leavevmode\_fi ##1}%
- \_obeylines \_tmpnum=0 \_lccode`\~=`\^^M \_lowercase{\_def\_tmpb{~}}%
+ \_vskip\_parskip \_ttskip \_wipeepar
+ \_begingroup
+ \_ifnum\_ttline<-1 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi
+ \_setverb \_adef{ }{\ }\_parindent=\_ttindent \_parskip=0pt
+ \_the\_tthook\_relax \_tt
+ \_endlinechar=`^^J \_tmpnum=0
\_loop \_ifeof\_vifile \_tmpnum=\_vinolines\_space \_fi
\_ifnum\_tmpnum<\_vinolines\_space
- \_vireadline \_advance\_tmpnum by1 \_repeat %% skip line
- \_ifnum\_ttline=-1 \_ttline=\_viline \_let\_glob=\_relax \_else\_let\_glob=\_global \_fi
- \_tmpnum=0 \_ifnum\_vidolines=0 \_tmpnum=-1 \_fi
+ \_vireadline \_advance\_tmpnum by1 \_repeat %% skip lines
+ \_edef\_ttlinesave{\_ttline=\_the\_ttline}%
+ \_ifnum\_ttline=-1 \_ttline=\_viline \_fi
+ \_tmpnum=0 \_def\_tmpb{}%
+ \_ifnum\_vidolines=0 \_tmpnum=-1 \_fi
\_ifeof\_vifile \_tmpnum=\_vidolines\_space \_fi
\_loop \_ifnum\_tmpnum<\_vidolines\_space
\_vireadline
- \_ifeof\_vifile \_tmpnum=\_vidolines\_space \_else \_viprintline \_fi %% print line
- \_ifnum\_vidolines=0 \_else\_advance\_tmpnum by1 \_fi
+ \_ifnum\_vidolines=0 \_else\_advance\_tmpnum by1 \_fi
+ \_ifeof\_vifile \_tmpnum=\_vidolines\_space \_else \_visaveline \_fi %% save line
\_repeat
- \_tt\_ea\_the\_ea\_ptthook\_tmpb\_egroup\_par\_ttskip\_testparA
+ \_ea\_prepareverbdata \_ea \_tmpb\_ea{\_tmpb^^J}%
+ \_ea\_printverb \_tmpb\_end
+ \_global\_ttlinesave
+ \_par\_ttskip
+ \_endgroup
+ \_noindent \_setbox0=\_lastbox
}
\_def\_vireadline{\_read\_vifile to \_tmp \_global\_advance\_viline by1 }
-\_def\_viprintline{\_ea\_addto\_ea\_tmpb\_ea{\_tmp}}
+\_def\_visaveline{\_ea\_addto\_ea\_tmpb\_ea{\_tmp}}
\_public
- \begtt \activettchar \tthook \ptthook \intthook \verbinput ;
-
+ \verbinput ;
\_endcode %---------------------------------------
-`\code{text}` is a macro which writes verbatim-like inline text and it is
-robust to use it in parameters of macros or section names etc. User have to
-escape the following characters: percent, hash mark, escape, space (if there
-are more than one consecutive spaces) and `{`, `}` (if these braces are
-unbalanced in the `\code` parameter). For example
+\secc Implementation notes
-\begtt
- \code{\\text, \%\#} ... \text, %#
- \code{@{..}*&^$ $} ... prints the same without escaping, but you can
- escape these characters too, if you want.
- \code{a \ b} ... two spaces between a b, the second one must be escaped
- \code{xy\{z} ... unbalanced brace must be escaped
-\endtt
+\%> parameters
-If you set a character as `\activettchar` then it can be used as boundary
-character of inline code. The text betweent these boundary characters are
-printed without any change. For example
-\code{\`}`\print % whatever #&`\code{\`} does `\print % whatever #&`
-if `\activettchar`\code{\`} was declared.
+The parameters for verbatim macros are set. `\ttline` is set to $-1$ by
+default, so `\begtt...\endtt` are not numbered but `\verbinput` are with
+numbers.
-But this in/line verbatim text cannot be used inside parameters of
-macros, for example inside section names. Use `\code` in such situation.
+\%> \code
+`\code{<text>}` expands to `\detokenize{<text>}` when `\escapechar=-1`. In
+order to do it more robust when it is used in `\write` then it expands as
+noexpanded `\code<space>` (followed by space in its csname). This macro doew
+really the work.
-\secc Implementation notes
+The `\_printinverbatim{<text>}` macro is used for `\code{<text>}` printing and for
+\code{`}<text>\code{`} printing. It is defined as `\_hbox`, so the in-verbatim <text>
+will be never broken. But you can re-define this macro.
+
+When `\code` occurs in PDF outlines then it does the same as `\detokenize`.
+The macro for preparing outlines sets `\escapechar` to $-1$ and uses
+\_pdftringout` token list before `\edef`.
+
+The `\code` is not `\_proteced` because we want that it expands to
+`\_unexpanded{\code<space>{<text>}` in `\write` parameters. This protect the
+expansions of the `\code` parameter (like `\\`, `\^` etc.).
+
+\%> \_setverb
+
+The `\_setverb` macro sets all catcodes to \"verbatim mode". It should be used only
+in a group, so we prepare a new catcode table with \"verbatim" catcodes and we define
+it as `\_catcodetable\_verbatimcatcodes`. After the group is finished then
+original catcode table is restored.
+
+\%> \activettchar
-If the code is used in non-detokenized `\write` parameter, we must to
-`detokenize` its parameter and write `\code` as prefix again. The second
-(internal) `\code` is a macro with the name followed by a space. So
+This macro saves original catcode of previously declared `\catcodettchar` (if
+such character was decalred) from `\_savedttchar` and `\_savedttcharc`
+values. Then new such values are stored. The declared charater is activated
+by `\_adef` as a macro (active character) which opens a group,
+does `\_setverb` and other settings and reads its parameter until second the same
+character. This is done by `\_readverb` macro. Finally it prints scanned
+<text> by `\_printinverbatim` and closes group. Suppose that `\activettchar"` is
+used. Then the following work is schematically done:
\begtt
- \code{\\aha\%} ... writes: \code {\\aha\%} into workong file.
+\_def "{\_begingroup \_setverb ... \_readverb}
+\_def \_readverb #1"{\_printinverbatim{#1}\_endgroup}
\endtt
+%
+Note that the second occurence of `"` is not active because `\_setverb`
+deactivates it.
+
+\%> \begtt ... \endtt
+
+`\begtt` id defined only as public. We don't need private `\_begtt` variant.
+This macro os defined by `\eoldef`, sot user can put an parameter at the
+same line where `\begtt` is. This `#1` parameter is used after globap
+parameters settings, so user can change it locally.
+
+The `\begtt` macro opens group, does `\_setverb` and another preprocessing, sets
+`\endlinechar` to `^^J` and reads the following text in verbatim mode
+until `\endtt` occurs. This scanning is done by `\_startverb` macro which is
+edfined as:
+
+\begtt
+\_def\_startverb #1\endtt #2^^J{...}
+\endtt
+%
+We must to ensure that the backslash in `\endtt` has category 12 (this is a
+reason of the `\ea` chain in real code).
+The `#2` is something between `\endtt` and end of line and it is simply
+ignored.
+
+The `\startverb` puts the scanned data to `\_prepareverbdata`. It sets the data
+to `\_tmpb` without changes by default, but you should re-define it in order
+to does s special changes (for example colorization of the code), if you
+want. The scanned data have `^^J` at each end of line and all spaces are
+active characters. Other characters have nomal category 11 or 12.
+
+When `\prepareverbdata` finishes then `\startverb` runs `\_printverb` loop
+over aech line of the data and does a final work: last skip plus `\noindent`
+without first indentation box. This trick keeps horizontal mode without
+indentation when the empty line after `\endtt` does not exists. But it stops
+horizontal mode without any new box in outer vertical mode if `\par` is
+processed immediately after `\endtt`.
+
+The `\_printverb` macro calls `\_printverbline{<line>}` to each scanned line of
+verbatim text. This macro expect that it strarts in vertical mode ant it must
+do `\par` in order to return the vertical mode. The `\_printverblinenum`
+is used here: it does nothing when `\_ttline<0` else it prints the line
+number using `\_llap`.
-This can be read again without any chnge of meaning of the parameter (the
-second space after `\code` sequence will be ingnored).
+\%> \verbinput
-If the `\code` is used in normal horizontal mode, then escape characters are
-ignored using `\ecsapechar=-1 \detokenize`.
+Macro `\verbinput` uses a file read perviously or opens the given file. Then
+it runss the parameter scanning by `\_viscanparameter` and `\_viscanminus`.
+Finally the `\_doverbinput` is run. At begining of `\_doverbinput` we have
+`\_viline`= number of lines already read using previous `\verbinput`,
+`\_vinolines`= the number of lines we need to skip and `\_vidolnes`= the
+number of lines we need to print.
+After group is opened then similar preparation is done as in `\begtt`. Then
+we skip `\_nolines` lines in a loop a and we read `\_dolines` lines. The
+read data is accumulated into `\_tmpb` macro. The next steps are equal to
+the steps done in `\_startverb` macro: data are processed via
+`\_prepareverbdata` and printed via `\_printverb` loop.