summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/mtx-context-trim.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-22 22:14:39 +0000
committerKarl Berry <karl@freefriends.org>2016-04-22 22:14:39 +0000
commitfc4466b32ed330a956ac603b00fd145524cff49a (patch)
tree2c50e2b8de13aa9233b2c76dffe201558f169e86 /Master/texmf-dist/tex/context/base/mkiv/mtx-context-trim.tex
parent50e2368597d5f6fe2057195d0ae6a9f2044923e4 (diff)
context (22apr16)
git-svn-id: svn://tug.org/texlive/trunk@40691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/mtx-context-trim.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-trim.tex72
1 files changed, 72 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-trim.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-trim.tex
new file mode 100644
index 00000000000..46d0c31886b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-trim.tex
@@ -0,0 +1,72 @@
+%D \module
+%D [ file=mtx-context-trim,
+%D version=2016.03.04,
+%D title=\CONTEXT\ Extra Trickry,
+%D subtitle=Trimming Files,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 very old module based feature that has been moved to \MKIV.
+
+% begin help
+%
+% usage: context --extra=trim [options] filename
+%
+% --paperwidth : target paperwidth
+% --paperheight : target paperheight
+% --file : processed file
+% --x : page x offset
+% --y : page y offset
+% --hoffset : horizontal clip offset
+% --voffset : vertical clip offset
+% --width : clip width
+% --height : clip height
+%
+% example: context --extra=trim --file=trimtest --hoffset=3.50cm --voffset=3.50cm --width=15cm --height=21cm
+%
+% end help
+
+\input mtx-context-common.tex
+
+\setdocumentargumentdefault {paperwidth} {21cm}
+\setdocumentargumentdefault {paperheight} {29.7cm}
+\setdocumentargumentdefault {file} {\getdocumentfilename{1}}
+\setdocumentargumentdefault {hoffset} {0cm}
+\setdocumentargumentdefault {voffset} {0cm}
+\setdocumentargumentdefault {width} {17cm}
+\setdocumentargumentdefault {height} {24cm}
+\setdocumentargumentdefault {x} {0cm}
+\setdocumentargumentdefault {y} {0cm}
+
+\doifnothing{\getdocumentargument{file}} {\starttext missing filename \stoptext}
+\doif {\getdocumentargument{file}}{\inputfilename.tex}{\starttext missing filename \stoptext}
+
+\definepapersize
+ [fuzzy]
+ [width=\getdocumentargument{paperwidth},
+ height=\getdocumentargument{paperheight}]
+
+\setuppapersize
+ [fuzzy]
+ [fuzzy]
+
+\setuplayout
+ [page]
+
+\starttext
+
+ \trimpages
+ [file=\getdocumentargument{file},
+ hoffset=\getdocumentargument{hoffset},
+ voffset=\getdocumentargument{voffset},
+ width=\getdocumentargument{width},
+ height=\getdocumentargument{height},
+ x=\getdocumentargument{x},
+ y=\getdocumentargument{y}]
+
+\stoptext