summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/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/source/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/source/luatex')
-rw-r--r--Master/texmf-dist/source/luatex/luamplib/luamplib.dtx57
1 files changed, 17 insertions, 40 deletions
diff --git a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx b/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
index c93ff8c8290..e683a7a2f4e 100644
--- a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
+++ b/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
@@ -85,7 +85,7 @@ See source file '\inFileName' for licencing and contact information.
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{luamplib.drv}%
- [2019/10/11 v2.20.2 Interface for using the mplib library]%
+ [2019/12/11 v2.20.4 Interface for using the mplib library]%
\documentclass{ltxdoc}
\usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace}
\usepackage[x11names]{xcolor}
@@ -153,7 +153,7 @@ See source file '\inFileName' for licencing and contact information.
% \author{Hans Hagen, Taco Hoekwater, Elie Roux, Philipp Gesang and Kim Dohyun\\
% Maintainer: LuaLaTeX Maintainers ---
% Support: \email{lualatex-dev@tug.org}}
-% \date{2019/10/11 v2.20.2}
+% \date{2019/12/11 v2.20.4}
%
% \maketitle
%
@@ -206,7 +206,8 @@ See source file '\inFileName' for licencing and contact information.
% When this macro is declared, every mplibcode figure box will be
% typeset in horizontal mode, so \cs{centering}, \cs{raggedleft} etc
% will have effects. |\mplibnoforcehmode|, being default, reverts this
-% setting.
+% setting. (Actually these commands redefine |\prependtomplibbox|. You
+% can define this command with anything suitable before a box.)
%
% \paragraph{\cs{mpliblegacybehavior\{enable\}}}
% By default, |\mpliblegacybehavior{enable}| is already declared,
@@ -406,8 +407,8 @@ See source file '\inFileName' for licencing and contact information.
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.",
}
@@ -1959,7 +1960,7 @@ luamplib.colorconverter = colorconverter
\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
@@ -2007,17 +2008,17 @@ luamplib.colorconverter = colorconverter
%
% Make |mplibcode| typesetted always in horizontal mode.
% \begin{macrocode}
-\def\mplibforcehmode{\let\mplibhmodeornot\leavevmode}
-\def\mplibnoforcehmode{\let\mplibhmodeornot\relax}
+\def\mplibforcehmode{\let\prependtomplibbox\leavevmode}
+\def\mplibnoforcehmode{\let\prependtomplibbox\relax}
\mplibnoforcehmode
% \end{macrocode}
%
% Catcode. We want to allow comment sign in |mplibcode|.
% \begin{macrocode}
\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
}
% \end{macrocode}
%
@@ -2026,28 +2027,11 @@ luamplib.colorconverter = colorconverter
\def\mplibputtextbox#1{\vbox to 0pt{\vss\hbox to 0pt{\raise\dp#1\copy#1\hss}}}
% \end{macrocode}
%
-% As we have changed |^^J| catcode, the last line containing
-% |\end{mplibcode}| has |\n| at the end. Replace it with |^^M|.
-% \begin{macrocode}
-\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~}}}
-% \end{macrocode}
-%
% The Plain-specific stuff.
% \begin{macrocode}
\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
@@ -2057,7 +2041,6 @@ luamplib.colorconverter = colorconverter
\endgroup
\directlua{luamplib.process_mplibcode([===[\unexpanded{#1}]===])}%
\endgroup
- \ifnum\mplibstartlineno<\inputlineno\expandafter\mplibreplacenewlinecs\fi
}
\else
% \end{macrocode}
@@ -2065,8 +2048,7 @@ luamplib.colorconverter = colorconverter
% The \LaTeX-specific part: a new environment.
% \begin{macrocode}
\newenvironment{mplibcode}{%
- \global\mplibstartlineno\inputlineno
- \toks@{}\ltxdomplibcode
+ \mplibtmptoks{}\ltxdomplibcode
}{}
\def\ltxdomplibcode{%
\begingroup
@@ -2076,16 +2058,14 @@ luamplib.colorconverter = colorconverter
\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
@@ -2119,7 +2099,6 @@ luamplib.colorconverter = colorconverter
\newtoks\everymplibtoks
\newtoks\everyendmplibtoks
\protected\def\everymplib{%
- \mplibstartlineno\inputlineno
\begingroup
\mplibsetupcatcodes
\mplibdoeverymplib
@@ -2127,10 +2106,8 @@ luamplib.colorconverter = colorconverter
\long\def\mplibdoeverymplib#1{%
\endgroup
\everymplibtoks{#1}%
- \ifnum\mplibstartlineno<\inputlineno\expandafter\mplibreplacenewlinebr\fi
}
\protected\def\everyendmplib{%
- \mplibstartlineno\inputlineno
\begingroup
\mplibsetupcatcodes
\mplibdoeveryendmplib
@@ -2138,7 +2115,6 @@ luamplib.colorconverter = colorconverter
\long\def\mplibdoeveryendmplib#1{%
\endgroup
\everyendmplibtoks{#1}%
- \ifnum\mplibstartlineno<\inputlineno\expandafter\mplibreplacenewlinebr\fi
}
% \end{macrocode}
%
@@ -2220,6 +2196,7 @@ luamplib.colorconverter = colorconverter
% We encapsulate the litterals.
% \begin{macrocode}
\def\mplibstarttoPDF#1#2#3#4{%
+ \prependtomplibbox
\hbox\bgroup
\xdef\MPllx{#1}\xdef\MPlly{#2}%
\xdef\MPurx{#3}\xdef\MPury{#4}%