diff options
author | Karl Berry <karl@freefriends.org> | 2019-12-11 21:54:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-12-11 21:54:44 +0000 |
commit | 78e912c354fd91abbfb6fe9ba6f869449dab2391 (patch) | |
tree | c2504b620c7de1e2d09ce5c65b9103e2b20458e6 /Master/texmf-dist/tex/luatex/luamplib/luamplib.sty | |
parent | d9dfa4bfe8f4fd86a9d6eb44db9e4e26f702cac5 (diff) |
luamplib (11dec19)
git-svn-id: svn://tug.org/texlive/trunk@53099 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luamplib/luamplib.sty')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luamplib/luamplib.sty | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty index 6849c6cf90f..aae75fd9632 100644 --- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty +++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty @@ -14,7 +14,7 @@ \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luamplib} - [2019/10/11 v2.20.2 mplib package for LuaTeX] + [2019/12/11 v2.20.4 mplib package for LuaTeX] \ifx\newluafunction\@undefined \input ltluatex \fi @@ -40,30 +40,18 @@ \write128{} \fi \fi -\def\mplibforcehmode{\let\mplibhmodeornot\leavevmode} -\def\mplibnoforcehmode{\let\mplibhmodeornot\relax} +\def\mplibforcehmode{\let\prependtomplibbox\leavevmode} +\def\mplibnoforcehmode{\let\prependtomplibbox\relax} \mplibnoforcehmode \def\mplibsetupcatcodes{% - \mplibhmodeornot %catcode`\{=12 %catcode`\}=12 + %catcode`\{=12 %catcode`\}=12 \catcode`\#=12 \catcode`\^=12 \catcode`\~=12 \catcode`\_=12 - \catcode`\&=12 \catcode`\$=12 \catcode`\%=12 \catcode`\^^M=12 \endlinechar=10 + \catcode`\&=12 \catcode`\$=12 \catcode`\%=12 \catcode`\^^M=12 } \def\mplibputtextbox#1{\vbox to 0pt{\vss\hbox to 0pt{\raise\dp#1\copy#1\hss}}} -\newcount\mplibstartlineno -\def\mplibpostmpcatcodes{% - \catcode`\{=12 \catcode`\}=12 \catcode`\#=12 \catcode`\%=12 } -\def\mplibreplacenewlinebr{% - \begingroup \mplibpostmpcatcodes \mplibdoreplacenewlinebr} -\begingroup\lccode`\~=`\^^M \lowercase{\endgroup - \def\mplibdoreplacenewlinebr#1^^J{\endgroup\scantextokens{{}#1~}}} \bgroup\expandafter\expandafter\expandafter\egroup \expandafter\ifx\csname selectfont\endcsname\relax -\def\mplibreplacenewlinecs{% - \begingroup \mplibpostmpcatcodes \mplibdoreplacenewlinecs} -\begingroup\lccode`\~=`\^^M \lowercase{\endgroup - \def\mplibdoreplacenewlinecs#1^^J{\endgroup\scantextokens{\relax#1~}}} \def\mplibcode{% - \mplibstartlineno\inputlineno \begingroup \begingroup \mplibsetupcatcodes @@ -73,12 +61,10 @@ \endgroup \directlua{luamplib.process_mplibcode([===[\unexpanded{#1}]===])}% \endgroup - \ifnum\mplibstartlineno<\inputlineno\expandafter\mplibreplacenewlinecs\fi } \else \newenvironment{mplibcode}{% - \global\mplibstartlineno\inputlineno - \toks@{}\ltxdomplibcode + \mplibtmptoks{}\ltxdomplibcode }{} \def\ltxdomplibcode{% \begingroup @@ -88,16 +74,14 @@ \def\mplib@mplibcode{mplibcode} \long\def\ltxdomplibcodeindeed#1\end#2{% \endgroup - \toks@\expandafter{\the\toks@#1}% + \mplibtmptoks\expandafter{\the\mplibtmptoks#1}% \def\mplibtemp@a{#2}% \ifx\mplib@mplibcode\mplibtemp@a - \directlua{luamplib.process_mplibcode([===[\the\toks@]===])}% + \directlua{luamplib.process_mplibcode([===[\the\mplibtmptoks]===])}% \end{mplibcode}% - \ifnum\mplibstartlineno<\inputlineno - \expandafter\expandafter\expandafter\mplibreplacenewlinebr - \fi \else - \toks@\expandafter{\the\toks@\end{#2}}\expandafter\ltxdomplibcode + \mplibtmptoks\expandafter{\the\mplibtmptoks\end{#2}}% + \expandafter\ltxdomplibcode \fi } \fi @@ -121,7 +105,6 @@ \newtoks\everymplibtoks \newtoks\everyendmplibtoks \protected\def\everymplib{% - \mplibstartlineno\inputlineno \begingroup \mplibsetupcatcodes \mplibdoeverymplib @@ -129,10 +112,8 @@ \long\def\mplibdoeverymplib#1{% \endgroup \everymplibtoks{#1}% - \ifnum\mplibstartlineno<\inputlineno\expandafter\mplibreplacenewlinebr\fi } \protected\def\everyendmplib{% - \mplibstartlineno\inputlineno \begingroup \mplibsetupcatcodes \mplibdoeveryendmplib @@ -140,7 +121,6 @@ \long\def\mplibdoeveryendmplib#1{% \endgroup \everyendmplibtoks{#1}% - \ifnum\mplibstartlineno<\inputlineno\expandafter\mplibreplacenewlinebr\fi } \def\mplibnumbersystem#1{\directlua{ local t = "#1" @@ -196,6 +176,7 @@ }} \ifx\mplibscratchbox\undefined \newbox\mplibscratchbox \fi \def\mplibstarttoPDF#1#2#3#4{% + \prependtomplibbox \hbox\bgroup \xdef\MPllx{#1}\xdef\MPlly{#2}% \xdef\MPurx{#3}\xdef\MPury{#4}% |