From 66f7d795ee15bbbe970dccad9b0d5ecb1e9d4884 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 14 Jan 2021 21:53:33 +0000 Subject: optex (13jan21) git-svn-id: svn://tug.org/texlive/trunk@57419 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/luatex/optex/base/ref-file.opm | 64 +++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'Master/texmf-dist/tex/luatex/optex/base/ref-file.opm') diff --git a/Master/texmf-dist/tex/luatex/optex/base/ref-file.opm b/Master/texmf-dist/tex/luatex/optex/base/ref-file.opm index c5fa3965245..fd7c1101d76 100644 --- a/Master/texmf-dist/tex/luatex/optex/base/ref-file.opm +++ b/Master/texmf-dist/tex/luatex/optex/base/ref-file.opm @@ -1,4 +1,4 @@ -%% This is part of OpTeX project, see http://petr.olsak.net/optex +%% This is part of the OpTeX project, see http://petr.olsak.net/optex \_codedecl \openref {File for references <2020-02-14>} % preloaded in format @@ -13,16 +13,16 @@ \_def\_inputref {% \_isfile{\_jobname.ref}\_iftrue \_input {\_jobname.ref} - \_gfnotenum=0 \_lfnotenum=0 \_mnotenum=0 + \_gfnotenum=0 \_lfnotenum=0 \_mnotenum=0 \_openrefA{\_string\_inputref}% \_fi } \_doc -------------------------- - If the file does not exists then it is not created by default. It means that if you + If the file does not exist then it is not created by default. 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 dummy in - such case. + file is created because it is unusable. The \^`\_wref` macro is a dummy in + this case. \_cod -------------------------- \_def\_wrefrelax#1#2{} @@ -31,10 +31,10 @@ \_doc --------------------- If a macro needs to create and to use `.ref` file then such macro must use \`\openref`. When the file is created (using internal \`\_openrefA`) then - the \`\_wref` `\{}` is redefined in order to + the \`\_wref` `\{}` is redefined in order to save the line `\` to the `.ref` file using asynchronous - `\write` primitive. Finally, the `\_openref` destroys itself, because we - need not to open the file again. + `\write` primitive. Finally, the `\_openref` destroys itself, because we + need not open the file again. \_cod --------------------- \_def\_openref {% @@ -42,25 +42,25 @@ \_gdef\_openref{}% } \_def\_openrefA #1{% - \_immediate\_openout\_reffile="\_jobname.ref"\_relax - \_gdef\_wref ##1##2{\_write\_reffile{\_string##1##2}}% + \_immediate\_openout\_reffile="\_jobname.ref"\_relax + \_gdef\_wref ##1##2{\_write\_reffile{\_bslash\_csstring##1##2}}% \_immediate\_write\_reffile {\_pcent\_pcent\_space OPTeX <\_optexversion> - REF file (#1)}% \_immediate\_wref \Xrefversion{{\_REFversion}}% } \def\openref{\_openref} \_doc ---------------------- - We are using convention that the macros used in `.ref` file are named - `\_X`. If there is a new version 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/ or by OPmac. So first line of `.ref` file is in + We are using the convention that the macros used in `.ref` file are named + `\_X`. If there is a new version of \OpTeX/ with a different collection + of such macros then we don't want to read the `.ref` files produced by an + old version of \OpTeX/ or by OPmac. So the first line of `.ref` file is in the form \begtt \catcode`\<=13 \Xrefversion{} - \endtt + \endtt We can check the version compatibility by this macro. - Because OPmac does not understand `\_Xrefversion` we use - \`\Xrefversion` (with different number of `` form OPmac) here. + Because OPmac does not understand `\_Xrefversion` we use + \`\Xrefversion` (with a different number of `` form OPmac) here. The result: OPmac skips the `.ref` files produced by \OpTeX/ and vice versa. \_cod ---------------------- @@ -83,13 +83,13 @@ \def\Xfig#1#2#3{\addto\toflist{\tofline{#1}{#2}{#3}}} } \endtt - We must read `` when catcode of `#` is 12 - because we needn't to duplicate each `#` in the `.ref` file. + We must read `` when the catcode of `#` is 12 + because we needn't duplicate each `#` in the `.ref` file. \_cod \_fin ----------------- \_def\_refdecl{\_bgroup \_catcode`\#=12 \_refdeclA} \_def\_refdeclA #1{\egroup\_openref - \_immediate\_write\_reffile {\_pcent\_space \_string \refdecl:}% + \_immediate\_write\_reffile {\_pcent\_space \_string \refdecl:}% \_immediate\_write\_reffile {\_detokenize{#1}}% } \_public \refdecl ; @@ -97,10 +97,10 @@ \_endcode % ================================================ -The `.ref` file has the name `\jobname.ref` and -it saves information about references, TOC lines, etc. +The `.ref` file has the name `\jobname.ref` and +it saves information about references, TOC lines, etc. All data needed in next \TeX/ run are saved here. -\OpTeX/ reads this file at the beginning of the document +\OpTeX/ reads this file at the beginning of the document (using `\everyjob`) if such file exists. The `.ref` file looks like: @@ -116,22 +116,22 @@ The `.ref` file looks like: ... \endtt % -where is internal page number globally numbered from one and -`` is a page number (`\the\pageno`) used in pagination (they may be differ). +where is internal page number globally numbered from one and +`` is a page number (`\the\pageno`) used in pagination (they may differ). Each page begins with \^`\_Xpage`. The `