From 09dc9d43b3c6fe632d71cef7cbd36c1f9bf238da Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 20 Mar 2020 21:25:16 +0000 Subject: optex (20mar20) git-svn-id: svn://tug.org/texlive/trunk@54430 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/luatex/optex/alloc.opm | 2 +- .../texmf-dist/tex/luatex/optex/basics-macros.opm | 2 +- Master/texmf-dist/tex/luatex/optex/bib-iso690.opm | 2 +- Master/texmf-dist/tex/luatex/optex/bib-simple.opm | 2 +- Master/texmf-dist/tex/luatex/optex/cite-bib.opm | 1 + Master/texmf-dist/tex/luatex/optex/colors.opm | 14 +- Master/texmf-dist/tex/luatex/optex/fams-ini.opm | 2 + Master/texmf-dist/tex/luatex/optex/fnotes.opm | 19 +- .../texmf-dist/tex/luatex/optex/fonts-catalog.opm | 2 + Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm | 2 +- .../texmf-dist/tex/luatex/optex/fonts-preload.opm | 2 +- .../texmf-dist/tex/luatex/optex/fonts-resize.opm | 4 +- .../texmf-dist/tex/luatex/optex/fonts-select.opm | 19 +- Master/texmf-dist/tex/luatex/optex/graphics.opm | 146 +++++++++++++- Master/texmf-dist/tex/luatex/optex/hyperlinks.opm | 6 +- Master/texmf-dist/tex/luatex/optex/hyphen-lan.opm | 2 +- Master/texmf-dist/tex/luatex/optex/if-macros.opm | 2 +- Master/texmf-dist/tex/luatex/optex/languages.opm | 41 +++- Master/texmf-dist/tex/luatex/optex/lists.opm | 5 +- Master/texmf-dist/tex/luatex/optex/logos.opm | 2 +- Master/texmf-dist/tex/luatex/optex/luatex-ini.opm | 4 +- Master/texmf-dist/tex/luatex/optex/makeindex.opm | 40 ++-- Master/texmf-dist/tex/luatex/optex/maketoc.opm | 2 +- Master/texmf-dist/tex/luatex/optex/margins.opm | 6 +- Master/texmf-dist/tex/luatex/optex/math-macros.opm | 2 +- .../texmf-dist/tex/luatex/optex/math-preload.opm | 2 +- .../texmf-dist/tex/luatex/optex/math-unicode.opm | 2 +- Master/texmf-dist/tex/luatex/optex/more-macros.opm | 138 ++++++++++++++ .../texmf-dist/tex/luatex/optex/multicolumns.opm | 2 +- Master/texmf-dist/tex/luatex/optex/op-macros.opm | 140 -------------- Master/texmf-dist/tex/luatex/optex/opmac-rest.opm | 65 ------- Master/texmf-dist/tex/luatex/optex/optex.ini | 4 +- Master/texmf-dist/tex/luatex/optex/others.opm | 2 +- Master/texmf-dist/tex/luatex/optex/outlines.opm | 2 +- Master/texmf-dist/tex/luatex/optex/output.opm | 17 +- Master/texmf-dist/tex/luatex/optex/parameters.opm | 9 +- .../texmf-dist/tex/luatex/optex/pdfuni-string.opm | 2 +- .../texmf-dist/tex/luatex/optex/plain-macros.opm | 2 +- Master/texmf-dist/tex/luatex/optex/prefixed.opm | 3 +- Master/texmf-dist/tex/luatex/optex/ref-file.opm | 3 +- Master/texmf-dist/tex/luatex/optex/references.opm | 21 +- Master/texmf-dist/tex/luatex/optex/sections.opm | 2 +- Master/texmf-dist/tex/luatex/optex/slides.opm | 211 +++++++++++++++++++++ Master/texmf-dist/tex/luatex/optex/styles.opm | 9 +- Master/texmf-dist/tex/luatex/optex/table.opm | 2 +- Master/texmf-dist/tex/luatex/optex/uni-lcuc.opm | 2 +- .../texmf-dist/tex/luatex/optex/unimath-codes.opm | 4 +- Master/texmf-dist/tex/luatex/optex/usebib.opm | 5 +- Master/texmf-dist/tex/luatex/optex/verbatim.opm | 13 +- 49 files changed, 684 insertions(+), 309 deletions(-) create mode 100644 Master/texmf-dist/tex/luatex/optex/more-macros.opm delete mode 100644 Master/texmf-dist/tex/luatex/optex/op-macros.opm delete mode 100644 Master/texmf-dist/tex/luatex/optex/opmac-rest.opm create mode 100644 Master/texmf-dist/tex/luatex/optex/slides.opm (limited to 'Master/texmf-dist/tex/luatex') diff --git a/Master/texmf-dist/tex/luatex/optex/alloc.opm b/Master/texmf-dist/tex/luatex/optex/alloc.opm index 6ca5939ab1f..81d9e6606d7 100644 --- a/Master/texmf-dist/tex/luatex/optex/alloc.opm +++ b/Master/texmf-dist/tex/luatex/optex/alloc.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \newdimen {Allocators for registers <2020-01-23>} +\_codedecl \newdimen {Allocators for registers <2020-01-23>} % loaded in format \_chardef\_maicount = 65535 % Max Allocation Index for counts registers in LuaTeX \_let\_maidimen = \_maicount diff --git a/Master/texmf-dist/tex/luatex/optex/basics-macros.opm b/Master/texmf-dist/tex/luatex/optex/basics-macros.opm index 23b6a6a43c7..b86fd2e2e9b 100644 --- a/Master/texmf-dist/tex/luatex/optex/basics-macros.opm +++ b/Master/texmf-dist/tex/luatex/optex/basics-macros.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \sdef {Basic macros for OpTeX <2020-02-14>} +\_codedecl \sdef {Basic macros for OpTeX <2020-02-14>} % loaded in format \_doc ------------------------------ `\bgroup`, `\egroup`, `\empty`, `\space`, `\null` and `\wlog` are classical diff --git a/Master/texmf-dist/tex/luatex/optex/bib-iso690.opm b/Master/texmf-dist/tex/luatex/optex/bib-iso690.opm index 8f341330c6e..3265eaea05c 100644 --- a/Master/texmf-dist/tex/luatex/optex/bib-iso690.opm +++ b/Master/texmf-dist/tex/luatex/optex/bib-iso690.opm @@ -1,6 +1,6 @@ % This is part of OpTeX project, see http://petr.olsak.net/optex -% bibliography style (iso690), version <2020-03-10> +% bibliography style (iso690), version <2020-03-10>, loaded on demand by \usebib \_ifx\_optexbibstyle\_undefined \_errmessage {This file can be read by: \_string\usebib/? (iso690) bibfiles command only} diff --git a/Master/texmf-dist/tex/luatex/optex/bib-simple.opm b/Master/texmf-dist/tex/luatex/optex/bib-simple.opm index 46824cb81d7..347d90bb143 100644 --- a/Master/texmf-dist/tex/luatex/optex/bib-simple.opm +++ b/Master/texmf-dist/tex/luatex/optex/bib-simple.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -% bibliography style (simple), version <2020-03-10> +% bibliography style (simple), version <2020-03-10>, loaded on demand by \usebib \_ifx\_optexbibstyle\_undefined \_errmessage {This file can be read by: \_string\usebib/? (simple) bibfiles command only} diff --git a/Master/texmf-dist/tex/luatex/optex/cite-bib.opm b/Master/texmf-dist/tex/luatex/optex/cite-bib.opm index 505b18bb358..7f5b184d93a 100644 --- a/Master/texmf-dist/tex/luatex/optex/cite-bib.opm +++ b/Master/texmf-dist/tex/luatex/optex/cite-bib.opm @@ -187,6 +187,7 @@ \_def\_bibB[#1]{\_par \_bibskip \_advance\_bibnum by1 \_noindent \_def\_tmpb{#1}\_wbib{#1}{\_the\_bibnum}{\_the\_bibmark}% + \_printlabel{#1}% \_printbib \_ignorespaces } \_def\_wbib#1#2#3{\_dest[cite:\_the\_bibnum]% diff --git a/Master/texmf-dist/tex/luatex/optex/colors.opm b/Master/texmf-dist/tex/luatex/optex/colors.opm index 52dd349f5e8..c4ce83ecd91 100644 --- a/Master/texmf-dist/tex/luatex/optex/colors.opm +++ b/Master/texmf-dist/tex/luatex/optex/colors.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \colordef {Colors <2020-03-07>} +\_codedecl \colordef {Colors <2020-03-18>} % loaded in format \_doc ----------------------------- We declare internal boolean value `\_iflocalcolor` ad do @@ -107,7 +107,7 @@ \_cod ----------------------------- \_def\_rgbtocmyk #1 #2 #3 ;{% - \_ea \_stripzeros \_directlua{ + \_ea \_stripzeros \_detokenize \_ea{\_directlua{ local kr = math.max(#1,#2,#3) if (kr==0) then tex.print('0. 0. 0. 1 ;') @@ -115,23 +115,23 @@ tex.print(string.format('\_pcent.3f \_pcent.3f \_pcent.3f \_pcent.3f ;', (kr-#1)/kr, (kr-#2)/kr, (kr-#3)/kr, 1-kr)) end -}} +}}} \_def\_cmyktorgb #1 #2 #3 #4 ;{% - \_ea \_stripzeros \_directlua{ + \_ea \_stripzeros \_detokenize \_ea{\_directlua{ local kr = 1-#4 tex.print(string.format('\_pcent.3f \_pcent.3f \_pcent.3f ;', (1-#1)*kr, (1-#2)*kr, (1-#3)*kr)) -}} +}}} \_def\_colorcrop{\_directlua{ local m=math.max(color_C, color_M, color_Y, color_K) if (m>1) then color_C=color_C/m color_M=color_M/m color_Y=color_Y/m color_K=color_K/m end }} -\_def\_colordefFin{\_colorcrop \_ea \_stripzeros \_directlua{ +\_def\_colordefFin{\_colorcrop \_ea \_stripzeros \_detokenize \_ea{\_directlua{ tex.print(string.format('\_pcent.3f \_pcent.3f \_pcent.3f \_pcent.3f ;', color_C, color_M, color_Y, color_K)) -}} +}}} \_def\_douseK{\_colorcrop \_directlua{ kr=math.min(color_C, color_M, color_Y) if (kr>=1) then diff --git a/Master/texmf-dist/tex/luatex/optex/fams-ini.opm b/Master/texmf-dist/tex/luatex/optex/fams-ini.opm index f9d3110f139..265150b1181 100644 --- a/Master/texmf-dist/tex/luatex/optex/fams-ini.opm +++ b/Master/texmf-dist/tex/luatex/optex/fams-ini.opm @@ -1,5 +1,7 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex +% Version <2020-02-28>. Loaded in format and secondly on demand by \fontfam[catalog] + \_famtext {Special name for printing a catalogue:} \_faminfo [Catalogue] {Catalogue of all registered font families} {fonts-catalog} {} diff --git a/Master/texmf-dist/tex/luatex/optex/fnotes.opm b/Master/texmf-dist/tex/luatex/optex/fnotes.opm index 97982e7266e..9f9a9d3f5e1 100644 --- a/Master/texmf-dist/tex/luatex/optex/fnotes.opm +++ b/Master/texmf-dist/tex/luatex/optex/fnotes.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \fnote {Footnotes, marginal notes OpTeX <2020-03-11>} +\_codedecl \fnote {Footnotes, marginal notes OpTeX <2020-03-19>} % loaded in format \_doc ----------------------------- \begitems @@ -36,9 +36,20 @@ \endtt This code gives footnotes* and ** and*** and† etc. and it supposes that there are no more than 6 footnotes at one page. + + If you want to distinguish between footnote marks in the text and in the front of + footnote itself, then you can define `\_printfnotemarkA` and `\_printfnotemarkB`. + The following example shows an implementation of hyperlinked footnotes + (from text to footnote and bacward): + \begtt + \def\_printfnotemarkA{\ilink[fnB:\the\gfnotenum]{\_printfnotemark}\dest[fnA::\the\gfnotenum]} + \def\_printfnotemarkB{\ilink[fnA:\the\gfnotenum]{\_printfnotemark}\dest[fnB::\the\gfnotenum]} + \endtt \_cod ----------------------------- -\_def \_printfnotemark {$^{\_fnotenum}$} % default fnote mark +\_def \_printfnotemark {$^{\_fnotenum}$} % default footnote mark +\_def \_printfnotemarkA {\_printfnotemark} % footnote marks used in text +\_def \_printfnotemarkB {\_printfnotemark} % footnote marks used in front of footnotes \_doc ---------------------------- Each footnote saves the `\_Xfnote` (without parameter) to the `.ref` @@ -55,7 +66,7 @@ \_cod ---------------------------- \_def\_fnote{\_fnotemark1\_fnotetext} -\_def\_fnotemark#1{{\_advance\_gfnotenum by#1\_advance\_lfnotenum by#1\relax \_printfnotemark}} +\_def\_fnotemark#1{{\_advance\_gfnotenum by#1\_advance\_lfnotenum by#1\relax \_printfnotemarkA}} \_doc ---------------------------- The `\_fnotetext` calls `\_opfootnote` which is equivalent to plain \TeX/ @@ -76,7 +87,7 @@ \_ifpgfnote \_ifcsname _fn:\_the\_gfnotenum \_endcsname \_else \_opwarning{unknown \_noexpand\fnote mark. TeX me again} \_fi\_fi - \_opfootnote\_fnset\_printfnotemark + \_opfootnote\_fnset\_printfnotemarkB } \_def\_fnset{\_everypar={}\_the\_everyfnote \_scalemain \_typoscale[800/800]} diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm b/Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm index f9cd2af6df8..de45dd3dcfb 100644 --- a/Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm +++ b/Master/texmf-dist/tex/luatex/optex/fonts-catalog.opm @@ -1,5 +1,7 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex +\_codedecl \_undefined {Font catalogue <2020-02-26>} % loaded on demand by \fontfam[catalog] + \_initunifonts \_begingroup diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm b/Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm index c7a83389954..20d6d45bf39 100644 --- a/Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm +++ b/Master/texmf-dist/tex/luatex/optex/fonts-opmac.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \typosize {Font managing macros from OPmac <2019-05-21>} +\_codedecl \typosize {Font managing macros from OPmac <2020-02-29>} % loaded in format \_protected\_def \_typosize [#1/#2]{% \_textfontsize{#1}\_mathfontsize{#1}\_setbaselineskip{#2}% diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-preload.opm b/Master/texmf-dist/tex/luatex/optex/fonts-preload.opm index 704b665e9b2..49b1f226e21 100644 --- a/Master/texmf-dist/tex/luatex/optex/fonts-preload.opm +++ b/Master/texmf-dist/tex/luatex/optex/fonts-preload.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \rm {Latin Modern fonts (EC) preloaded <2020-01-23>} +\_codedecl \rm {Latin Modern fonts (EC) preloaded <2020-01-23>} % loaded in format % Only few text fonts are preloaded: diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-resize.opm b/Master/texmf-dist/tex/luatex/optex/fonts-resize.opm index 15f06661ff0..dbc5974852c 100644 --- a/Master/texmf-dist/tex/luatex/optex/fonts-resize.opm +++ b/Master/texmf-dist/tex/luatex/optex/fonts-resize.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \setfontsize {Font resizing macros <2020-02-14>} +\_codedecl \setfontsize {Font resizing macros <2020-03-17>} % preloaded in format %% resizefont variant-name \fontswitch, for example \resizefont{bf}\_tenbf @@ -81,7 +81,7 @@ % \fontdef \new {\\} \_def \_fontdef #1#2{\_begingroup \_ifx\_fontselector\_undefined \_def\_fontselector{#1}\_fi - #2% + \_reloading #2% \_ea \_keepmeaning \_fontselector \_endgroup } \_def\_fontlet#1#2{\_ifx #2=\_ea\_fontlet \_ea#1\_else diff --git a/Master/texmf-dist/tex/luatex/optex/fonts-select.opm b/Master/texmf-dist/tex/luatex/optex/fonts-select.opm index da010893332..eaadc0dedce 100644 --- a/Master/texmf-dist/tex/luatex/optex/fonts-select.opm +++ b/Master/texmf-dist/tex/luatex/optex/fonts-select.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \fontfam {Fonts selection system <2020-02-14>} +\_codedecl \fontfam {Fonts selection system <2020-03-18>} % preloaded in format \_def\_initunifonts {% \_ea\_newcount \_csname e@alloc@attribute@count\_endcsname @@ -10,12 +10,15 @@ require('luaotfload-main') local _void = luaotfload.main () }% \_gdef\_rfskipatX ##1" ##2\_relax{"##1"}% - \_gdef\_doresizefont ##1{\_logfont{##1}% - \_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 + \_global\_let \_doresizefont=\_doresizeunifont + \_gdef\_tryloadtt {\_fontdef\_tentt{\def\_fontnamegen{[lmmono10-regular]}\_rm}}% + \_global\_let \_initunifonts=\_relax % we need not to do this work twice + \_global\_let \initunifonts=\_relax +} +\_gdef\_doresizeunifont #1{\_logfont{#1}% + \_ifx\_fontnamegen\_undefined \_doresizetfmfont#1\_else + \_font#1={\_fontnamegen} \_sizespec \_relax \_setwsp#1\_relax + \_fi } \_def\_fontdecl [#1]#2#3#4#5#6#7{% \_initunifonts \_uniaccents @@ -108,7 +111,7 @@ \_else \_protected\_edef #1{\noexpand\_famdepend\noexpand#1{_f:\noexpand\_currfamily:\_tmp}}% \_sdef{_f:\_currfamily:\_tmp}{#3#2}% - \_def#3{\_fontdef#2{\_reloading#4}}% + \_def#3{\_fontdef#2{#4}}% \_ifx#1\tt \addto#1{\_fam\_ttfam}\fi \_sdef{_currvar:\csstring#2}{#1}% \_fi diff --git a/Master/texmf-dist/tex/luatex/optex/graphics.opm b/Master/texmf-dist/tex/luatex/optex/graphics.opm index 2ce9ba76340..d4a868a3d1a 100644 --- a/Master/texmf-dist/tex/luatex/optex/graphics.opm +++ b/Master/texmf-dist/tex/luatex/optex/graphics.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \inspic {Graphics <2020-02-29>} +\_codedecl \inspic {Graphics <2020-03-18>} % preloaded in format \_doc ----------------------------- `\inspic` accepts old syntax `\inspic ` @@ -14,18 +14,58 @@ write `\moveright\inspic ...` or something similar. \_cod \_fin ----------------------- -\_def\_inspic{\hbox\bgroup\_isnextchar\_bgroup\_inspicB\_inspicA} +\_def\_inspic{\_hbox\_bgroup\_isnextchar\_bgroup\_inspicB\_inspicA} \_def\_inspicA #1 {\_inspicB {#1}} \_def\_inspicB #1{% \_pdfximage \_ifdim\_picwidth=0pt \_else width\_picwidth\_fi \_ifdim\_picheight=0pt \_else height\_picheight\_fi \_picparams {\_the\_picdir#1}% - \_pdfrefximage\_pdflastximage\egroup} + \_pdfrefximage\_pdflastximage\_egroup} \_def\_picparams{} \_public \inspic ; + \_doc ----------------------------- + Inkscape is able to save a picture to `*.pdf` file and labels for the ficture + to `*.pdf_tex` file. The second file is in \LaTeX/ format and it is intended to read + immediately it after `*.pdf` in included in order to place labels of this ficture in + the same font as document is printed. + We need to read this \LaTeX/ file by plain \TeX/ macros when `\inkinspic` is used. + These macros are stored in the `\_inkdefs` toknes list and it is used + localy in the group. The solution is borrowed from OPmac trick 0032. + \_cod ----------------------------- + +\_def\_inkinspic{\_hbox\_bgroup\_isnextchar\_bgroup\_inkinspicB\_inkinspicA} +\_def\_inkinspicA #1 {\_inkinspicB {#1}} +\_def\_inkinspicB #1{% + \_ifdim\_picwidth=0pt \_setbox0=\_hbox{\_inspic{#1}}\_picwidth=\_wd0 \_fi + \_the\_inkdefs + \_opinput {\_the\_picdir #1_tex}% file with labels + \_egroup} + +\_newtoks\_inkdefs \_inkdefs={% + \_def\makeatletter#1\makeatother{}% + \_def\includegraphics[#1]#2{\_inkscanpage#1,page=,\_end \_inspic{#2}\_hss}% + \_def\_inkscanpage#1page=#2,#3\_end{\_ifx,#2,\_else\_def\_picparams{page#2}\_fi}% + \_def\put(#1,#2)#3{\_nointerlineskip\_vbox to0pt{\_vss\_hbox to0pt{\_kern#1\_picwidth + \_pdfsave\_hbox to0pt{#3}\_pdfrestore\_hss}\_kern#2\_picwidth}}% + \_def\begin#1{\_csname _begin#1\_endcsname}% + \_def\_beginpicture(#1,#2){\_vbox\_bgroup + \_hbox to\_picwidth{}\_kern#2\_picwidth \_def\end##1{\_egroup}}% + \_def\_begintabular[#1]#2#3\end#4{% + \_vtop{\_def\\{\_cr}\_tabiteml{}\_tabitemr{}\_table{#2}{#3}}}% + \_def\color[#1]#2{\_scancolor #2,}% + \_def\_scancolor#1,#2,#3,{\_pdfliteral{#1 #2 #3 rg}}% + \_def\makebox(#1)[#2]#3{\_hbox to0pt{\_csname _mbx:#2\_endcsname{#3}}}% + \_sdef{_mbx:lb}#1{#1\_hss}\_sdef{_mbx:rb}#1{\_hss#1}\_sdef{_mbx:b}#1{\_hss#1\_hss}% + \_sdef{_mbx:lt}#1{#1\_hss}\_sdef{_mbx:rt}#1{\_hss#1}\_sdef{_mbx:t}#1{\_hss#1\_hss}% + \_def\rotatebox#1#2{\_pdfrotate{#1}#2}% + \_def\lineheight#1{}% + \_def\setlength#1#2{}% +} +\_public \inkinspic ; + \_doc ---------------------------- `\pdfscale` and `\pdfrotate` macros are implemented by `\pdfsetmatrix` primitive. or rotating we need to knos values of sin, cos function. @@ -44,6 +84,104 @@ \_public \pdfscale \pdfrotate ; -\_endcode % ------------------------------------- + \_doc ----------------------------- + The `\transformbox` is copied from OPmac trick 0046. The `\rotbox` is a + combination of `\rotsimple` from OPmac trick 0101 and `\transformbox`. + Note, that `\rotbox{-90}` puts the rotated text to the height of the outer + box (depth is zero) because code from `\rotsimple` is precessed. + But `\rotbox{-90.0}` puts the rotated text to + the depth of the outer box (height is zero) because `\transformbox` is + processed. + \_cod ----------------------------- + +\_def\_multiplyMxV #1 #2 #3 #4 {% matrix * (vvalX, vvalY) + \_tmpdim = #1\_vvalX \_advance\_tmpdim by #3\_vvalY + \_vvalY = #4\_vvalY \_advance\_vvalY by #2\_vvalX + \_vvalX = \_tmpdim +} +\_def\_multiplyMxM #1 #2 #3 #4 {% currmatrix := currmatrix * matrix + \_vvalX=#1pt \_vvalY=#2pt \_ea\_multiplyMxV \_currmatrix + \_edef\_tmpb{\_ea\_ignorept\_the\_vvalX\_space \_ea\_ignorept\_the\_vvalY}% + \_vvalX=#3pt \_vvalY=#4pt \_ea\_multiplyMxV \_currmatrix + \_edef\_currmatrix{\_tmpb\_space + \_ea\_ignorept\_the\_vvalX\_space \_ea\_ignorept\_the\_vvalY\_space}% +} +\_def\_transformbox#1#2{\_hbox{\_setbox0=\_hbox{{#2}}% + \_dimendef\_vvalX 11 \_dimendef\_vvalY 12 % we use these variables + \_dimendef\_newHt 13 \_dimendef\_newDp 14 % only in this group + \_dimendef\_newLt 15 \_dimendef\_newRt 16 + \_preptransform{#1}% + \_kern-\_newLt \_vrule height\_newHt depth\_newDp width0pt + \_setbox0=\_hbox{\_box0}\_ht0=0pt \_dp0=0pt + \_pdfsave#1\_rlap{\_box0}\_pdfrestore \_kern\_newRt}% +} +\_def\_preptransform #1{\_def\_currmatrix{1 0 0 1 }% + \_def\_pdfsetmatrix##1{\_edef\_tmpb{##1 }\_ea\_multiplyMxM \_tmpb\_unskip}% + \_let\pdfsetmatrix=\_pdfsetmatrix #1% + \_setnewHtDp 0pt \_ht0 \_setnewHtDp 0pt -\_dp0 + \_setnewHtDp \_wd0 \_ht0 \_setnewHtDp \_wd0 -\_dp0 + \_protected\_def \_pdfsetmatrix {\_pdfextension setmatrix}% + \_let\pdfsetmatrix=\_pdfsetmatrix +} +\_def\_setnewHtDp #1 #2 {% + \_vvalX=#1\_relax \_vvalY=#2\_relax \_ea\_multiplyMxV \_currmatrix + \_ifdim\_vvalX<\_newLt \_newLt=\_vvalX \_fi \_ifdim\_vvalX>\_newRt \_newRt=\_vvalX \_fi + \_ifdim\_vvalY>\_newHt \_newHt=\_vvalY \_fi \_ifdim-\_vvalY>\_newDp \_newDp=-\_vvalY \_fi +} + +\_def\_rotbox#1#2{% + \_isequal{90}{#1}\_iftrue \_rotboxA{#1}{\_kern\_ht0 \_tmpdim=\_dp0}{\_vfill}{#2}% + \_else \_isequal{-90}{#1}\_iftrue \_rotboxA{#1}{\_kern\_dp0 \_tmpdim=\_ht0}{}{#2}% + \_else \_transformbox{\_pdfrotate{#1}}{#2}% + \_fi \_fi +} +\_def\_rotboxA #1#2#3#4{\_hbox{\_setbox0=\hbox{{#4}}#2% + \_vbox to\_wd0{#3\_wd0=0pt \_dp0=0pt \_ht0=0pt + \_pdfsave\_pdfrotate{#1}\_box0\_pdfrestore\vfil}% + \_kern\_tmpdim +}} +\_public \transformbox \rotbox ; + \_doc --------------------------- + The `\_scantwodimens` scans two objects with the syntactic rule + and returns `{}{}` in sp unit. + + The `\puttext {}` puts the to desired place: + From current point moves and , puts the and returns + back. The cuuren tpoint is unchanged after this macro ends. + + The `\putpic {}` + does `\puttext` with the image scaled to desired and . + If or is zero, natural dimension is used. + The `\nospec` is a shortcut to such natural dimension. + \_cod --------------------------- + +\_def\_scantwodimens{% + \_directlua{tex.print(string.format('{\_pcent d}{\_pcent d}', + token.scan_dimen(),token.scan_dimen{}))}% +} + +\_def\_puttext{\_ea\_ea\_ea\_puttextA\_scantwodimens} +\_def\_puttextA#1#2#3{\_setbox0=\_hbox{{#3}}\_dimen1=#1sp \_dimen2=#2sp \_puttextB} +\_def\_puttextB{% + \_ifvmode + \_ifdim\_prevdepth>0pt \_vskip-\_prevdepth \_relax \_fi + \_nointerlineskip + \_fi + \_wd0=0pt \_ht0=0pt \_dp0=0pt + \_vbox to0pt{\_kern\_dimen1 \_hbox to0pt{\_kern\_dimen2 \_box0\_hss}\_vss}} + +\_def\_putpic{\_ea\_ea\_ea\_putpicA\_scantwodimens} +\_def\_putpicA#1#2{\_dimen1=#1sp \_dimen2=#2sp \_ea\_ea\_ea\_putpicB\_scantwodimens} +\_def\_putpicB#1#2#3{\_setbox0=\_hbox{\_picwidth=#1sp \_picheight=#2sp \_inspic{#3}}\_puttextB} + +\_newbox\_bgbox +\_def\_backgroundpic#1{% + \_setbox\_bgbox=\_hbox{\_picwidth=\_pdfpagewidth \_picheight=\_pdfpageheight \_inspic{#1}}% + \_pgbackground={\_copy\_bgbox} +} +\_def\nospec{0pt} +\_public \puttext \putpic \backgroundpic ; + +\_endcode % ------------------------------------- diff --git a/Master/texmf-dist/tex/luatex/optex/hyperlinks.opm b/Master/texmf-dist/tex/luatex/optex/hyperlinks.opm index 1cf48ac945e..02b33600bd5 100644 --- a/Master/texmf-dist/tex/luatex/optex/hyperlinks.opm +++ b/Master/texmf-dist/tex/luatex/optex/hyperlinks.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \ulink {Hyperlinks <2020-02-22>} +\_codedecl \ulink {Hyperlinks <2020-03-15>} % preloaded in format \_newcount \_tocrefnum @@ -73,8 +73,8 @@ \_cod ---------------------------- \_def\_pdfborder#1{\_if^#1^\_else \_isdefined{#1border}\_iftrue - \_if^\_csname#1border\_endcsname^\_else - attr{/C[\_csname#1border\_endcsname] /Border[0 0 .6]}\_fi + \_if^\_csname #1border\_endcsname^\_else + attr{/C[\_csname #1border\_endcsname] /Border[0 0 .6]}\_fi \_else attr{/Border[0 0 0]}\_fi\_fi } diff --git a/Master/texmf-dist/tex/luatex/optex/hyphen-lan.opm b/Master/texmf-dist/tex/luatex/optex/hyphen-lan.opm index 0dbdf181fb6..d8d035a7e0a 100644 --- a/Master/texmf-dist/tex/luatex/optex/hyphen-lan.opm +++ b/Master/texmf-dist/tex/luatex/optex/hyphen-lan.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \langlist {Initialization of hypenation patterns <2019-05-21>} +\_codedecl \langlist {Initialization of hypenation patterns <2020-03-10>} % preloaded in format \_doc ----------------------------- The means a shortcut of language name (mostly by ISO 639-1). diff --git a/Master/texmf-dist/tex/luatex/optex/if-macros.opm b/Master/texmf-dist/tex/luatex/optex/if-macros.opm index d0423e5911e..5e56503bd87 100644 --- a/Master/texmf-dist/tex/luatex/optex/if-macros.opm +++ b/Master/texmf-dist/tex/luatex/optex/if-macros.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \newif {Special if-macros, is-macros and loops <2020-01-23>} +\_codedecl \newif {Special if-macros, is-macros and loops <2020-02-27>} % preloaded in format \_doc ---------------------------- The `\newif` macro works like in plain \TeX. It means that diff --git a/Master/texmf-dist/tex/luatex/optex/languages.opm b/Master/texmf-dist/tex/luatex/optex/languages.opm index b4d6f57d2af..5bfa2febdc3 100644 --- a/Master/texmf-dist/tex/luatex/optex/languages.opm +++ b/Master/texmf-dist/tex/luatex/optex/languages.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \_mtext {Languages <2020-02-14>} +\_codedecl \_mtext {Languages <2020-03-15>} % preloaded in format \_doc ----------------------------- Only three words are generated by \OpTeX/ macros: \"Chapter", @@ -69,7 +69,44 @@ \_def\_today{\_mtext{today}} \_public \today ; + \_doc ----------------------------- + Quotes should be tagged by `\""` and `\''` if `\quotes` + is declared at beginning of the document. If not, then the control + sequences `\"` and `\'` are undefined. Remember, that they are used in + another meaning when `\oldaccents` command is used. + The macros `\"` and `\'` are not defined as `\protected` because we need + their expansion when `\outlines` are created. + User can declare quotes by `\quoteschars`, where + ... are normal quotes and ... are alternative quotes. + or use `\altquotes` to swap between meaning of these two types of quotes. + \_cod ----------------------------- -\_endcode % ------------------------------------- +\_def \_enquotes {\_quoteschars “”‘’} +\_def \_csquotes {\_quoteschars „“‚‘} +\_def \_frquotes {\_quoteschars “”«»} +\_let \_plquotes = \_frquotes +\_let \_esquotes = \_frquotes +\_let \_grquotes = \_frquotes +\_let \_ruquotes = \_frquotes +\_let \_itquotes = \_frquotes +\_let \_skquotes = \_csquotes +\_let \_dequotes = \_csquotes +\_def \_quoteschars #1#2#3#4{\_def\_altquotes{\_quoteschars#3#4#1#2}\_public\altquotes;% + \_def \"##1"{#1##1#2}\_def \'##1'{#3##1#4}} + \_doc ----------------------------- + Sometimes should be usable to leave the markup `"such"` or `'such'` i.e.~without + the first backslash. Then you can make the characters `"` and `'` active + by `\activequotes` macro and leave quotes without first backsash. + First, delare `\quotes`, then `\altwquotes` (if needed) and finally + `\activequotes`. + \_cod ----------------------------- + +\def\_activequotes{\_ea\_activequotesA\"""\_ea\_activequotesA\'''} +\def\_activequotesA#1#2#3{\_bgroup\_lccode`\~=`#3\_lowercase{\_egroup\_adef#3##1~{#1##1#2}}} + +\_public \quoteschars \activequotes \enquotes \csquotes \skquotes \frquotes \plquotes + \esquotes \grquotes \ruquotes \itquotes \dequotes ; + +\_endcode % ------------------------------------- diff --git a/Master/texmf-dist/tex/luatex/optex/lists.opm b/Master/texmf-dist/tex/luatex/optex/lists.opm index 0b63409dce7..adc28a3617e 100644 --- a/Master/texmf-dist/tex/luatex/optex/lists.opm +++ b/Master/texmf-dist/tex/luatex/optex/lists.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \begitems {Lists: begitems, enditems <2020-03-14>} +\_codedecl \begitems {Lists: begitems, enditems <2020-03-18>} % preloaded in format \_doc ----------------------------- `\aboveliskip` is used above the list of items, @@ -32,6 +32,7 @@ \_itemnum=0 \_adef*{\_startitem} \_advance\_leftskip by\_iindent \_printitem=\_defaultitem + \_the\_everybegitems } \_def\_enditems{\_par\_egroup\_belowliskip} @@ -58,7 +59,7 @@ \_sdef{_item:I}{\_uppercase\_ea{\_romannumeral\_itemnum}\_kern.5em} \_sdef{_item:a}{\_athe\_itemnum) } \_sdef{_item:A}{\_uppercase\_ea{\_athe\_itemnum}) } -\_sdef{_item:x}{\_raise.3ex\_fullrectangle{.6ex} } +\_sdef{_item:x}{\_raise.3ex\_fullrectangle{.6ex}\_kern.4em} \_sdef{_item:X}{\_raise.2ex\_fullrectangle{1ex}\_kern.5em} \_doc ----------------------------- diff --git a/Master/texmf-dist/tex/luatex/optex/logos.opm b/Master/texmf-dist/tex/luatex/optex/logos.opm index 4465d56e9b4..59f1cd87f17 100644 --- a/Master/texmf-dist/tex/luatex/optex/logos.opm +++ b/Master/texmf-dist/tex/luatex/optex/logos.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \TeX {Logos TeX, LuaTeX, etc. <2019-05-21>} +\_codedecl \TeX {Logos TeX, LuaTeX, etc. <2020-02-28>} % preloaded in format \_doc ---------------------------- Despite plain \TeX/ each macro for logos ends by `\ignoreslash`. diff --git a/Master/texmf-dist/tex/luatex/optex/luatex-ini.opm b/Master/texmf-dist/tex/luatex/optex/luatex-ini.opm index 872d808ee99..315836cab11 100644 --- a/Master/texmf-dist/tex/luatex/optex/luatex-ini.opm +++ b/Master/texmf-dist/tex/luatex/optex/luatex-ini.opm @@ -1,6 +1,6 @@ -%% This is part of SpTeX project, see http://petr.olsak.net/optex +%% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \pdfprimitive {LuaTeX initialization code <2020-01-23>} +\_codedecl \pdfprimitive {LuaTeX initialization code <2020-02-21>} % preloaded in format \_let\_pdfpagewidth \pagewidth \_let\_pdfpageheight \pageheight diff --git a/Master/texmf-dist/tex/luatex/optex/makeindex.opm b/Master/texmf-dist/tex/luatex/optex/makeindex.opm index eae300dfba1..5f13f5ca5ae 100644 --- a/Master/texmf-dist/tex/luatex/optex/makeindex.opm +++ b/Master/texmf-dist/tex/luatex/optex/makeindex.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \makeindex {Makeindex and sorting <2020-02-14>} % loaded in format +\_codedecl \makeindex {Makeindex and sorting <2020-03-16>} % loaded in format \_doc ----------------------------- `\makeindex` implements sorting algorithm at \TeX/ macrolanguage level. @@ -104,9 +104,12 @@ \_ea\_let \_ea\_sortingdata \_csname _sortingdata\_sortinglang\endcsname \_ea\_let \_ea\_compoundchars \_csname _compoundchars\_sortinglang\endcsname \_ea\_let \_ea\_ignoredchars \_csname _ignoredchars\_sortinglang\endcsname - \_ifx \_sortingdata\_relax \_let \_sortingdata = \_sortingdataen \fi - \_ifx \_compoundchars\_relax \_let \_compoundchars = \_compoundcharsen \fi - \_ifx \_ignoredchars\_relax \_let \_ignoredchars = \_ignoredcharsen \fi + \_ifx \_sortingdata\_relax \_addto\_nold{ sortingdata}% + \_let \_sortingdata = \_sortingdataen \fi + \_ifx \_compoundchars\_relax \_addto\_nold{ compoundchars}% + \_let \_compoundchars = \_compoundcharsen \fi + \_ifx \_ignoredchars\_relax \_addto\_nold{ ignoredchars}% + \_let \_ignoredchars = \_ignoredcharsen \fi \_ifx \_compoundchars\_empty \_else \_edef \_compoundchars {\_detokenize\_ea{\_compoundchars} }\_fi % all must be catcode 12 \_def \_act ##1{\_ifx##1\_relax \_else @@ -247,7 +250,8 @@ \_newifi \_ifasciisorting \_asciisortingfalse \_def\_dosorting #1{% \begingroup - \_ifx\_sotringlang\_undefined \_edef\_sortinglang{\_cs{_lan:\_the\_language}}\_fi + \_def\_nold{}% + \_ifx\_sotringlang\_undefined \_edef\_sortinglang{\_cs{_lan:\_the\_language}}\_fi \_ifasciisorting \_edef\_sortinglang{ASCII}% \_def \_preparesorting##1{\_edef\_tmpb{\_ea\_ignorefirst\_csstring##1}}% @@ -256,6 +260,7 @@ \_setprimarysorting \_fi \_message{OpTeX: Sorting \_string#1 (\_sortinglang) ...^^J}% + \_ifx\_nold\_empty\_else \_opwarning{Missing\_nold\_space for language (\_sortinglang)}\_fi \_def \_act##1{\_preparesorting ##1\_edef##1{\_tmpb}}% \_ea\_xargs \_ea\_act #1;% \_def \_act##1{\_addto #1{##1,}}% @@ -268,7 +273,7 @@ \_doc ----------------------------- The `\makeindex` prints the index. First, it sorts the `\_iilist` second, it prints the sorted `\_iilist`, each item is printed - using `\_printiitem`. + using `\_printindexitem`. \_cod ----------------------------- \_def\_makeindex{\_par @@ -295,7 +300,7 @@ \_ifcsname _\_csstring #1\_endcsname \_ea\_ea\_ea \_printii \_csname _\_csstring #1\_endcsname &% \_else - \_ea\_printii \_ea\_ignorefirst \_csstring #1&% + \_ea\_ea\_ea\_printii \_ea\_ignorefirst \_csstring #1&% \_fi \_ea\_printiipages #1& } @@ -305,16 +310,27 @@ words in the form `//`. The `\everyii` tokens register is applied before `\noindent`. User can declare something special here. + + The `\_newiiletter{}` macro is empty by default. It is invoked if first + letter of index entries is changed. You can declare a design between + index entries here. You can try, for example: + \begtt + \def\_newiiletter#1#2{\bigskip\hbox{\setfontsize{at15pt}\bf\uppercase{#1}}\medskip} + \endtt \_cod ----------------------------- -\_def\_printii #1&{\_gdef\_currii{#1}\_the\_everyii\_noindent - \_hskip-\_iindent \_ignorespaces\_printiiA#1//} +\_def\_printii #1#2&{% + \_ismacro\_lastii{#1}\_iffalse \_newiiletter{#1}{#2}\_def\_lastii{#1}\_fi + \_gdef\_currii{#1#2}\_the\_everyii\_noindent + \_hskip-\_iindent \_ignorespaces\_printiiA#1#2//} \_def\_printiiA #1/{\_if^#1^\_let\_previi=\_currii \_else \_ea\_scanprevii\_previi/&\_edef\_tmpb{\_detokenize{#1}}% \_ifx\_tmpa\_tmpb \_iiemdash \_else#1 \_gdef\_previi{}\_fi \_expandafter\_printiiA\_fi } \_def\_iiemdash{\_kern.1em---\_space} +\_def\_lastii{} +\_def\_newiiletter#1#2{} \_def\_scanprevii#1/#2&{\_def\_previi{#2}\_edef\_tmpa{\_detokenize{#1}}} \_def\_previi{} % previous index item @@ -362,12 +378,14 @@ \_cod ----------------------------- \_def\_pgprint #1:#2{% - \_ifx,#2,\_pgprintA{#1}\_returnfi \_fi + \_ifx ,#2,\_pgprintA{#1}\_returnfi \_fi \_ifx b#2{\_bf \_pgprintA{#1}}\_returnfi \_fi - \_ifx i#2{\_it \_pfprintA{#1}}\_returnfi \_fi + \_ifx i#2{\_it \_pgprintA{#1}}\_returnfi \_fi + \_ifx u#2\_pgu{\_pgprintA{#1}}\_returnfi \_fi \_pgprintA{#1}\_relax } \_def\_pgprintA #1{\_ilink[pg:#1]{\_cs{_pgi:#1}}} % \ilink[pg:]{} +\_def\_pgu#1{\_leavevmode\_vtop{\_hbox{#1}\kern.3ex\_hrule}} \_doc ----------------------------- The `\iindex{}` puts one to the index. It writes diff --git a/Master/texmf-dist/tex/luatex/optex/maketoc.opm b/Master/texmf-dist/tex/luatex/optex/maketoc.opm index 6589c66f728..6ab711657ec 100644 --- a/Master/texmf-dist/tex/luatex/optex/maketoc.opm +++ b/Master/texmf-dist/tex/luatex/optex/maketoc.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \maketoc {Macros for maketoc <2020-02-14>} +\_codedecl \maketoc {Macros for maketoc <2020-03-12>} % preloaded in format \_doc ------------------------------------ `\_Xtoc{}{}{}{}` (in `.ref` file) reads the diff --git a/Master/texmf-dist/tex/luatex/optex/margins.opm b/Master/texmf-dist/tex/luatex/optex/margins.opm index 9503bc3940a..72c769f672a 100644 --- a/Master/texmf-dist/tex/luatex/optex/margins.opm +++ b/Master/texmf-dist/tex/luatex/optex/margins.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \margins {Macros for margins setting <2019-05-21>} +\_codedecl \margins {Macros for margins setting <2020-03-14>} % preloaded in format \_newdimen\_pgwidth \_newdimen\_pgheight \_pgwidth=0pt \_newdimen\_shiftoffset @@ -65,8 +65,8 @@ OPmac declares paper formats a4, a4l (landscape~a4), a5, a5l, b5, letter and user can declare another own format by "\sdef": \begtt -\sdef{pgs:b5l}{(250,176)mm} -\sdef{pgs:letterl}{(11,8.5)in} +\sdef{_pgs:b5l}{(250,176)mm} +\sdef{_pgs:letterl}{(11,8.5)in} \endtt The "\margins" command declares margins of the document. This command have diff --git a/Master/texmf-dist/tex/luatex/optex/math-macros.opm b/Master/texmf-dist/tex/luatex/optex/math-macros.opm index ebd32fe2143..6ad97618ff8 100644 --- a/Master/texmf-dist/tex/luatex/optex/math-macros.opm +++ b/Master/texmf-dist/tex/luatex/optex/math-macros.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \sin {Math macros plus mathchardefs <2020-02-14>} +\_codedecl \sin {Math macros plus mathchardefs <2020-03-14>} % preloaded in format %% The character _ as subscript prefix: diff --git a/Master/texmf-dist/tex/luatex/optex/math-preload.opm b/Master/texmf-dist/tex/luatex/optex/math-preload.opm index 8ced2c1cc07..5251f09424c 100644 --- a/Master/texmf-dist/tex/luatex/optex/math-preload.opm +++ b/Master/texmf-dist/tex/luatex/optex/math-preload.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \normalmath {Math fonts CM + AMS preloaded <2020-01-23>} +\_codedecl \normalmath {Math fonts CM + AMS preloaded <2020-02-25>} % preloaded in format % Only few text fonts are preloaded: diff --git a/Master/texmf-dist/tex/luatex/optex/math-unicode.opm b/Master/texmf-dist/tex/luatex/optex/math-unicode.opm index cf800ca5408..fe823b96f4a 100644 --- a/Master/texmf-dist/tex/luatex/optex/math-unicode.opm +++ b/Master/texmf-dist/tex/luatex/optex/math-unicode.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \loadmath {Unicode Math fonts <2020-02-14>} +\_codedecl \loadmath {Unicode Math fonts <2020-02-25>} % preloaded in format \_newifi \_ifmathloading \_mathloadingtrue diff --git a/Master/texmf-dist/tex/luatex/optex/more-macros.opm b/Master/texmf-dist/tex/luatex/optex/more-macros.opm new file mode 100644 index 00000000000..4f4c4d113bc --- /dev/null +++ b/Master/texmf-dist/tex/luatex/optex/more-macros.opm @@ -0,0 +1,138 @@ +%% This is part of OpTeX project, see http://petr.olsak.net/optex + +\_codedecl \eoldef {OpTeX useful macos <2020-03-15>} % preloaded in format + +\_newcatcodetable \_optexcatcodes +\_savecatcodetable\_optexcatcodes + +\_def\_normalcatcodes {\_catcodetable\_optexcatcodes \_savecatcodetable0 \_catcodetable0 } + +\_newcatcodetable \_plaintexcatcodes +\_public + \optexcatcodes \plaintexcatcodes ; + +{\_catcode`_=8 \savecatcodetable\plaintexcatcodes} + +% \catcodetable stack +% use \setctable ... \setctable ... \restorectable ... \restorectable + +\_newcount\_currctable \_currctable=0 +\_catcodetable0 + +\_def\_setctable#1{\_edef\_ctablelist{{\_the\_currctable}\_ctablelist}% + \_catcodetable#1\_relax \_currctable=#1\_relax +} +\_def\_restorectable{\_ea\_restorectableA\_ctablelist\_relax} +\_def\_restorectableA#1#2\_relax{% + \_ifx^#2^\_opwarning + {You can't use \_noindent\restorectable without previous \_string\setctable}% + \_else \_def\_ctablelist{#2}\_catcodetable#1\_relax \_currctable=#1\_relax \_fi +} +\_def\_ctablelist{.} + +\_def\_opinput #1{\_setctable\_optexcatcodes \_input "#1" \_restorectable} + + +% \optdef \foo [opt-default] #1#2{...\the\opt...}, usage \foo {}{} or \foo [opt] {}{} + +\_def\_optdef#1[#2]{% + \_def#1{\_opt={#2}\_isnextchar[{\_cs{_oA:\_string#1}}{\_cs{_oB:\_string#1}}}% + \_sdef{_oA:\_string#1}[##1]{\_opt={##1}\_cs{_oB:\string#1\_nospaceafter}}% + \_sdef{_oB:\_string#1\_nospaceafter}% +} +\_def\_nospaceafter#1{\_ea#1\_romannumeral-`\.} + +\_newtoks\_opt + +% \eoldef \foo #1{thex to end of line is: #1} + +\_def\_eoldef #1{\_def #1{\_begingroup \_catcode`\^^M=12 \_eoldefA #1}% + \_ea\_def\_csname _\_csstring #1:M\_endcsname} +\_catcode`\^^M=12 % +\_def\_eoldefA #1#2^^M{\_endgroup\_csname _\_csstring #1:M\_endcsname{#2}}% +\_normalcatcodes % +\_eoldef\_skiptoeol#1{} + +\_def\_bracedparam#1{\_ifcsname _\_csstring #1:M\_endcsname + \_csname _\_csstring #1:M\_ea \_endcsname + \_else \_csname __in\_csstring #1:M\_ea \_endcsname \_fi +} + + +\_public \opt \optdef \eoldef \skiptoeol ; + +\_catcode`!=3 \_catcode`?=3 +\_def\_replstring #1#2#3{% \replstring #1{stringA}{stringB} + \_long\_def\_replacestringsA##1#2{\_def #1{##1}\_replacestringsB}% + \_long\_def\_replacestringsB##1#2{\_ifx!##1\_relax \_else \_addto #1{#3##1}% + \_ea\_replacestringsB\_fi}% + \_ea\_replacestringsA #1?#2!#2% + \_long\_def\_replacestringsA##1?{\_def #1{##1}}\_ea\_replacestringsA #1} +\_normalcatcodes + +\_def\_remfirstunderscore#1{\_ea\_remfirstunderscoreA#1\_relax#1} +\_def\_remfirstunderscoreA#1#2\_relax#3{\_if _#1\_def#3{#2}\_fi} + +\_ea\_def \_ea\_meaningsepare \_ea#\_ea1\_string m#2:#3->#4^{{#1}{#3}{#4}} + +% \keepinputnames ... \input foo ... \lastinputname -> foo + +\_def\_keepinputnames{\_directlua{% + callback.register("find_read_file", + function (id, name) + input_file_name = name + return name + end) +}} +\_def\_lastinputname{\_directlua{tex.print(input_file_name)}} + +\def\catcode{\_catcode\_string} % more robust in cases \catcode` or \catcode" + +% \removespaces text with spaces {} -> textwithspaces + +\_def\_removespaces #1 {\_isempty{#1}\_iffalse #1\_ea\_removespaces\_fi} + + \_doc ---------------------------- + `\trycs{}{} expands to \ if it is defined else to . + \_cod ---------------------------- + +\_def \_trycs#1#2{\_ifcsname #1\_endcsname \_csname #1\_endcsname \_else #2\_fi} + + \_doc ------------------ + The pair {`\_doc ... \cod`} is used for documenting macros and to + printing the third part of main \OpTeX/ documentation: The + implementation. The syntax is: + {\begtt + \_doc + + \_cod + \endtt} + The last {\_cod} in the file must be followed by `\_fin`. This is a + signal, that the following code does not ends by next `\_doc` but by + {`\_endcode`} command. The {`\_doc...\cod`} is redefined in macros used + for documentation printing. + + The (and too) must be . + It means that you canot document only `{` but you must document `}` too. + \_cod ------------------ + +\_long\_def\_doc #1\_cod {\_skiptoeol} + +\_ea \_def \_ea\_ignorept \_ea#\_ea1\detokenize{pt}{#1} +\_def\_ignoreit#1{} + +\public + \setctable \restorectable + \normalcatodes \opt \optdef \eoldef \bracedparam \replstring + \keepinputnames \lastinputname \removespaces \trycs + \ignorept \ignoreit ; + +\_endcode % ------------------------------------- + + + +The `\ignoreit` macro ignores next token. The \ignorept macro used ike this: +\begtt +\ea\ignorept \the\dimen... +\endtt +consumes the "pt" phrase appended to dimen value by `\the`. diff --git a/Master/texmf-dist/tex/luatex/optex/multicolumns.opm b/Master/texmf-dist/tex/luatex/optex/multicolumns.opm index cc5a0fad091..291eb1cfd0a 100644 --- a/Master/texmf-dist/tex/luatex/optex/multicolumns.opm +++ b/Master/texmf-dist/tex/luatex/optex/multicolumns.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \begmulti {Balanced columns <2020-03-08>} +\_codedecl \begmulti {Balanced columns <2020-03-08>} % preloaded in format \_doc ----------------------------- This code is documented in detail in the \"\TeX/book naruby", pages 244--246, diff --git a/Master/texmf-dist/tex/luatex/optex/op-macros.opm b/Master/texmf-dist/tex/luatex/optex/op-macros.opm deleted file mode 100644 index 4cbb923b4cb..00000000000 --- a/Master/texmf-dist/tex/luatex/optex/op-macros.opm +++ /dev/null @@ -1,140 +0,0 @@ -%% This is part of OpTeX project, see http://petr.olsak.net/optex - -\_codedecl \eoldef {OpTeX useful macos <2020-02-14>} - -\_newcatcodetable \_optexcatcodes -\_savecatcodetable\_optexcatcodes - -\_def\_normalcatcodes {\_catcodetable\_optexcatcodes \_savecatcodetable0 \_catcodetable0 } - -\_newcatcodetable \_plaintexcatcodes -\_public - \optexcatcodes \plaintexcatcodes ; - -{\_catcode`_=8 \savecatcodetable\plaintexcatcodes} - -% \catcodetable stack -% use \setctable ... \setctable ... \restorectable ... \restorectable - -\_newcount\_currctable \_currctable=0 -\_catcodetable0 - -\_def\_setctable#1{\_edef\_ctablelist{{\_the\_currctable}\_ctablelist}% - \_catcodetable#1\_relax \_currctable=#1\_relax -} -\_def\_restorectable{\_ea\_restorectableA\_ctablelist\_relax} -\_def\_restorectableA#1#2\_relax{% - \_ifx^#2^\_opwarning - {You can't use \_noindent\restorectable without previous \_string\setctable}% - \_else \_def\_ctablelist{#2}\_catcodetable#1\_relax \_currctable=#1\_relax \_fi -} -\_def\_ctablelist{.} - -\_def\_opinput #1{\_setctable\_optexcatcodes \_input "#1" \_restorectable} - - -% \optdef \foo [opt-default] #1#2{...\the\opt...}, usage \foo {}{} or \foo [opt] {}{} - -\_def\_optdef#1[#2]{% - \_def#1{\_opt={#2}\_isnextchar[{\_cs{_oA:\_string#1}}{\_cs{_oB:\_string#1}}}% - \_sdef{_oA:\_string#1}[##1]{\_opt={##1}\_cs{_oB:\string#1\_nospaceafter}}% - \_sdef{_oB:\_string#1\_nospaceafter}% -} -\_def\_nospaceafter#1{\_ea#1\_romannumeral-`\.} - -\_newtoks\_opt - -% \eoldef \foo #1{thex to end of line is: #1} - -\_def\_eoldef #1{\_def #1{\_begingroup \_catcode`\^^M=12 \_eoldefA #1}% - \_ea\_def\_csname _\_csstring #1:M\_endcsname} -\_catcode`\^^M=12 % -\_def\_eoldefA #1#2^^M{\_endgroup\_csname _\_csstring #1:M\_endcsname{#2}}% -\_normalcatcodes % -\_eoldef\_skiptoeol#1{} - -\_def\_bracedparam#1{\_ifcsname _\_csstring #1:M\_endcsname - \_csname _\_csstring #1:M\_ea \_endcsname - \_else \_csname __in\_csstring #1:M\_ea \_endcsname \_fi -} - - -\_public \opt \optdef \eoldef \skiptoeol ; - -\_catcode`!=3 \_catcode`?=3 -\_def\_replstring #1#2#3{% \replstring #1{stringA}{stringB} - \_long\_def\_replacestringsA##1#2{\_def #1{##1}\_replacestringsB}% - \_long\_def\_replacestringsB##1#2{\_ifx!##1\_relax \_else \_addto #1{#3##1}% - \_ea\_replacestringsB\_fi}% - \_ea\_replacestringsA #1?#2!#2% - \_long\_def\_replacestringsA##1?{\_def #1{##1}}\_ea\_replacestringsA #1} -\_normalcatcodes - -\_def\_remfirstunderscore#1{\_ea\_remfirstunderscoreA#1\_relax#1} -\_def\_remfirstunderscoreA#1#2\_relax#3{\_if _#1\_def#3{#2}\_fi} - -\_ea\_def \_ea\_meaningsepare \_ea#\_ea1\_string m#2:#3->#4^{{#1}{#3}{#4}} - -% \keepinputnames ... \input foo ... \lastinputname -> foo - -\_def\_keepinputnames{\_directlua{% - callback.register("find_read_file", - function (id, name) - input_file_name = name - return name - end) -}} -\_def\_lastinputname{\_directlua{tex.print(input_file_name)}} - -\def\catcode{\_catcode\_string} % more robust in cases \catcode` or \catcode" - -\_def\_enquotes{\_chardef\"="201C } % use \"text" for English quotes - -% \removespaces text with spaces {} -> textwithspaces - -\_def\_removespaces #1 {\_isempty{#1}\_iffalse #1\_ea\_removespaces\_fi} - - \_doc ---------------------------- - `\trycs{}{} expands to \ if it is defined else to . - \_cod ---------------------------- - -\_def \_trycs#1#2{\_ifcsname #1\_endcsname \_csname #1\_endcsname \_else #2\_fi} - - \_doc ------------------ - The pair {`\_doc ... \cod`} is used for documenting macros and to - printing the third part of main \OpTeX/ documentation: The - implementation. The syntax is: - {\begtt - \_doc - - \_cod - \endtt} - The last {\_cod} in the file must be followed by `\_fin`. This is a - signal, that the following code does not ends by next `\_doc` but by - {`\_endcode`} command. The {`\_doc...\cod`} is redefined in macros used - for documentation printing. - - The (and too) must be . - It means that you canot document only `{` but you must document `}` too. - \_cod ------------------ - -\_long\_def\_doc #1\_cod {\_skiptoeol} - -\_ea \_def \_ea\_ignorept \_ea#\_ea1\detokenize{pt}{#1} -\_def\_ignoreit#1{} - -\public - \setctable \restorectable - \normalcatodes \opt \optdef \eoldef \bracedparam \replstring - \keepinputnames \lastinputname \enquotes \removespaces \trycs - \ignorept \ignoreit ; - -\_endcode % ------------------------------------- - - - -The `\ignoreit` macro ignores next token. The \ignorept macro used ike this: -\begtt -\ea\ignorept \the\dimen... -\endtt -consumes the "pt" phrase appended to dimen value by `\the`. diff --git a/Master/texmf-dist/tex/luatex/optex/opmac-rest.opm b/Master/texmf-dist/tex/luatex/optex/opmac-rest.opm deleted file mode 100644 index f8731fefdab..00000000000 --- a/Master/texmf-dist/tex/luatex/optex/opmac-rest.opm +++ /dev/null @@ -1,65 +0,0 @@ -% I plan to re-implement all macros from this file. Something is done already. - -% OPmac -%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Petr Olsak, 2012 -- 2019 - -%% The history of versions is at the end of this file, after \endpinput - -\ifx\OPmacversion\undefined \else \endinput \fi -\def\OPmacversion{Jul. 2019} -\immediate\write16{This is OPmac-rest, version <\OPmacversion>} - -%%%%%%%%%%%%%% Basic macros, sec. 3.1 in opmac-d.pdf - -%\newif\ifpdftex \pdftextrue - -%%%%%%%%%%%%%% Global parameters, sec. 3.2 in opmac-d.pdf - -%%%%%%%%%%%%%% OPmac, CSplain and LaTeX logos, sec. 3.3 in opmac-d.pdf - -%%%%%%%%%%%%%% Sizes of fonts and \baselineskip, sec. 3.4 in opmac-d.pdf - -%%%%%%%%%%%%%% Multilingual support, sec. 3.5 in opmac-d.pdf - -%%%%%%%%%%%%%% REF file, sec 3.6 in opmac-d.pdf - -%%%%%%%%%%%%%% \label, \ref, \pgref, sec. 3.7 in opmac-d.pdf - -%%%%%%%%%%%%%% Chapters, sections, subsections -- sec. 3.8 in opmac-d.pdf - -%%%%%%%%%%%%%% Captions, equations -- sec. 3.9 in opmac-d.pdf - -%%%%%%%%%%%%%% Items -- sec. 3.10 in opmac-d.pdf - -%%%%%%%%%%%%%% TOC -- sec. 3.11 in opmac-d.pdf - -%%%%%%%%%%%%%% Index -- sec. 3.12 on opmac-d.pdf - -%%%%%%%%%%%%%% \begmulti ... \endmulti TBN p. 244, 245 -- sec. 3.14 in opmac-d.pdf - -%%%%%%%%%%%%%% Colors -- sec. 3.15 in opmac-d.pdf - -%%%%%%%%%%%%%% Hyperrefs -- sec. 3.16 in opmac-d.pdf - -%%%%%%%%%%%%%% Outlines -- sec. 3.17 in opmac-d.pdf - -%%%%%%%%%%%%%% Verbatim, \begtt, \endtt -- sec. 3.18 in opmac-d.pdf - -%%%%%%%%%%%%%% \table -- sec. 3.19 in opmac-d.pdf - -%%%%%%%%%%%%%% \inspic -- sec. 3.20 in opmac-d.pdf - -%%%%%%%%%%%%%%% transformation matrix -- sec. 3.21 in opmac-d.pdf - -%%%%%%%%%%%%%% \fnote, \mnote -- sec 3.22 in opmac-d.pdf - -%%%%%%%%%%%%%% \cite, \bib, \usebibtex, \usebbl -- sec. 3.23 in opmac-d.pdf - -%%%%%%%%%%%%%% output -- sec. 3.24 in opmac-d.pdf - -%%%%%%%%%%%%%% margins -- sec. 3.25 in opmac-d.pdf - -%%%%%%%%%%%%%% Pre-defined document styles - -\endinput diff --git a/Master/texmf-dist/tex/luatex/optex/optex.ini b/Master/texmf-dist/tex/luatex/optex/optex.ini index 370f60f0993..e4a09eec0af 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.06 Mar 2020} +\def\optexversion{Alpha 0.07 Mar 2020} % Engine testing: @@ -50,7 +50,7 @@ \input alloc.opm % allocators for registers \input if-macros.opm % special \if-macros, \is-macros and loops \input parameters.opm % parameters setting -\input op-macros.opm % OpTeX useful macros (todo: doc) +\input more-macros.opm % OpTeX useful macros (todo: doc) \input plain-macros.opm % plainTeX macros (todo:doc) \input fonts-preload.opm % preloaded Latin Modern fonts \input fonts-resize.opm % font resizing (low-level macros) (todo: texdoc) diff --git a/Master/texmf-dist/tex/luatex/optex/others.opm b/Master/texmf-dist/tex/luatex/optex/others.opm index 7043a7589cb..4c6b49dd2de 100644 --- a/Master/texmf-dist/tex/luatex/optex/others.opm +++ b/Master/texmf-dist/tex/luatex/optex/others.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \uv {Miscenaleous <2020-01-23>} +\_codedecl \uv {Miscenaleous <2020-03-14>} % preloaded in format % You can write \useOpTeX at begining of your document diff --git a/Master/texmf-dist/tex/luatex/optex/outlines.opm b/Master/texmf-dist/tex/luatex/optex/outlines.opm index fbad18cb206..90e9a4a0aa1 100644 --- a/Master/texmf-dist/tex/luatex/optex/outlines.opm +++ b/Master/texmf-dist/tex/luatex/optex/outlines.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \pdfunidef {PDF outlines <2019-05-21>} +\_codedecl \pdfunidef {PDF outlines <2020-03-12>} % preloaded in format \_def\_outlines#1{\_pdfcatalog{/PageMode/UseOutlines}\_openref \_ifx\_toclist\_empty diff --git a/Master/texmf-dist/tex/luatex/optex/output.opm b/Master/texmf-dist/tex/luatex/optex/output.opm index 0bdefdb1ec6..a81e5e8c0a5 100644 --- a/Master/texmf-dist/tex/luatex/optex/output.opm +++ b/Master/texmf-dist/tex/luatex/optex/output.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \nopagenumbers {Output routine <2019-05-21>} +\_codedecl \nopagenumbers {Output routine <2020-03-15>} % preloaded in format \_doc ----------------------------- `\_optexouput` is default output routine. You can create another... @@ -180,20 +180,17 @@ water color marks. \_cod ----------------------------- -\_def\_draft{\_pgbackground={\_setdraftfont \_draftbox{\_draftfont DRAFT}}} - -\_def\_draftbox#1{\_setbox0=\_hbox{#1}% +\_def \_draft {\_pgbackground={\_draftbox{\_draftfont DRAFT}}% + \_fontdef\_draftfont{\_setfontsize{at10pt}\_bf}% + \_global\_let\_draftfont=\_draftfont +} +\_def \_draftbox #1{\_setbox0=\_hbox{#1}% \_kern.5\_vsize \_kern4.5\_wd0 \_hbox to0pt{\_kern.5\_hsize \_kern-1\_wd0 \_pdfsave \_pdfrotate{55}\_pdfscale{10}{10}% \_hbox to0pt{\_localcolor\LightGrey \_box0\_hss}% \_pdfrestore - \_hss}} -\_def\_setdraftfont {% - \_ifx \_draftfont\_undefined - \_fontdef\_draftfont{\_setfontsize{at10pt}\_bf}% - \_global\_let\_draftfont=\_draftfont - \_fi + \_hss}% } \_public \draft ; diff --git a/Master/texmf-dist/tex/luatex/optex/parameters.opm b/Master/texmf-dist/tex/luatex/optex/parameters.opm index 23702de37ad..4ae0aa4d98f 100644 --- a/Master/texmf-dist/tex/luatex/optex/parameters.opm +++ b/Master/texmf-dist/tex/luatex/optex/parameters.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \normalbaselineskip {Parameter settings <2020-01-23>} +\_codedecl \normalbaselineskip {Parameter settings <2020-03-17>} % preloaded in format \_doc ----------------------------- The primitive registers with the same default value as in plain \TeX/ follow: @@ -241,12 +241,15 @@ \_doc ----------------------------- The default item mark used between `\bgitems` and `\enditems` is bullet. The `\everyitem` token list is applied in vertical mode - at the start of each item. + at the start of each item. + The `\everybegitems` token list is applied after group is openem by + `\begitems`. \_cod ----------------------------- \_newtoks\_defaultitem \_defaultitem={$\_bullet$\_enspace} \_newtoks\_everyitem -\_public \defaultitem \everyitem ; +\_newtoks\_everybegitems +\_public \defaultitem \everyitem \everybegitems ; \_doc ----------------------------- The `\tit` macro includes `\vglue\titskip` above the title of the document. diff --git a/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm b/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm index 0aafcce27a0..e993e61a756 100644 --- a/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm +++ b/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \pdfunidef {PDFunicode strings for outlines <2020-02-14>} +\_codedecl \pdfunidef {PDFunicode strings for outlines <2020-03-12>} % preloaded in format \_edef\_octalprint#1#2{\_noexpand\_directlua{% #1=character-code #2=character if ('#2'>='A' and '#2'<='Z') or ('#2'>='a' and '#2'<='z') then diff --git a/Master/texmf-dist/tex/luatex/optex/plain-macros.opm b/Master/texmf-dist/tex/luatex/optex/plain-macros.opm index a9e4f2de1b7..18576c1ad72 100644 --- a/Master/texmf-dist/tex/luatex/optex/plain-macros.opm +++ b/Master/texmf-dist/tex/luatex/optex/plain-macros.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \magstep {Macros from plain TeX <2019-02-14>} +\_codedecl \magstep {Macros from plain TeX <2020-02-14>} % preloaded in format \_chardef\_active = 13 diff --git a/Master/texmf-dist/tex/luatex/optex/prefixed.opm b/Master/texmf-dist/tex/luatex/optex/prefixed.opm index 06c46ee65db..e6015bc7cb5 100644 --- a/Master/texmf-dist/tex/luatex/optex/prefixed.opm +++ b/Master/texmf-dist/tex/luatex/optex/prefixed.opm @@ -1,7 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \public {Prefixing and code syntax <2020-02-14>} - +\_codedecl \public {Prefixing and code syntax <2020-02-14>} % preloaded in format \_doc --------- All TeX82 primitives have alternative control sequence \_hbox \_string, ... diff --git a/Master/texmf-dist/tex/luatex/optex/ref-file.opm b/Master/texmf-dist/tex/luatex/optex/ref-file.opm index ba76563ca0a..5f2b50f06d2 100644 --- a/Master/texmf-dist/tex/luatex/optex/ref-file.opm +++ b/Master/texmf-dist/tex/luatex/optex/ref-file.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \_openref {File for references <2020-02-14>} +\_codedecl \openref {File for references <2020-02-14>} % preloaded in format \_doc -------------------------- The `\_inputref` macro is used in `\everyjob`. It reads `\jobname.ref` file @@ -44,6 +44,7 @@ \_immediate\_write\_reffile {\_pcent\_pcent\_space OPTeX <\_optexversion> - REF file (#1)}% \_immediate\_wref \Xrefversion{{\_REFversion}}% } +\def\openref{\_openref} \_doc ---------------------- We are using a convention that the macros used in `.ref` file are named diff --git a/Master/texmf-dist/tex/luatex/optex/references.opm b/Master/texmf-dist/tex/luatex/optex/references.opm index 37d06982141..3cd27c043e7 100644 --- a/Master/texmf-dist/tex/luatex/optex/references.opm +++ b/Master/texmf-dist/tex/luatex/optex/references.opm @@ -1,11 +1,10 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \ref {References <2020-02-22>} +\_codedecl \ref {References <2020-03-03>} % preloaded in format \_doc ---------------------------- - `\_Xpage {}{}` saves the patameter pair into `\_currpage` - and actualizes `\lastpage`. Resets `\_lfnotenum` used if footnotes are - numbered from one at each page. + `\_Xpage {}{}` saves the patameter pair into `\_currpage`. + Resets `\_lfnotenum`, it is used if footnotes are numbered from one at each page. \_cod ---------------------------- \_def\_Xpage#1#2{\_def\_currpage{{#1}{#2}}\_lfnotenum=0 } @@ -31,6 +30,7 @@ \_def\_wlabel#1{% \_ifx\_lastlabel\_undefined \_else \_dest[ref:\_lastlabel]% + \_printlabel\_lastlabel \_edef\_tmp{{\_lastlabel}{#1}}% \_ea\_wref \_ea\_Xlabel \_ea{\_tmp}% \_sxdef{_lab:\_lastlabel}{#1}\_sxdef{l0:\_lastlabel}{}% @@ -62,6 +62,19 @@ \_public \label \wlabel \ref \pgref ; + \_doc ----------------------------- + Default `\_printlabel` is empty (labes are not printed). + The `\showlabels` redefines it as box with zero dimensions and + with left lapped `[