summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-04-18 22:52:45 +0000
committerKarl Berry <karl@freefriends.org>2015-04-18 22:52:45 +0000
commit16aa5a7c87f18a2483d0d61795899f886781b51c (patch)
tree1d72f00b2a4185425393598402fe055c61d1de58 /Master/texmf-dist/tex/context/base/mtx-context-arrange.tex
parente68dc4d5506d46bf72823234f902bc76d1f70352 (diff)
context, from www.pragma-ade.com/context/beta/cont-tmf.zip (18apr15)
git-svn-id: svn://tug.org/texlive/trunk@36923 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mtx-context-arrange.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/mtx-context-arrange.tex25
1 files changed, 14 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex b/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex
index 49920293fe6..fb53406d800 100644
--- a/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex
+++ b/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex
@@ -27,10 +27,11 @@
% --printformat : 2UP, etc
% --paperformat=spec : paper*print or paperxprint
%
-% example: context --extra=arrange --printformat=2UP --paperformat=A4,A3,landscape myfile
+% example: context --extra=arrange --printformat=2UP --paperformat=A4*A3,landscape myfile
%
% end help
+
\input mtx-context-common.tex
\doifdocumentargument {paperoffset} {
@@ -46,6 +47,7 @@
\setdocumentargument{sided}{singlesided}
}
+
\setuppapersize
[\getdocumentargument{paperformat_paper}]
[\getdocumentargument{paperformat_print}]
@@ -95,16 +97,17 @@
\starttext
\startluacode
- local format = string.format
- local fprint = function(...) tex.sprint(tex.ctxcatcodes,format(...)) end
-
- if #document.files > 0 then
- if document.arguments.sort then
- table.sort(document.files)
+ local arguments = document.arguments
+ local files = document.files
+ local noffiles = #files
+ if noffiles > 0 then
+ if arguments.sort then
+ table.sort(files)
end
- local emptypages = document.arguments.addempty or ""
- local textwidth = document.arguments.textwidth or "0cm"
- for _, filename in ipairs(document.files) do
+ local emptypages = arguments.addempty or ""
+ local textwidth = arguments.textwidth or "0cm"
+ for i=1,noffiles do
+ local filename = files[i]
if not string.find(filename,"^mtx%-context%-") then
context.insertpages (
{ filename },
@@ -114,7 +117,7 @@
end
end
else
- fprint("no files given")
+ context("no files given")
end
\stopluacode