Skip to content

Commit

Permalink
Merge pull request #42 from dohyunkim/master
Browse files Browse the repository at this point in the history
v2.6.0 for ctan
  • Loading branch information
dohyunkim committed Mar 9, 2014
2 parents a294373 + d53dc9d commit dd0fefc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
33 changes: 18 additions & 15 deletions luamplib.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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{[email protected]}}
% \date{2014/03/06 v2.6.0}
% \date{2014/03/08 v2.6.0}
%
% \maketitle
%
Expand Down Expand Up @@ -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.",
})

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -865,15 +868,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
Expand Down Expand Up @@ -923,8 +926,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
Expand Down Expand Up @@ -1015,6 +1017,7 @@ local function makeTEXboxes (data)
if luamplib.textextlabel then
preamble = textextlabelpreamble .. preamble
end
randomseed = math.random(65535)
local mpx = luamplib.load(currentformat)
if mpx and data then
local result = mpx:execute(preamble .. data)
Expand All @@ -1035,9 +1038,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
Expand Down Expand Up @@ -1418,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
Expand Down

0 comments on commit dd0fefc

Please sign in to comment.