diff options
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.tex | 25 |
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 |