Skip to content

Commit

Permalink
Merge pull request #23 from dohyunkim/master
Browse files Browse the repository at this point in the history
v2.4
  • Loading branch information
dohyunkim committed Feb 3, 2014
2 parents a091ffe + 58f2f4d commit 7300631
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 21 deletions.
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ RUNFILES = $(STY) $(LUA)

ALL = $(SRCFILES) $(DOCFILES) $(RUNFILES)

TEXMFROOT = ./texmf
RUNDIR = $(TEXMFROOT)/tex/$(FORMAT)/$(NAME)
DOCDIR = $(TEXMFROOT)/doc/$(FORMAT)/$(NAME)
SRCDIR = $(TEXMFROOT)/source/$(FORMAT)/$(NAME)
TEXMFDIR = ./texmf
RUNDIR = $(TEXMFDIR)/tex/$(FORMAT)/$(NAME)
DOCDIR = $(TEXMFDIR)/doc/$(FORMAT)/$(NAME)
SRCDIR = $(TEXMFDIR)/source/$(FORMAT)/$(NAME)

CTAN_ZIP = $(NAME).zip
TDS_ZIP = $(NAME).tds.zip
Expand All @@ -39,7 +39,7 @@ world: all ctan
latexmk -lualatex -recorder- -silent $< >/dev/null

$(UNPACKED): $(DTX)
tex -interaction=batchmode $< >/dev/null
luatex -interaction=batchmode $< >/dev/null

check: $(UNPACKED)
luatex -interaction=batchmode test-$(NAME)-plain.tex >/dev/null
Expand All @@ -61,19 +61,19 @@ define run-install
@mkdir -p $(SRCDIR) && cp $(SRCFILES) $(SRCDIR)
endef

$(TDS_ZIP): TEXMFROOT=./tmp-texmf
$(TDS_ZIP): TEXMFDIR=./tmp-texmf
$(TDS_ZIP): $(ALL)
@echo "Making TDS-ready archive $@."
@$(RM) -- $@
@if test -e $(TEXMFROOT); then echo 'bad TEXMFROOT'; false; fi
@if test -e $(TEXMFDIR); then echo 'bad TEXMFDIR'; false; fi
$(run-install)
@cd $(TEXMFROOT) && zip -q -9 ../$@ -r .
@$(RM) -r -- $(TEXMFROOT)
@cd $(TEXMFDIR) && zip -q -9 ../$@ -r .
@$(RM) -r -- $(TEXMFDIR)

.PHONY: install clean mrproper help

install: check $(ALL)
@echo "Installing in '$(TEXMFROOT)'."
@echo "Installing in '$(TEXMFDIR)'."
$(run-install)

clean:
Expand All @@ -93,4 +93,4 @@ help:
@echo ' ctan - run check & generate archive for CTAN'
@echo ' tds - generate a TDS compliant archive'
@echo ' check - run the test files'
@echo ' install TEXMFROOT=<path> - install in <path>'
@echo ' install TEXMFDIR=<path> - install in <path>'
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
History of the luamplib package

2014/02/02 2.4
* implemented "numbersystem" option. Default value "scaled" can be
changed by declaring \mplibnumbersystem{double}. For details, see
http://github.com/lualatex/luamplib/issues/21

2014/01/20 2.3
* \everymplib, \everyendmplib: macros that redefine token lists
\everymplibtoks and \everyendmplibtoks. These will be
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Here are the recommended installation methods (preferred first).
Alternatively, try your (TeX or Linux) distribution's package management system.

2. a. Grab the sources from CTAN or github.
b. Run 'make install TEXMFROOT=/path/to/texmf'.
b. Run 'make install TEXMFDIR=/path/to/texmf'.
c. You may need to update some filename database after, see your TeX
distribution's manual for details.

Expand Down
19 changes: 10 additions & 9 deletions luamplib.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ See source file '\inFileName' for licencing and contact information.
% \begin{verbatim}
% \everymplib{ verbatimtex \leavevmode etex; beginfig(0); }
% \everyendmplib{ endfig; }
% \mplibcode % befinfig/endfig not needed; always in horizontal mode
% \mplibcode % beginfig/endfig not needed; always in horizontal mode
% draw fullcircle scaled 1cm;
% \endmplibcode
% \end{verbatim}
Expand All @@ -237,6 +237,10 @@ See source file '\inFileName' for licencing and contact information.
% |btex ... etex| as provided by gmp package. As \textsf{luamplib}
% automatically protects \TeX\ code inbetween, \cs{btex} is not supported
% here.
% \item Users can choose |numbersystem| option since v2.4.
% The default value |scaled| can be changed to |double| by declaring
% |\mplibnumbersystem{double}|. For details see
% \url{http://github.com/lualatex/luamplib/issues/21}.
% \end{itemize}
%
% There are (basically) two formats for metapost: \emph{plain} and
Expand Down Expand Up @@ -267,14 +271,6 @@ local luamplib = luamplib
luamplib.showlog = luamplib.showlog or false
luamplib.lastlog = ""

% \end{macrocode}
% Provides |numbersystem| option since v2.4. Default is |"scaled"|,
% which can be changed by declaring |\mplibnumbersystem{double}|.
% See \url{https://github.com/lualatex/luamplib/issues/21}.
%
% \begin{macrocode}
luamplib.numbersystem = luamplib.numbersystem or "scaled"

local err, warn, info, log = luatexbase.provides_module({
name = "luamplib",
version = 2.4,
Expand Down Expand Up @@ -418,6 +414,11 @@ else
local mpx = mplib.new {
ini_version = true,
find_file = luamplib.finder,
% \end{macrocode}
% Provides |numbersystem| option since v2.4. Default value |"scaled"|
% can be changed by declaring |\mplibnumbersystem{double}|.
% See \url{https://github.com/lualatex/luamplib/issues/21}.
% \begin{macrocode}
math_mode = luamplib.numbersystem,
}
local result
Expand Down
8 changes: 8 additions & 0 deletions test-luamplib-latex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,12 @@
\copy\mympbox
\copy\mympbox
\copy\mympbox
\mplibnumbersystem{double}%
\begin{mplibcode}
beginfig(0);
u := 10**5*(10**-4);
draw unitsquare scaled u;
endfig;
\end{mplibcode}%
\end{document}
8 changes: 8 additions & 0 deletions test-luamplib-plain.tex
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,12 @@
\copy\mympbox
\copy\mympbox
\copy\mympbox
\mplibnumbersystem{double}%
\mplibcode
beginfig(0);
u := 10**5*(10**-4);
draw unitsquare scaled u;
endfig;
\endmplibcode
\bye

0 comments on commit 7300631

Please sign in to comment.