diff options
author | Karl Berry <karl@freefriends.org> | 2020-06-15 20:43:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-06-15 20:43:56 +0000 |
commit | 56cd0df67df77a677bd72b01d10d2cd5d4581a54 (patch) | |
tree | f6fa19e934db7c0539e137131413a62547cd740b /Master/texmf-dist/tex/luatex/optex/base/more-macros.opm | |
parent | 2c3a20ef9f039b8b2d912828fbdb45f5392b0d5d (diff) |
optex (15jun20)
git-svn-id: svn://tug.org/texlive/trunk@55562 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/optex/base/more-macros.opm')
-rw-r--r-- | Master/texmf-dist/tex/luatex/optex/base/more-macros.opm | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/luatex/optex/base/more-macros.opm b/Master/texmf-dist/tex/luatex/optex/base/more-macros.opm index 51f19198704..595a4f2ed35 100644 --- a/Master/texmf-dist/tex/luatex/optex/base/more-macros.opm +++ b/Master/texmf-dist/tex/luatex/optex/base/more-macros.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \eoldef {OpTeX useful macos <2020-05-03>} % preloaded in format +\_codedecl \eoldef {OpTeX useful macos <2020-05-22>} % preloaded in format \_doc ----------------------------- We define \`\opinput` `{<file name>}` macro which @@ -147,6 +147,30 @@ \_public \eoldef \skiptoeol \bracedparam ; \_doc ----------------------------- + \`\scantoeol``\macro <text to end of line>` scans the + `<text to end of line>` in verbatim mode and runs the + `\macro{<text to end of line>}`. The `\macro` + can be defined `\def\macro#1{...\scantextokens{#1}...}`. + The new tokenization of the parameter is processed when the parameter is used, + no when the parameter is scanned. This principle is used in definition + of \^`\chap`, \^`\sec`, \^`\secc` and \^`\_Xtoc` macros. + It means that user can write \code{\\sec text `&` text} for example. + Inline verbatim works in title sections. + + The verbatim scanner of `\scatoeol` keeps category 7 for `^` in + order to be able to use `^^J` as comment chracter which means that + the next line continues. + \_cod ----------------------------- + +\_def\_scantoeol#1{\def\_tmp{#1}\_begingroup \_setscancatcodes \_scantoeolA} +\_def\_setscancatcodes{\_setverb \_catcode`\^^M=12\_catcode`\^=7\_catcode`\ =10\_catcode`\^^J=14 } +\_catcode`\^^M=12 % +\_def\_scantoeolA#1^^M{\_endgroup \_tmp{#1}}% +\_normalcatcodes % + +\_public \scantoeol ; + + \_doc ----------------------------- The \`\replstring``\macro{<textA>}{<textB>}` replaces all occurrences of `<textA>` by `<textB>` in the `\macro` body. The `\macro` must be defined without parameters. The occurrences of @@ -176,7 +200,8 @@ If you really need primitive `\catcode` then you can use `\_catcode`. \_cod ----------------------------- -\_def\catcode{\_catcode\_string} % more robust in cases \catcode` or \catcode" +\_def\catcode#1{\_catcode \_if`\_noexpand#1\_ea`\_else\_if"\_noexpand#1"\_else + \_if'\_noexpand#1'\_else \_ea\_ea\_ea\_ea\_ea\_ea\_ea#1\_fi\_fi\_fi} \_doc ----------------------------- The \`\removespaces` `<text with spaces >{}` expands to <textwithoutspaces>. @@ -237,5 +262,6 @@ \_endcode % ------------------------------------- +2020-05-22 robust \catcode newly defined in order \catcode\string.... be possible 2020-05-03 \load macro introduced 2020-03-15 released |