diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
commit | b55577d0998160c0174e250b542016ecd6ca9056 (patch) | |
tree | 27093212d5ca3e6ffe4ae434c3ec094233ed37ba /tex/context/base/mtx-context-arrange.tex | |
parent | 624cbb5da392e9403984dd1cf368c0d408b1c2a8 (diff) | |
download | context-b55577d0998160c0174e250b542016ecd6ca9056.tar.gz |
2015-05-15 23:06:00
Diffstat (limited to 'tex/context/base/mtx-context-arrange.tex')
-rw-r--r-- | tex/context/base/mtx-context-arrange.tex | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/tex/context/base/mtx-context-arrange.tex b/tex/context/base/mtx-context-arrange.tex index 49920293f..fb53406d8 100644 --- a/tex/context/base/mtx-context-arrange.tex +++ b/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 |