diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/optex/base/basic-macros.opm | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/doc.opm | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/fnotes.opm | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/fonts-select.opm | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/hyperlinks.opm | 24 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/languages.opm | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/multicolumns.opm | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/optex.ini | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/optex.lua | 9 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/others.opm | 80 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/plain-macros.opm | 27 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/prefixed.opm | 10 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/references.opm | 46 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/sections.opm | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/styles.opm | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/unimath-codes.opm | 8 | ||||
-rw-r--r-- | Master/texmf-dist/tex/optex/base/verbatim.opm | 2 |
17 files changed, 180 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/optex/base/basic-macros.opm b/Master/texmf-dist/tex/optex/base/basic-macros.opm index 912be5e0364..2e8c98d6e3e 100644 --- a/Master/texmf-dist/tex/optex/base/basic-macros.opm +++ b/Master/texmf-dist/tex/optex/base/basic-macros.opm @@ -106,7 +106,7 @@ \_cod ------------------------------ \_def\_loggingall{\_tracingcommands=3 \_tracingstats=2 \_tracingpages=1 - \_tracingoutput=1 \_tracinglostchars=1 \_tracingmacros=3 + \_tracingoutput=1 \_tracingmacros=3 % \_tracinglostchars=2 is already set \_tracingparagraphs=1 \_tracingrestores=1 \_tracingscantokens=1 \_tracingifs=1 \_tracinggroups=1 \_tracingassigns=1 } \_def\_tracingall{\_tracingonline=1 \_loggingall} diff --git a/Master/texmf-dist/tex/optex/base/doc.opm b/Master/texmf-dist/tex/optex/base/doc.opm index 34a00dc1e97..cb2b976e7c5 100644 --- a/Master/texmf-dist/tex/optex/base/doc.opm +++ b/Master/texmf-dist/tex/optex/base/doc.opm @@ -134,7 +134,7 @@ \_ifx\_printfilename\_relax \_penalty \_ttpenalty \_fi \_vskip-4pt \_noindent\_rlap{\Yellow \_vrule height8pt depth5pt width\_hsize}% \_printfilename - \_indent \_printverblinenum #1\par} + \_indent \_printverblinenum #1\_par} \_def\_printfilename{\_hbox to0pt{% \_hskip\_hsize\_vbox to0pt{\_vss\_llap{\Brown\docfile}\_kern7.5pt}\_hss}% diff --git a/Master/texmf-dist/tex/optex/base/fnotes.opm b/Master/texmf-dist/tex/optex/base/fnotes.opm index 62912d04001..661d54c33f2 100644 --- a/Master/texmf-dist/tex/optex/base/fnotes.opm +++ b/Master/texmf-dist/tex/optex/base/fnotes.opm @@ -129,12 +129,13 @@ The \`\_mnoteD``{<text>}` macro sets the position of the marginal note. The outer box of marginal note has zero width and zero depth and it is appended after current line using `\vadjust` primitive or it is inverted to vertical mode - as a box with `\vskip-\baselineskip` followed. + as a box shifted down by `\parskip` and with `\vskip-\baselineskip` followed. \_cod ----------------------------- \_def\_mnote #1#{\_ifx^#1^\_else \_mnoteC#1\_end \_fi \_mnoteD} \_def\_mnoteC up#1\_end{\_mnoteskip=#1\_relax} % \mnote up<dimen> {<text>} syntax -\_long\_def\_mnoteD#1{\_ifvmode {\_mnoteA{#1}}\_nobreak\_vskip-\_baselineskip \_else +\_long\_def\_mnoteD#1{% + \_ifvmode \_vskip\_parskip{\_mnoteA{#1}}\_nobreak\_vskip-\_baselineskip\_vskip-\_parskip \_else \_lower\_dp\_strutbox\_hbox{}\_vadjust{\_kern-\_dp\_strutbox \_mnoteA{#1}\_kern\_dp\_strutbox}% \_fi } diff --git a/Master/texmf-dist/tex/optex/base/fonts-select.opm b/Master/texmf-dist/tex/optex/base/fonts-select.opm index 355a71a1913..d8d3982ba62 100644 --- a/Master/texmf-dist/tex/optex/base/fonts-select.opm +++ b/Master/texmf-dist/tex/optex/base/fonts-select.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \fontfam {Fonts selection system <2021-07-16>} % preloaded in format +\_codedecl \fontfam {Fonts selection system <2021-09-24>} % preloaded in format \_doc ----------------------------- The variant selectors \^`\rm`, \^`\bf`, \^`\it`, \^`\bi`, \^`\tt` @@ -175,7 +175,7 @@ \_cod ----------------------------- \_def\_famdecl [#1]#2#3#4#5#6#7#8{% - \_initunifonts \_uniaccents + \_initunifonts \_unichars \_uniaccents \_unless\_ifcsname _f:\_csstring#2:main.fam\_endcsname \_isfont{#7}\_iffalse \_opwarning{Family [#1] skipped, font "#7" not found}\_ea\_ea\_ea\_endinput \_else @@ -1011,6 +1011,7 @@ Luaotfload documentation for more information. \endinput +2021-09-24 \_unichars used in \initunifonts 2021-07-16 \initunifonts: optex_hook_into_luaotfload added. 2021-05-23 concept of \_fontfeatures macro re-implemented 2021-05-02 simpler \_resizefont, better concept of doc, moving parts from fonts-resize diff --git a/Master/texmf-dist/tex/optex/base/hyperlinks.opm b/Master/texmf-dist/tex/optex/base/hyperlinks.opm index ef205f3aa23..4c2007cddb8 100644 --- a/Master/texmf-dist/tex/optex/base/hyperlinks.opm +++ b/Master/texmf-dist/tex/optex/base/hyperlinks.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \ulink {Hyperlinks <2021-05-14>} % preloaded in format +\_codedecl \ulink {Hyperlinks <2021-08-31>} % preloaded in format \_doc ---------------------------- \`\dest``[<type>:<spec>]` creates a destination of internal links. The @@ -27,19 +27,19 @@ \_doc ---------------------------- Each hyperlink is created internally by \`\_xlink``{<type>}{<spec>}{<color>}{<text>}`. This macro expands to `\_quitvmode{<text>}` by default, i.e.\ no active - hyperlink is created, only <text> is printed in horizontal mode. - If \^`\hyperlinks` is used, then `\_xlink` gets meaning of - \`\_xlinkactive` and hyperlinks are created using `\pdfstartlink`, + hyperlink is created, only <text> is printed in horizontal mode (and in a group). + If \^`\hyperlinks` is used, then `\_xlink` gets the meaning of + \`\_xlinkactive` and hyperlinks are created by the `\pdfstartlink`/% `\pdfendlink` primitives. The <text> has given <color> only when - hyperlink is created. But if `\_<type>linkcolor` is defined, it has - precedence. + hyperlink is created. If `\_<type>linkcolor` is defined, it has + precedence over <color>. \nl The \`\_linkdimens` macro declares the dimensions of link area. \nl A specific action can be defined for each link <type> by the macro `\_<type>action{<spec>}`. \OpTeX/ defines only \`\_urlaction``{<url>}`. The default link action (when `\_<type>action` is not defined) is - `goto mame{<type>:<spec>}` (creates an internal link). It is declared in the + `goto name{<type>:<spec>}` (an internal link). It is declared in the \`\_linkactions``{<type>}{<spec>}` macro. \nl The `\_pdfstartlink` primitive uses `attr{\_pdfborder{<type>}}`. The @@ -91,14 +91,15 @@ \_public \ilink \ulink \link ; \_doc ---------------------------- - \`\hyperlinks``{<ilink_color>}{<ulink_color>}` activates `\dest`, `\xlink`, - in order they create links. + \`\hyperlinks``<ilink color><ulink color>` activates `\dest`, `\xlink`, + so that they create links. Not setting colors (`\hyperlinks{}{}`) is also + supported. \_cod ---------------------------- \_def\_hyperlinks#1#2{% \_let\_dest=\_destactive \_let\_xlink=\_xlinkactive - \_let\_ilinkcolor=#1% - \_let\_elinkcolor=#2% + \_let\_ilinkcolor=#1\_empty + \_let\_elinkcolor=#2\_empty \_public \dest \xlink ;% } \_public \hyperlinks ; @@ -201,6 +202,7 @@ Another example `\def\_tocborder{1 0 0}` causes red frames in TOC \_endinput +2021-08-31 \hyperlinks{}{} allowed, bug fixed 2021-05-14 \_xlink introduced, \link, \ilink, \ulink re-implemented. 2021-05-12 \url: triplet :// instead //, \_urlslashslash removed. 2021-05-11 \url reimplemented, \_urlxskip added. diff --git a/Master/texmf-dist/tex/optex/base/languages.opm b/Master/texmf-dist/tex/optex/base/languages.opm index 19b1813edd8..26e0c626288 100644 --- a/Master/texmf-dist/tex/optex/base/languages.opm +++ b/Master/texmf-dist/tex/optex/base/languages.opm @@ -37,7 +37,7 @@ \_langw cs Kapitola Tabulka Obrázek Věc \_langw de Kapitel Tabelle Abbildung Betreff \_langw es Capítulo Tabla Figura Sujeto -\_langw fr Chaptire Tableau Figure Matière +\_langw fr Chapitre Tableau Figure Matière \_langw it Capitolo Tabella Fig. Oggetto \_langw pl Rozdział Tabela Ilustracja Temat \_langw gr Κεφάλαιο Πίνακας Σχήμα θέμα diff --git a/Master/texmf-dist/tex/optex/base/multicolumns.opm b/Master/texmf-dist/tex/optex/base/multicolumns.opm index 1a32db62b7b..f0489630431 100644 --- a/Master/texmf-dist/tex/optex/base/multicolumns.opm +++ b/Master/texmf-dist/tex/optex/base/multicolumns.opm @@ -31,7 +31,7 @@ \_advance\_hsize by\_colsep \_divide\_hsize by\_Ncols \_advance\_hsize by-\_colsep \_mullines=0 - \_def\par{\_ifhmode\_endgraf\_global\_advance\_mullines by\_prevgraf\_fi}% + \_def\_par{\_ifhmode\_endgraf\_global\_advance\_mullines by\_prevgraf\_fi}% } \_def\_endmulti{\_vskip-\_prevdepth\_vfil \_ea\_egroup\_ea\_egroup\_ea\_baselineskip\_the\_baselineskip\_relax diff --git a/Master/texmf-dist/tex/optex/base/optex.ini b/Master/texmf-dist/tex/optex/base/optex.ini index e51a8824df3..4ccc482d8fa 100644 --- a/Master/texmf-dist/tex/optex/base/optex.ini +++ b/Master/texmf-dist/tex/optex/base/optex.ini @@ -21,7 +21,7 @@ % OpTeX version -\def\optexversion{1.04 Aug.2021} +\def\optexversion{1.05 Jan.2022} \def\fmtname{OpTeX} \let\fmtversion=\optexversion diff --git a/Master/texmf-dist/tex/optex/base/optex.lua b/Master/texmf-dist/tex/optex/base/optex.lua index 5114ea21e98..19eeb6328b3 100644 --- a/Master/texmf-dist/tex/optex/base/optex.lua +++ b/Master/texmf-dist/tex/optex/base/optex.lua @@ -419,12 +419,17 @@ end, "_tracingmacros") -- inject PDF literals according to attributes. -- local node_id = node.id +local node_subtype = node.subtype local glyph_id = node_id("glyph") local rule_id = node_id("rule") local glue_id = node_id("glue") local hlist_id = node_id("hlist") local vlist_id = node_id("vlist") local disc_id = node_id("disc") +local whatsit_id = node_id("whatsit") +local pdfliteral_id = node_subtype("pdf_literal") +local pdfsave_id = node_subtype("pdf_save") +local pdfrestore_id = node_subtype("pdf_restore") local token_getmacro = token.get_macro local direct = node.direct @@ -517,6 +522,10 @@ local function is_color_needed(head, n, id, subtype) -- returns non-stroke, stro return true, true end return true, false + elseif id == whatsit_id and (subtype == pdfliteral_id + or subtype == pdfsave_id + or subtype == pdfrestore_id) then + return true, true end return false, false end diff --git a/Master/texmf-dist/tex/optex/base/others.opm b/Master/texmf-dist/tex/optex/base/others.opm index a6dc2064eb4..0c9f4cae6a0 100644 --- a/Master/texmf-dist/tex/optex/base/others.opm +++ b/Master/texmf-dist/tex/optex/base/others.opm @@ -80,15 +80,15 @@ usages of `\lipsum` are fully expandable. If you want to have all printings of `\lipsum` expandable, use dummy `\lipsum[0]` first. - `\lipsum` adds `\par` after each printed paragraph. If you don't need - such `\par` here, use \`\lipsumtext``[<number>]`. - This macro prints only one selected paragraph <number> and does not add `\par`. + `\lipsum` adds `\_par` after each printed paragraph. If you don't need + such `\_par` here, use \`\lipsumtext``[<number>]`. + This macro prints only one selected paragraph <number> and does not add `\_par`. \_cod ---------------------------- \_def\_lipsumtext[#1]{\_lipsumload\_cs{_lip:#1}} \_def\_lipsum[#1]{\_lipsumA #1\_empty-\_empty\_end} \_def\_lipsumA #1-#2\_empty#3\_end{% - \_fornum #1..\_ifx^#2^#1\_else#2\_fi \_do {\_lipsumtext[##1]\par}} + \_fornum #1..\_ifx^#2^#1\_else#2\_fi \_do {\_lipsumtext[##1]\_par}} \_def\_lipsumload{{% \_setbox0=\_vbox{\_tmpnum=0 % vertical mode during \input lipsum.ltd.tex \_def\ProvidesFile##1[##2]{}% @@ -100,6 +100,78 @@ \_public \lipsum \lipsumtext ; \_let \lorem=\lipsum + \_doc ----------------------------- + Lua\TeX/ version 1.14 and newer provides `\partokenname` which allows to + specify something different than `\par` at empty lines. We set `\_par` + (see bellow) in \OpTeX/ version 1.04+ and newer. Some macros were rewritten + due to this change. And we copy old versions of these changed macros here + in order to allow to use older Lua\TeX/ versions where `\partokenname` is + not provided.\nl + Note that your macros where a parameter is separated by the empty line + must be changed too. Use `\def\macro #1\_par{...}` instead + `\def\macro #1\par{...}`. + \_cod ----------------------------- + +\_ifx\_partokenname\_undefined % LuaTeX 1.13 or older: + + \_def\_begmulti #1 {\_par\_bgroup\_wipeepar\_multiskip\_penalty0 \_def\_Ncols{#1} + \_setbox6=\_vbox\_bgroup\_bgroup \_let\_setxhsize=\_relax \_penalty-99 + \_advance\_hsize by\_colsep + \_divide\_hsize by\_Ncols \_advance\_hsize by-\_colsep + \_mullines=0 + \_def\par{\_ifhmode\_endgraf\_global\_advance\_mullines by\_prevgraf\_fi}% + } + \_def\_incaption {\_bgroup + \_ifcsname _\_tmpa num\_endcsname \_ea\_incr \_csname _\_tmpa num\_endcsname + \_else \_opwarning{Unknown caption /\_tmpa}\_fi + \_edef\_thecapnum {\_csname _the\_tmpa num\_endcsname}% + \_edef\_thecaptitle{\_mtext{\_tmpa}}% + \_ea\_the \_csname _everycaption\_tmpa\_endcsname + \_def\_par{\_nbpar\_egroup}\_let\par=\_par + \_cs{_printcaption\_tmpa}% + } + \_def\_boxlines{% + \_def\_boxlinesE{\_ifhmode\_egroup\_empty\_fi}% + \_def\_nl{\_boxlinesE}% + \_bgroup \_lccode`\~=`\^^M\_lowercase{\_egroup\_let~}\_boxlinesE + \_everypar{\_setbox0=\_lastbox\_endgraf + \_hbox\_bgroup \_catcode`\^^M=13 \_let\par=\_nl \_aftergroup\_boxlinesC}% + } + \_def\_letter{ + \_def\_address{\_vtop\_bgroup\_boxlines \_parskip=0pt \_let\par=\_egroup} + \_def\_subject{{\_bf \_mtext{subj}: }} + \_public \address \subject ; + \_typosize[11/14] + \_vsize=\_dimexpr \_topskip + 49\_baselineskip \_relax % added 2020-03-28 + \_parindent=0pt + \_parskip=\_medskipamount + \_nopagenumbers + } + \_def\_printverbline#1{\_putttpenalty \_indent \_printverblinenum \_kern\_ttshift #1\par} + \_public \begmulti \boxlines \letter ; + +\_else % LuaTeX 1.14 or newer: + + \_doc ----------------------------- + We set `\partokenneame` to `\_par` in order to keep the name `\par` in + user name space. I.e. a user can say `\def\par{paragraph}` for example + without crash of processing the document. Se section~\ref[prefixed] for + more details about the name space concept.\nl + Moreover, we set `\partokencontext` to one in order to the `\_par` token + is inserted not only at empty lines, but also at the end of `\vbox`, `\vtop` and + `\vcenter` if horizontal mode is opened here. This differs from default + \TeX/ behavior where horizontal mode is closed in these cases without + inserting par token.\nl + We set \`\_partokenset` to defined value 1 in order to the macro programmer can + easily check these settings in \OpTeX/ format by + `\ifx\_partokenset\undefined ... \else ...\fi`. + \_cod ----------------------------- + + \_partokenname\_par + \_partokencontext=1 + \_let\_partokenset=1 +\_fi + \_endcode 2021-08-02 \SetLipsumLanguage added, fix for new lipusm version diff --git a/Master/texmf-dist/tex/optex/base/plain-macros.opm b/Master/texmf-dist/tex/optex/base/plain-macros.opm index b878d96ce84..2f4d2da65c6 100644 --- a/Master/texmf-dist/tex/optex/base/plain-macros.opm +++ b/Master/texmf-dist/tex/optex/base/plain-macros.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \magstep {Macros from plain TeX <2021-04-09>} % preloaded in format +\_codedecl \magstep {Macros from plain TeX <2021-09-24>} % preloaded in format \_doc ----------------------------- The \`\dospecials` works like in plain TeX but does nothing with `_`. @@ -48,11 +48,11 @@ Plain \TeX/ classical \`\obeylines` and \`\obeyspaces`. \_cod ----------------------------- -% In \obeylines, we say `\let^^M=\par' instead of `\def^^M{\par}' -% since this allows, for example, `\let\par=\cr \obeylines \halign{...' +% In \obeylines, we say `\let^^M=\_par' instead of `\def^^M{\_par}' +% since this allows, for example, `\let\_par=\cr \obeylines \halign{...' {\_catcode`\^^M=13 % these lines must end with % \_gdef\_obeylines{\_catcode`\^^M=13\_let^^M\_par}% - \_global\_let^^M=\par} % this is in case ^^M appears in a \write + \_global\_let^^M=\_par} % this is in case ^^M appears in a \write \_def\_obeyspaces{\_catcode`\ =13 } {\_obeyspaces\_global\_let =\_space} \_public \obeylines \obeyspaces ; @@ -210,8 +210,7 @@ \_def\_{\_hbox{_}} \_def\dag{\_errmessage{\_usedirectly †}} \_def\ddag{\_errmessage{\_usedirectly ‡}} -%\_def\copyright{\_errmessage{\_usedirectly ©}} -\_def\copyright{©} % << example, what to do +\_def\copyright{\_errmessage{\_usedirectly ©}} %\_def\Orb{\_mathhexbox20D} % obsolete (part of Copyright) %\_def\P{\_mathhexbox27B} % obsolete @@ -220,6 +219,21 @@ \_public \mathhexbox ; \_doc ----------------------------- + The \`\_unichars` macro is run in \^`\initunifonts`, + Unicodes are used instead old plain \TeX/ settings. + \_cod ----------------------------- + +\def\_unichars{% characters with different codes in Unicode: + \_chardef\ss=`ß + \_chardef\oe=`œ + \_chardef\OE=`Œ + \_chardef\S=`§ + \_chardef\dag`† + \_chardef\ddag`‡ + \_chardef\copyright`© +} + + \_doc ----------------------------- Accents. The macros \`\ooalign`, \`\d`, \`\b`, \`\c`, \`\dots`, are defined for backward compatibility. @@ -344,5 +358,6 @@ \_endcode % ------------------------------------- +2021-09-24 ... \_unichars introduced 2021-04-09 ... \_public\showhyphens, bug fixed 2020-02-14 ... released diff --git a/Master/texmf-dist/tex/optex/base/prefixed.opm b/Master/texmf-dist/tex/optex/base/prefixed.opm index 6dec64c7e5e..d15ee4140de 100644 --- a/Master/texmf-dist/tex/optex/base/prefixed.opm +++ b/Master/texmf-dist/tex/optex/base/prefixed.opm @@ -175,12 +175,12 @@ In this documentation: if both variants of a control sequence are declared the unprefixed variant. The code typically defines the prefixed variant and then the \^`\public` (or `\_public`) macro is used. -\secc Namespace of control sequences for users +\secc[user-ns] Namespace of control sequences for users -Users can define or declare any control sequence with a name without any `_`. -This does not make any problem. Only one exception is the reserved control -sequence `\par`. It is generated by the tokenizer (at empty lines) -and used as internal in \TeX/. +Users can (re)define or (re)declare any control sequence with a name without any `_`. +This does not make any problem in internal \OpTeX/ macros.\fnote +{The token `\par` is in user name space too from \OpTeX/ 1.04+ and +Lua\TeX/ 1.14, see also the end of section~\ref[others].} User can define or declare control sequences with `_` character, for example `\my_control_sequence`, but with the following exceptions: diff --git a/Master/texmf-dist/tex/optex/base/references.opm b/Master/texmf-dist/tex/optex/base/references.opm index eb884c4f1df..51b1b9591af 100644 --- a/Master/texmf-dist/tex/optex/base/references.opm +++ b/Master/texmf-dist/tex/optex/base/references.opm @@ -24,11 +24,10 @@ \_doc ---------------------------- \`\_Xlabel` `{<label>}{<text>}` saves the <text> to `\_lab:<label>` and saves - `[pg:<gpageno>]{<pageno>}` to `\_pgref:<label>`. + `{<gpageno>}{<pageno>}` to `\_pgref:<label>`. \_cod ---------------------------- -\_def\_Xlabel#1#2{\_sdef{_lab:#1}{#2}\_sxdef{_pgref:#1}{\_ea\_bracketspg\_currpage}} -\_def\_bracketspg#1#2{[pg:#1]{#2}} +\_def\_Xlabel#1#2{\_sdef{_lab:#1}{#2}\_sxdef{_pgref:#1}{\_currpage}} \_doc ---------------------------- \`\label``[<label>]` saves the declared label to `\_lastlabel` and @@ -54,31 +53,52 @@ \_public \label \wlabel ; \_doc ---------------------------- - \`\ref``[<label>]` uses saved `\_lab:<label>` and prints (linked) `<text>`. + \`\ref``[<label>]{<given-text>}` prints (linked) `<given-text>`. + The missing optional `{<given-text>}` is replaced by `{@}`. The `@` is + replaced by `<implicit-text>` from saved `\lab:<label>` using \^`\_reftext` macro. If the reference is backward 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 the first run of \TeX/ and we print a warning and do `\_openref`. \nl - \`\pgref``[<label>]` uses `{<gpageno>}{<pageno>}` from `\_pgref:<label>` and - prints (linked) `<pageno>` using `\_ilink` macro. + \`\pgref``[<label>]{<given-text>}` prints `<given-text>` where `@` is + replaced by <pageno>. Data in the format `{<gpageno>}{<pageno>}` + are read from `\_pgref:<label>` by \`\_pgrefB``{<gpageno>}{<pageno>}{<given-text>}`. + \nl + \`\_lastreflabel` keeps the value of the last label read by \^`\ref` or \^`\pgref`. + You can use it for example by definig a macro `\pg` by `\def\pg{\pgref[\_lastreflabel]}` + and then you need not repeat the same label in typical situations and you + can write for instance: `see section \ref[lab] at page \pg.` \_cod ---------------------------- -\_def\_ref[#1]{\_isdefined{_lab:#1}% - \_iftrue \_ilink[ref:#1]{\_csname _lab:#1\_endcsname}% - \_else ??\_opwarning{label [#1] unknown. Try to TeX me again}% - \_incr\_unresolvedrefs \_openref +\_def\_ref[#1]{\_xdef\_lastreflabel{#1}\_isnextchar\_bgroup{\_refA}{\_refA{@}}} +\_def\_refA #1{\_isdefined{_lab:\_lastreflabel}% + \_iftrue \_ilink[ref:\_lastreflabel]{\_reftext{\_csname _lab:\_lastreflabel\_endcsname}{#1}}% + \_else \_reftext{??}{#1}\_opwarning{label [\_lastreflabel] unknown. Try to TeX me again}% + \_incr\_unresolvedrefs \_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}% +\_def\_pgref[#1]{\_xdef\_lastreflabel{#1}\_isnextchar\_bgroup{\_pgrefA}{\_pgrefA{@}}} +\_def\_pgrefA #1{\_isdefined{_pgref:\_lastreflabel}% + \_iftrue \_ea\_ea\_ea\_pgrefB \_csname _pgref:\_lastreflabel\_endcsname{#1}% + \_else \_reftext{??}{#1}\_opwarning{pg-label [\_lastreflabel] unknown. Try to TeX me again}% \_incr\_unresolvedrefs \_openref \_fi } +\_def\_pgrefB #1#2#3{\_ilink[pg:#1]{\_reftext{#2}{#3}}} + \_public \ref \pgref ; \_doc ----------------------------- + \`\_reftext``{<implicit-text>}{<given-text>}` expands to the <given-text> + but the optional `@` in the `<given-text>` is replaced by the `<implicit-text>` first. + \_cod ----------------------------- + +\_def\_reftext #1#2{\_isatin #2@\_iffalse #2\_else\_reftextA{#1}#2\_end \_fi} +\_def\_reftextA #1#2@#3\_end {#2#1#3} +\_def\_isatin #1@#2\_iffalse {\_ifx\_end#2\_end} + + \_doc ----------------------------- Default \`\_printlabel` is empty macro (labels are not printed). The \`\showlabels` redefines it as box with zero dimensions and with left lapped `[<label>]` in blue 10pt `\tt` font shifted up by 1.7ex. diff --git a/Master/texmf-dist/tex/optex/base/sections.opm b/Master/texmf-dist/tex/optex/base/sections.opm index 39759962bf8..25d31cabaa2 100644 --- a/Master/texmf-dist/tex/optex/base/sections.opm +++ b/Master/texmf-dist/tex/optex/base/sections.opm @@ -331,7 +331,7 @@ edefines \`\_thecapnum` as `\_the<letter>num` and defines \`\_thecaptitle` as language-dependent word using \^`\_mtext`, runs the `\_everycaption<letter>` tokens register. - The group opened by `\caption` is finalized by first `\par` from + The group opened by `\caption` is finalized by first `\_par` from an empty line or from `\vskip` or from `\endinsert`. The `\_printcaption<letter>` is called, it starts with printing of the caption.\nl @@ -347,7 +347,7 @@ \_edef\_thecapnum {\_csname _the\_tmpa num\_endcsname}% \_edef\_thecaptitle{\_mtext{\_tmpa}}% \_ea\_the \_csname _everycaption\_tmpa\_endcsname - \_def\_par{\_nbpar\_egroup}\_let\par=\_par + \_def\_par{\_nbpar\_egroup}% \_cs{_printcaption\_tmpa}% } \_def \_cskip {\_par\_nobreak\_medskip} % space between caption and the object diff --git a/Master/texmf-dist/tex/optex/base/styles.opm b/Master/texmf-dist/tex/optex/base/styles.opm index deb47d6930f..1c37339d029 100644 --- a/Master/texmf-dist/tex/optex/base/styles.opm +++ b/Master/texmf-dist/tex/optex/base/styles.opm @@ -18,7 +18,7 @@ \_def\_nl{\_boxlinesE}% \_bgroup \_lccode`\~=`\^^M\_lowercase{\_egroup\_let~}\_boxlinesE \_everypar{\_setbox0=\_lastbox\_endgraf - \_hbox\_bgroup \_catcode`\^^M=13 \_let\par=\_nl \_aftergroup\_boxlinesC}% + \_hbox\_bgroup \_catcode`\^^M=13 \_let\_par=\_nl \_aftergroup\_boxlinesC}% } \_def\_boxlinesC{\_futurelet\_next\_boxlinesD} \_def\_boxlinesD{\_ifx\_next\_empty\_else\_ea\_egroup\_fi} @@ -51,7 +51,7 @@ \_cod ----------------------------- \_def\_letter{ - \_def\_address{\_vtop\_bgroup\_boxlines \_parskip=0pt \_let\par=\_egroup} + \_def\_address{\_vtop\_bgroup\_boxlines \_parskip=0pt \_let\_par=\_egroup} \_def\_subject{{\_bf \_mtext{subj}: }} \_public \address \subject ; \_typosize[11/14] diff --git a/Master/texmf-dist/tex/optex/base/unimath-codes.opm b/Master/texmf-dist/tex/optex/base/unimath-codes.opm index d7f0d387ef5..ea40116ab89 100644 --- a/Master/texmf-dist/tex/optex/base/unimath-codes.opm +++ b/Master/texmf-dist/tex/optex/base/unimath-codes.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \_ncharrmA {Uni math codes <2021-04-25>} % preloaded on demand by \loadmath +\_codedecl \_ncharrmA {Uni math codes <2022-01-06>} % preloaded on demand by \loadmath \_doc ----------------------------- The control sequences for `\alpha`, `\beta` etc are redefined here. @@ -216,6 +216,8 @@ \_Umathcode `* = 2 1 "02217 % equivalent to \ast, like in plain TeX +\_Umathcode "03A2 = 7 1 "03F4 % \varTheta + \_protected\_def \_sqrt {\_Uradical 1 "0221A } \_protected\_def \_cuberoot {\_Uradical 1 "0221B } \_protected\_def \_fourthroot {\_Uradical 1 "0221C } @@ -313,6 +315,8 @@ \_let \drbkarow=\drbkarrow \_let \hksearow=\hksearrow \_let \hkswarow=\hkswarrow +\_let \square=\mdlgwhtsquare +\_let \blacksquare=\mdlgblksquare \_let \upalpha=\mupalpha \_let \upbeta=\mupbeta @@ -439,6 +443,8 @@ for technical details about Unicode-math. \_endinput History: +2022-01-06 \varTheta corrected +2021-09-15 \square, \blacksquare defined 2021-04-25 \triangleright: typo fixed 2021-04-20 reading mathclass.opm improved 2021-04-07 \_setnabla introduced, \nabla as uppercase Greek letter diff --git a/Master/texmf-dist/tex/optex/base/verbatim.opm b/Master/texmf-dist/tex/optex/base/verbatim.opm index 08748eb5a69..e3d423691ed 100644 --- a/Master/texmf-dist/tex/optex/base/verbatim.opm +++ b/Master/texmf-dist/tex/optex/base/verbatim.opm @@ -176,7 +176,7 @@ \_ifx\_end#2 \_let\_next=\_relax \_else \_def\_next{\_printverb#2}\_fi \_next } -\_def\_printverbline#1{\_putttpenalty \_indent \_printverblinenum \_kern\_ttshift #1\par} +\_def\_printverbline#1{\_putttpenalty \_indent \_printverblinenum \_kern\_ttshift #1\_par} \_def\_initverblinenum{\_tenrm \_thefontscale[700]\_ea\_let\_ea\_sevenrm\_the\_font} \_def\_printverblinenum{\_llap{\_sevenrm \_the\_ttline\_kern.9em}} \_def\_putttpenalty{\_def\_putttpenalty{\_penalty\_ttpenalty}} |