diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2009-08-23 11:11:32 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2009-08-23 11:11:32 +0000 |
commit | 8fc3039c82d48605b5ca8b2eda3f4fdd755681e1 (patch) | |
tree | 3cd9bbdd599bc4d1ac0409e167fee2136e4c0ec9 /Master/texmf-dist/tex/context/base/mtx-context-listing.tex | |
parent | 850fc99b7cd3ae7a20065531fe866ff7bae642ec (diff) |
this is context 2009.08.19 17:10
git-svn-id: svn://tug.org/texlive/trunk@14827 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mtx-context-listing.tex')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mtx-context-listing.tex | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-listing.tex b/Master/texmf-dist/tex/context/base/mtx-context-listing.tex new file mode 100644 index 00000000000..5c978fc6a33 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mtx-context-listing.tex @@ -0,0 +1,76 @@ +% engine=luatex + +%D \module +%D [ file=mtx-context-listing, +%D version=2008.11.10, % about that time i started playing with this +%D title=\CONTEXT\ Extra Trickry, +%D subtitle=Listing Files, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is a \TEXEXEC\ features that has been moved to \MKIV. + +% begin help +% +% usage: context --extra=listing [options] list-of-files +% +% --sort : sort filenames first +% --topspace=dimension : distance above first line +% --backspace=dimension : distance before left margin +% --pretty : pretty print comform suffix (temporarily disabled) +% +% end help + +\setupbodyfont + [11pt,tt] + +\setuplayout + [header=0cm, + footer=1.5cm, + width=middle, + height=middle] + +% todo: use \arguments{topspace} + +\startluacode + local topspace = document.arguments["topspace"] or 0 + if dimen(topspace) > dimen(0) then + tex.sprint(string.format("\\setuplayout[topspace=%s]",dimen(topspace))) + end + local backspace = document.arguments["backspace"] or 0 + if dimen(topspace) > dimen(0) then + tex.sprint(string.format("\\setuplayout[backspace=%s]",dimen(backspace))) + end +\stopluacode + +\setuptyping + [lines=yes] + +\setuptyping + [option=color] + +\starttext + +\startluacode + if #document.files > 0 then + if document.arguments["sort"] then + table.sort(document.files) + end + for _, filename in ipairs(document.files) do + if not string.find(filename,"^mtx%-context%-") then + tex.sprint("\\page\n") + tex.sprint(string.format("\\setupfootertexts[\\detokenize{%s}][\\pagenumber]\n",file.basename(filename))) + tex.sprint(string.format("\\typefile{%s}",filename)) + end + end + else + tex.sprint(tex.ctxcatcodes,"no files given") + end +\stopluacode + +\stoptext |