Skip to content

Commit

Permalink
Merge pull request #33 from dohyunkim/master
Browse files Browse the repository at this point in the history
v2.5.2
  • Loading branch information
dohyunkim committed Feb 24, 2014
2 parents cdb8bd8 + ca2d466 commit 9898207
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
*.sty
*.lua
*.zip
*.mp
12 changes: 7 additions & 5 deletions luamplib.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ local function replaceinputmpfile (name,file)
end)
count = count + cnt
data,cnt = stringgsub(data,
"%f[A-Z_a-z]verbatimtex%f[^A-Z_a-z]%s*(.-)%s*%f[A-Z_a-z]etex%f[^A-Z_a-z]",
"%f[A-Z_a-z]verbatimtex%f[^A-Z_a-z]%s*.-%s*%f[A-Z_a-z]etex%f[^A-Z_a-z]",
"")
count = count + cnt
if count == 0 then
Expand Down Expand Up @@ -1376,8 +1376,10 @@ luamplib.colorconverter = colorconverter
% \begin{macrocode}
\def\mplibputtextbox#1{\vbox to 0pt{\vss\hbox to 0pt{\raise\dp#1\copy#1\hss}}}
\newcount\mplibstartlineno
\def\mplibreplacenewlinebr{\begingroup
\catcode`\{=12 \catcode`\}=12 \catcode`\%=12 \mplibdoreplacenewlinebr}
\def\mplibpostmpcatcodes{%
\catcode`\{=12 \catcode`\}=12 \catcode`\#=12 \catcode`\%=12 }
\def\mplibreplacenewlinebr{%
\begingroup \mplibpostmpcatcodes \mplibdoreplacenewlinebr}
\begingroup\lccode`\~=`\^^M \lowercase{%
\gdef\mplibdoreplacenewlinebr#1^^J{\endgroup\luatexscantextokens{{}#1~}}}
\endgroup
Expand All @@ -1388,8 +1390,8 @@ luamplib.colorconverter = colorconverter
% \begin{macrocode}
\bgroup\expandafter\expandafter\expandafter\egroup
\expandafter\ifx\csname ProvidesPackage\endcsname\relax
\def\mplibreplacenewlinecs{\begingroup
\catcode`\{=12 \catcode`\}=12 \catcode`\%=12 \mplibdoreplacenewlinecs}
\def\mplibreplacenewlinecs{%
\begingroup \mplibpostmpcatcodes \mplibdoreplacenewlinecs}
\begingroup\lccode`\~=`\^^M \lowercase{%
\gdef\mplibdoreplacenewlinecs#1^^J{\endgroup\luatexscantextokens{\relax#1~}}}
\endgroup
Expand Down
13 changes: 13 additions & 0 deletions test-luamplib-latex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,17 @@
draw unitsquare scaled u;
endfig;
\end{mplibcode}%
\mplibsetformat{plain}%
\begin{mplibcode}
input graph;
beginfig(0);
draw begingraph(100,100);
gdraw (10,10)--(30,35)--(50,25)--(70,80)--(90,90);
autogrid(otick.bot,);
for y=20,40,60,80:
grid.lft(format("%e",1000y), y) withcolor .85white;
endfor
endgraph;
endfig;
\end{mplibcode}%
\end{document}
13 changes: 13 additions & 0 deletions test-luamplib-plain.tex
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,17 @@
draw unitsquare scaled u;
endfig;
\endmplibcode
\mplibsetformat{plain}%
\mplibcode
input graph;
beginfig(0);
draw begingraph(100,100);
gdraw (10,10)--(30,35)--(50,25)--(70,80)--(90,90);
autogrid(otick.bot,);
for y=20,40,60,80:
grid.lft(format("%e",1000y), y) withcolor .85white;
endfor
endgraph;
endfig;
\endmplibcode
\bye

0 comments on commit 9898207

Please sign in to comment.