diff options
Diffstat (limited to 'macros/generic/olsak-misc/cropmarks.tex')
-rw-r--r-- | macros/generic/olsak-misc/cropmarks.tex | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/macros/generic/olsak-misc/cropmarks.tex b/macros/generic/olsak-misc/cropmarks.tex index d098f8144e..155581692f 100644 --- a/macros/generic/olsak-misc/cropmarks.tex +++ b/macros/generic/olsak-misc/cropmarks.tex @@ -42,6 +42,13 @@ \def\middleB{\vbox to0pt{\kern\gap\copy\vrul\vss}} \def\middleL{\llap{\copy\hrul\kern\gap}} \def\middleR{\rlap{\kern\gap\copy\hrul}} +\def\middleV#1#2{\setbox0=\hbox to#2{#1\kern\gap\hlin#1\hlin\kern\gap#1}% + \vbox to0pt{\vss\box0\vss}} +\def\middleH#1#2{\setbox0=\vbox to#2{#1\kern\gap\vlin#1\vlin\kern\gap#1}% + \hbox to0pt{\hss\box0\hss}} +\def\hlin{\leaders\vrule height.5\mthick depth.5\mthick\hfil} +\def\vlin{\leaders\hrule width\mthick\vfil} +\def\middledim{\csname mc?h\the\tmpnum\endcsname} % \cropmarks{box} % creates a dimension-less crop marks around the box and prints the box with them: @@ -61,7 +68,10 @@ \vss \tmpnum=0 \loop \ifnum\tmpnum<\hmiddle \advance\tmpnum by1 - \hbox to\dimen0{\middleL\hss\middleR}% + \hbox to\dimen0 + \ifcsname mc?h\the\tmpnum\endcsname + {\middleH\middleL\middledim \hss \middleH\middleR\middledim}% + \else {\middleL\hss\middleR}\fi \vss \repeat \hbox to\dimen0{\cropLB\hss\vmiddleloop\middleB \cropRB} } @@ -70,7 +80,9 @@ \loop \ifnum\tmpnum<\vmiddle \advance\tmpnum by1 - #1\hss + \ifcsname mc?v\the\tmpnum\endcsname \middleV#1{\csname mc?v\the\tmpnum\endcsname}% + \else #1\fi + \hss \repeat } \def\docropmarks{% @@ -98,6 +110,8 @@ \def\today {\the\year-\othe\month-\othe\day} % you can re-define this format \ifx\optexversion\undefined \catcode`\_=12 \fi % names can include _ character +\def\middlecrop #1:#2{\expandafter\def\csname mc?#1\endcsname{#2}} + \endinput @@ -165,3 +179,37 @@ first and then you can add cropmarks for whole sheets. Use another software (or your TeX macro or use OpTeX trick 0088) for creating sheets and create a new PDF document. Then set appropriate number of middle marks and read this new document with sheets at input side when you are using cropmarks.tex + +The middle marks are only single lines by default (intendend for paper bend +only). Sometimes we need to leave a space for crop area here too. This is +possible by \middlecrop vnum:{dimen} or \middlecrop hnum:{dimen} +declaration. The "h" is declaration for \hmiddle marks (left+right +margins) and "v" for \vmiddle marks (top+bottom margins). The "num" is order +number of given middle mark and dimen is the amout of the space between crop +marks created here (the single-line mark for paper bend is added between +them to the center). For example, you can create "imposition sheets" with 8 +pages per sheet shown in the example of the OpTeX trick 0088. See also +https://en.wikipedia.org/wiki/Imposition. Then you can declare: + + \hmiddle=1 \middlecrop h1: {18mm} + \vmiddle=3 \middlecrop v2: {14mm} + +It says that there is single \hmiddle mark which is intended for bend +followed by crop 9mm and there is first and third \vmiddle mark intended for +bend only and second \vmiddle mark is used for bend followed by crop 7mm. +We get something like this: + + _| | |_|_| | |_ + + page page page page + + _ _ + _| |_ + _| |_ + + + page page page page + _ _ _ _ + | | | | | | | + + |