diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf | bin | 104555 -> 178958 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/luatex/luamplib/luamplib.dtx | 81 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luamplib/luamplib.lua | 45 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luamplib/luamplib.sty | 2 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 1 |
5 files changed, 86 insertions, 43 deletions
diff --git a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf Binary files differindex 5355968f8c9..09b97c500c3 100644 --- a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf +++ b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf diff --git a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx b/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx index fa65b68d884..9cedd1f72cd 100644 --- a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx +++ b/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx @@ -37,7 +37,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luamplib 2009/09/23 v1.01 metapost package for LuaTeX.} +\Msg{* Package: luamplib 2009/10/01 v1.02 metapost package for LuaTeX.} \Msg{************************************************************************} \keepsilent @@ -106,7 +106,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luamplib.drv}% - [2009/09/23 v1.01 mplib package for LuaTeX.]% + [2009/10/01 v1.02 mplib package for LuaTeX.]% \documentclass{ltxdoc} \begin{document} \DocInput{luamplib.dtx}% @@ -133,7 +133,7 @@ and the derived files % Right brace \} Tilde \~} % % \title{The \textsf{luamplib} package} -% \date{2009/09/23 v1.01} +% \date{2009/10/01 v1.02} % \author{Hans Hagen, Taco Hoekwater and Elie Roux \\ % \texttt{elie.roux@telecom-bretagne.eu}} % @@ -165,6 +165,7 @@ and the derived files % \item a \LaTeX\ environment % \item all \TeX\ macros start by \texttt{mplib} % \item use of the luatextra printing and module functions +% \item adapted warning, error and log messages % \end{itemize} % % Using this package is easy: in Plain, type your metapost code between the @@ -174,14 +175,19 @@ and the derived files % In order to use metapost, some \texttt{.mem} files are needed. These files % must be generated with the same version of \texttt{mplib} as the version of % Lua\TeX . These files names can be changed, they are by default -% \texttt{luatex-plain.mem} and \texttt{luatex-mpfun.mem}. If this package is +% \texttt{mpost.mem} and \texttt{mpfun.mem}. If this package is % to be included in a distribution, some values may have to be changed in the % file \texttt{luamplib.lua}, see comments. % -% % If your distribution does not provide valid \texttt{.mem} files (\TeX Live % 2009 will be the first), you'll have to generate and install them by hand, -% with the script \texttt{luamplib-createmem.lua} included in this package. +% with the script \texttt{luamplib-createmem.lua} included in this package +% if you want them. +% +% These .mem files are not mandatory though. If this package doesn't find the +% mem files, it will just input the \texttt{.mp} file, and work without problem; +% the only difference is that it may be a bit slower but this is not noticeable +% on a modern computer. % % \section{Files} % @@ -208,9 +214,9 @@ luamplib = { } luamplib.module = { name = "luamplib", - version = 1.01, - date = "2009/09/23", - description = "Lua functions to typeset Metapost directly with MPLib.", + version = 1.02, + date = "2009/10/01", + description = "Lua package to typeset Metapost with LuaTeX's MPLib.", author = "Hans Hagen, Taco Hoekwater & Elie Roux", copyright = "ConTeXt Development Team & Elie Roux", license = "CC0", @@ -234,7 +240,7 @@ local format, concat, abs = string.format, table.concat, math.abs % \begin{macrocode} luamplib.currentformat = "plain" -luamplib.currentmem = "luatex-plain.mem" +luamplib.currentmem = "mpost" local currentformat = luamplib.currentformat local currentmem = luamplib.currentmem @@ -249,24 +255,21 @@ end % \end{macrocode} % -% We use the \texttt{kpse} library unless a finder is already defined. To -% find the .mem files with kpse, we have to set the \texttt{engine} -% environment variable to \texttt{metapost}. +% We use the \texttt{kpse} library and make it behave like when used +% with Metapost. To find the .mem files with kpse, we have to make a +% small hack... that might be a little bug. % % \begin{macrocode} -luamplib.finder = luamplib.finder or function(name, mode, ftype) +local mpkpse = kpse.new("luatex","mpost") + +function luamplib.finder(name, mode, ftype) if mode == "w" then return name else - local result - if ftype == 'mem' then - local envsave = os.getenv('engine') - os.setenv('engine', 'metapost') - result = kpse.find_file(name,ftype) - os.setenv('engine', envsave) - else - result = kpse.find_file(name,ftype) + local result = mpkpse:find_file(name,ftype) + if not result and ftype == "mem" then + result = mpkpse:find_file("metapost/"..name,ftype) end return result end @@ -317,10 +320,31 @@ function luamplib.processlines() luamplib.resetdata() end +% \end{macrocode} +% +% +% \begin{macro}{luamplib.input mp} +% +% This function creates a new mplib object and inputs the +% good .mp file. It's less efficient than loading the .mem +% file, but it works more safely, as the .mp file does not +% depend on the version of the mpost program. +% +% \begin{macrocode} +function luamplib.input_mp(name) + local mpx = mplib.new { + ini_version = true, + find_file = luamplib.finder, + job_name = name, + } + mpx:execute(format("input %s ;",name)) + return mpx +end % \end{macrocode} % +% \end{macro} % % \begin{macro}{luamplib.load} % @@ -342,10 +366,15 @@ function luamplib.load() } if mpx then luamplib.log("using mem file %s", luamplib.finder(currentmem, 'r', 'mem')) - return mpx, nil else - return nil, { status = 99, error = "out of memory or invalid format" } + mpx = luamplib.input_mp(currentformat) + if mpx then + luamplib.log("using mp file %s", luamplib.finder(currentformat, 'r', 'mp')) + else + luamplib.error("unable to load the metapost format.") + end end + return mpx end % \end{macrocode} @@ -532,7 +561,7 @@ function luamplib.flush(result,flusher) local figures = result.fig if figures then for f=1, #figures do - luamplib.info("flushing figure %s",f) + luamplib.log("flushing figure %s",f) local figure = figures[f] local objects = getobjects(result,figure,f) local fignum = tonumber((figure:filename()):match("([%d]+)$") or figure:charcode() or 0) @@ -702,7 +731,7 @@ end \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luamplib} - [2009/09/23 v1.01 mplib package for LuaTeX.] + [2009/10/01 v1.02 mplib package for LuaTeX.] \RequirePackage{luatextra} \RequirePackage{fancyvrb} \fi diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua index f48ce0a5314..1ceb41ff8bb 100644 --- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua +++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua @@ -23,9 +23,9 @@ luamplib = { } luamplib.module = { name = "luamplib", - version = 1.01, - date = "2009/09/23", - description = "Lua functions to typeset Metapost directly with MPLib.", + version = 1.02, + date = "2009/10/01", + description = "Lua package to typeset Metapost with LuaTeX's MPLib.", author = "Hans Hagen, Taco Hoekwater & Elie Roux", copyright = "ConTeXt Development Team & Elie Roux", license = "CC0", @@ -38,7 +38,7 @@ local format, concat, abs = string.format, table.concat, math.abs luamplib.currentformat = "plain" -luamplib.currentmem = "luatex-plain.mem" +luamplib.currentmem = "mpost" local currentformat = luamplib.currentformat local currentmem = luamplib.currentmem @@ -52,18 +52,15 @@ function luamplib.setmemfile(name) end -luamplib.finder = luamplib.finder or function(name, mode, ftype) +local mpkpse = kpse.new("luatex","mpost") + +function luamplib.finder(name, mode, ftype) if mode == "w" then return name else - local result - if ftype == 'mem' then - local envsave = os.getenv('engine') - os.setenv('engine', 'metapost') - result = kpse.find_file(name,ftype) - os.setenv('engine', envsave) - else - result = kpse.find_file(name,ftype) + local result = mpkpse:find_file(name,ftype) + if not result and ftype == "mem" then + result = mpkpse:find_file("metapost/"..name,ftype) end return result end @@ -106,6 +103,17 @@ function luamplib.processlines() end +function luamplib.input_mp(name) + local mpx = mplib.new { + ini_version = true, + find_file = luamplib.finder, + job_name = name, + } + mpx:execute(format("input %s ;",name)) + return mpx +end + + function luamplib.load() local mpx = mplib.new { ini_version = false, @@ -114,10 +122,15 @@ function luamplib.load() } if mpx then luamplib.log("using mem file %s", luamplib.finder(currentmem, 'r', 'mem')) - return mpx, nil else - return nil, { status = 99, error = "out of memory or invalid format" } + mpx = luamplib.input_mp(currentformat) + if mpx then + luamplib.log("using mp file %s", luamplib.finder(currentformat, 'r', 'mp')) + else + luamplib.error("unable to load the metapost format.") + end end + return mpx end @@ -294,7 +307,7 @@ function luamplib.flush(result,flusher) local figures = result.fig if figures then for f=1, #figures do - luamplib.info("flushing figure %s",f) + luamplib.log("flushing figure %s",f) local figure = figures[f] local objects = getobjects(result,figure,f) local fignum = tonumber((figure:filename()):match("([%d]+)$") or figure:charcode() or 0) diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty index 8d6209efa70..832546af69f 100644 --- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty +++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty @@ -24,7 +24,7 @@ \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luamplib} - [2009/09/23 v1.01 mplib package for LuaTeX.] + [2009/10/01 v1.02 mplib package for LuaTeX.] \RequirePackage{luatextra} \RequirePackage{fancyvrb} \fi diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index c1dea04a70d..abdab0e980b 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -288,6 +288,7 @@ chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw 'javadoc', "die 'skipping, requires java and no source'", 'jflap2tikz', "die 'skipping, requires java'", 'jj_game', "die 'skipping, requires acrotex'", + 'jpgfdraw', "die 'skipping, requires java'", 'jsclasses', "die 'skipping, requires nonfree ptex/platex'", 'junicode', "&MAKEflatten", 'kd', "die 'skipping, too old, too complicated, sorry'", |