summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-12-11 21:54:44 +0000
committerKarl Berry <karl@freefriends.org>2019-12-11 21:54:44 +0000
commit78e912c354fd91abbfb6fe9ba6f869449dab2391 (patch)
treec2504b620c7de1e2d09ce5c65b9103e2b20458e6 /Master/texmf-dist/tex/luatex
parentd9dfa4bfe8f4fd86a9d6eb44db9e4e26f702cac5 (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')
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.lua4
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.sty41
2 files changed, 13 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
index 69ab5cef027..2b2ac290b4c 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
@@ -11,8 +11,8 @@
luatexbase.provides_module {
name = "luamplib",
- version = "2.20.2",
- date = "2019/10/11",
+ version = "2.20.4",
+ date = "2019/12/11",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
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}%