From cb51d911d80d284410b02df1abdc40d4c964f1e0 Mon Sep 17 00:00:00 2001 From: Dohyun Kim Date: Fri, 7 Mar 2014 08:51:50 +0900 Subject: [PATCH 1/4] fontsize too ignore font part --- luamplib.dtx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/luamplib.dtx b/luamplib.dtx index f8284e7..7637e3f 100644 --- a/luamplib.dtx +++ b/luamplib.dtx @@ -923,8 +923,7 @@ let normalinfont = infont; def fontsize expr f = begingroup save size,pic; numeric size; picture pic; - pic := rawtextext(if f <> "": "\font\temp{"&f&"}\temp"& fi - "\hskip\pdffontsize\font"); + pic := rawtextext("\hskip\pdffontsize\font"); size := xpart urcorner pic - xpart llcorner pic; if size = 0: 10pt else: size fi endgroup From 864f690e996ef9ab99bc6f64cd4f39a5d7948dcf Mon Sep 17 00:00:00 2001 From: Dohyun Kim Date: Fri, 7 Mar 2014 18:39:24 +0900 Subject: [PATCH 2/4] follow mp code convention --- luamplib.dtx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/luamplib.dtx b/luamplib.dtx index 7637e3f..0bdbb8e 100644 --- a/luamplib.dtx +++ b/luamplib.dtx @@ -865,15 +865,15 @@ vardef rawtextext (expr t) = image( special "MPlibmkTEXbox="&t; ) else: TEXBOX_ := TEXBOX_ + 1; - if known TEXBOX_wd[TEXBOX_]: + if known TEXBOX_wd_[TEXBOX_]: image ( addto currentpicture doublepath unitsquare - xscaled TEXBOX_wd[TEXBOX_] - yscaled (TEXBOX_ht[TEXBOX_] + TEXBOX_dp[TEXBOX_]) - shifted (0, -TEXBOX_dp[TEXBOX_]) + xscaled TEXBOX_wd_[TEXBOX_] + yscaled (TEXBOX_ht_[TEXBOX_] + TEXBOX_dp_[TEXBOX_]) + shifted (0, -TEXBOX_dp_[TEXBOX_]) withprescript "MPlibTEXboxID=" & decimal TEXBOX_ & ":" & - decimal TEXBOX_wd[TEXBOX_] & ":" & - decimal(TEXBOX_ht[TEXBOX_]+TEXBOX_dp[TEXBOX_]); ) + decimal TEXBOX_wd_[TEXBOX_] & ":" & + decimal(TEXBOX_ht_[TEXBOX_]+TEXBOX_dp_[TEXBOX_]); ) else: image( special "MPlibTEXError=1"; ) fi @@ -1034,9 +1034,9 @@ local function processwithTEXboxes (data) local box = tex.box[num] if not box then break end prepreamble = prepreamble .. - "TEXBOX_wd["..num.."] := "..box.width /factor..";\n".. - "TEXBOX_ht["..num.."] := "..box.height/factor..";\n".. - "TEXBOX_dp["..num.."] := "..box.depth /factor..";\n" + "TEXBOX_wd_["..num.."] := "..box.width /factor..";\n".. + "TEXBOX_ht_["..num.."] := "..box.height/factor..";\n".. + "TEXBOX_dp_["..num.."] := "..box.depth /factor..";\n" end local preamble = prepreamble .. mplibcodepreamble if luamplib.textextlabel then From bd73b205204a3ec3431857ae6f2cb9bae27d1bbc Mon Sep 17 00:00:00 2001 From: Dohyun Kim Date: Sat, 8 Mar 2014 16:20:34 +0900 Subject: [PATCH 3/4] add randomseed to load() --- NEWS | 2 +- luamplib.dtx | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index ba1928c..0ddf1a4 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ History of the luamplib package -2014/03/06 2.6.0 +2014/03/08 2.6.0 * new macro \mplibtextextlabel{enable} enables string labels typeset with textext() instead of infont operator. Every string label thereafter will be typeset with current TeX font. diff --git a/luamplib.dtx b/luamplib.dtx index 0bdbb8e..60cbdbf 100644 --- a/luamplib.dtx +++ b/luamplib.dtx @@ -85,7 +85,7 @@ See source file '\inFileName' for licencing and contact information. %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luamplib.drv}% - [2014/03/06 v2.6.0 Interface for using the mplib library]% + [2014/03/08 v2.6.0 Interface for using the mplib library]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace} \usepackage[x11names]{xcolor} @@ -154,7 +154,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{2014/03/06 v2.6.0} +% \date{2014/03/08 v2.6.0} % % \maketitle % @@ -320,7 +320,7 @@ luamplib.lastlog = "" local err, warn, info, log = luatexbase.provides_module({ name = "luamplib", version = "2.6.0", - date = "2014/03/06", + date = "2014/03/08", description = "Lua package to typeset Metapost with LuaTeX's MPLib.", }) @@ -522,6 +522,8 @@ local function replaceinputmpfile (name,file) lfstouch(newfile,currenttime,ofmodify) return newfile end + +local randomseed = nil % \end{macrocode} % As the finder function for |mplib|, use the |kpse| library and % make it behave like as if MetaPost was used (or almost, since the engine @@ -630,6 +632,7 @@ else % See \url{https://github.com/lualatex/luamplib/issues/21}. % \begin{macrocode} math_mode = luamplib.numbersystem, + random_seed = randomseed, } local result if not mpx then @@ -1014,6 +1017,7 @@ local function makeTEXboxes (data) if luamplib.textextlabel then preamble = textextlabelpreamble .. preamble end + randomseed = math.random(4095) local mpx = luamplib.load(currentformat) if mpx and data then local result = mpx:execute(preamble .. data) @@ -1417,7 +1421,7 @@ luamplib.colorconverter = colorconverter \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luamplib} - [2014/03/06 v2.6.0 mplib package for LuaTeX] + [2014/03/08 v2.6.0 mplib package for LuaTeX] \RequirePackage{luatexbase-modutils} \RequirePackage{pdftexcmds} \fi From d53dc9da1a7fbf47b9566a72165108910e7c87a4 Mon Sep 17 00:00:00 2001 From: Dohyun Kim Date: Mon, 10 Mar 2014 00:09:24 +0900 Subject: [PATCH 4/4] random_seed is int type --- luamplib.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luamplib.dtx b/luamplib.dtx index 60cbdbf..860f3f8 100644 --- a/luamplib.dtx +++ b/luamplib.dtx @@ -1017,7 +1017,7 @@ local function makeTEXboxes (data) if luamplib.textextlabel then preamble = textextlabelpreamble .. preamble end - randomseed = math.random(4095) + randomseed = math.random(65535) local mpx = luamplib.load(currentformat) if mpx and data then local result = mpx:execute(preamble .. data)