summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-12-30 01:09:42 +0000
committerKarl Berry <karl@freefriends.org>2010-12-30 01:09:42 +0000
commitd406d15b92210aa3bc187073d0e2b1ac23c8e7ec (patch)
tree9d96394702d85d056caab6adc8ee1df1a9cd5421 /Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
parent472e6fd0b5ea269f9946989092417642c3f3aeaf (diff)
luamplib 1.07 (28dec10)
git-svn-id: svn://tug.org/texlive/trunk@20881 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.sty54
1 files changed, 6 insertions, 48 deletions
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
index acdf367c53f..6f6d90e0e9d 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
@@ -5,40 +5,22 @@
%% The original source files were:
%%
%% luamplib.dtx (with options: `package')
-%% This is a generated file.
%%
-%% Copyright (C) 2008-2009 by Hans Hagen, Taco Hoekwater and Elie Roux
-%% <elie.roux@telecom-bretagne.eu>. (Support: <lualatex-dev@tug.org>.)
+%% See source file 'luamplib.dtx' for licencing and contact information.
%%
-%% This work is under the CC0 license.
-%%
-%% This Current Maintainer of this work is Elie Roux.
-%%
-%% This work consists of the main source file luamplib.dtx
-%% and the derived files
-%% luamplib.sty, luamplib.lua, luamplib-createmem.lua and luamplib.pdf.
-%%
-
\bgroup\expandafter\expandafter\expandafter\egroup
\expandafter\ifx\csname ProvidesPackage\endcsname\relax
\input luatexbase-modutils.sty
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luamplib}
- [2010/10/17 v1.06 mplib package for LuaTeX]
+ [2010/12/28 v1.07 mplib package for LuaTeX]
\RequirePackage{luatexbase-modutils}
\RequirePackage{fancyvrb}
\fi
-
-
\RequireLuaModule{luamplib}
-
-
-\def\mplibsetformat#1{\directlua{luamplib.setformat([[#1]])}}
-
-\def\mplibsetmemfile#1{\directlua{luamplib.setmemfile([[#1]])}}
-
-
+\def\mplibsetformat#1{%
+ \directlua{luamplib.setformat("\luatexluaescapestring{#1}")}}
\ifnum\pdfoutput>0
\let\mplibtoPDF\pdfliteral
\else
@@ -52,35 +34,25 @@
\PackageWarning{mplib}{MPLib only works in PDF mode, no figure will be output.}
\fi
\fi
-
-
\bgroup\expandafter\expandafter\expandafter\egroup
\expandafter\ifx\csname ProvidesPackage\endcsname\relax
-
\def\mplibsetupcatcodes{
\catcode`\{=12 \catcode`\}=12 \catcode`\#=12 \catcode`\^=12 \catcode`\~=12
\catcode`\_=12 \catcode`\%=12 \catcode`\&=12 \catcode`\$=12
}
-
\def\mplibcode{%
\bgroup %
\mplibsetupcatcodes %
\mplibdocode %
}
-
\long\def\mplibdocode#1\endmplibcode{%
\egroup %
\mplibprocess{#1}%
}
-
\long\def\mplibprocess#1{%
- \directlua{luamplib.process([[#1]])}%
+ \directlua{luamplib.process("\luatexluaescapestring{#1}")}%
}
-
\else
-
-
-\makeatletter
\begingroup
\catcode`\,=13
\catcode`\-=13
@@ -89,21 +61,15 @@
\def-{\string-}%
}
\endgroup
-
-
\newcommand\mplibaddlines[1]{%
\begingroup %
\FV@hack %
\def\FV@ProcessLine##1{%
- \directlua{luamplib.addline([[##1]])}%
+ \directlua{luamplib.addline("\luatexluaescapestring{##1}")}%
}%
\csname FV@SV@#1\endcsname %
\endgroup %
}
-
-\makeatother
-
-
\newenvironment{mplibcode}{%
\VerbatimEnvironment %
\begin{SaveVerbatim}{memoire}%
@@ -114,11 +80,7 @@
}
\fi
-
-
\ifx\mplibscratchbox\undefined \newbox\mplibscratchbox \fi
-
-
\def\mplibstarttoPDF#1#2#3#4{
\hbox\bgroup
\xdef\MPllx{#1}\xdef\MPlly{#2}%
@@ -132,7 +94,6 @@
\setbox\mplibscratchbox\vbox\bgroup
\noindent
}
-
\def\mplibstoptoPDF{%
\egroup %
\setbox\mplibscratchbox\hbox %
@@ -151,8 +112,6 @@
\box\mplibscratchbox
\egroup
}
-
-
\def\mplibtextext#1#2#3#4#5{%
\begingroup
\setbox\mplibscratchbox\hbox
@@ -169,7 +128,6 @@
\box\mplibscratchbox
\endgroup
}
-
\endinput
%%
%% End of file `luamplib.sty'.