summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-collatingmarks/t-collatingmarks/tex/context/third/collatingmarks/t-collatingmarks.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/context/contrib/context-collatingmarks/t-collatingmarks/tex/context/third/collatingmarks/t-collatingmarks.tex')
-rw-r--r--macros/context/contrib/context-collatingmarks/t-collatingmarks/tex/context/third/collatingmarks/t-collatingmarks.tex244
1 files changed, 0 insertions, 244 deletions
diff --git a/macros/context/contrib/context-collatingmarks/t-collatingmarks/tex/context/third/collatingmarks/t-collatingmarks.tex b/macros/context/contrib/context-collatingmarks/t-collatingmarks/tex/context/third/collatingmarks/t-collatingmarks.tex
deleted file mode 100644
index c1c2443707..0000000000
--- a/macros/context/contrib/context-collatingmarks/t-collatingmarks/tex/context/third/collatingmarks/t-collatingmarks.tex
+++ /dev/null
@@ -1,244 +0,0 @@
-%D \module
-%D [ file=t-collatingmarks,
-%D version=2022.01.01,
-%D title=\CONTEXT\ User Module,
-%D subtitle=Environment for collating marks,
-%D author={W. Egger},
-%D date=\currentdate,
-%D copyright={W. Egger},
-%D email=w.egger@boede.nl,
-%D license=Public Domain]
-
-% context --ctx=s-mod t-collatingmarks.tex
-% \enablemode[demo]
-
-%M \startmodule[collatingmarks]
-
-%D \startsubject[title={Introduction}]
-%D
-%D This code is based on the work of Thomas A. Schmitz,
-%D who created the module for different crop marks.
-%D
-%D If a book consists of multiple sections, each section should be marked
-%D along the spine with a collating mark. This mark moves down along the spine
-%D according to the number of the section. After collating the book it becomes
-%D easy to check whether the sequence of the sections is correct. One should
-%D see a \quotation{stair case} on the spine of the book as shown in the following figure.
-
-%D \startexample
-%D \startuniqueMPgraphic{Collatingblocks}
-%D numeric b,w,h;
-%D b := \the\textwidth;
-%D w := .75b;
-%D h := .2b;
-%D pair A,B;
-%D path sq,p[],block[];
-%D sq := unitsquare xscaled w yscaled h;
-%D block[1] := unitsquare xscaled (.1w) yscaled (h/6);
-%D block[1] := block[1] shifted (0.1w,h-h/6);
-%D fill block[1];
-%D label.bot(textext("\switchtobodyfont[6pt] \white\rotate[rotation=90]{1}"),center block[1] shifted (0,.5*h/12));
-%D draw sq;
-%D A := llcorner sq;
-%D B := lrcorner sq;
-%D p[1] := A--B;
-%D for i = 1 upto 5 :
-%D p[i+1] := p[1] shifted (0,h/6*i);
-%D draw p[i+1];
-%D endfor;
-%D for i = 1 upto 5 :
-%D block[i+1] := block[1] shifted (i*.1w, -i*h/6);
-%D fill block[i+1];
-%D numeric ii;
-%D ii := i+1;
-%D label.bot(textext("\switchtobodyfont[6pt] \white\rotate[rotation=90]{"& decimal ii &"}"),
-%D center block[i+1] shifted (0,.5*h/12));
-%D endfor;
-%D \stopuniqueMPgraphic
-%D \placefigure[middle,none][]{}{\useMPgraphic{Collatingblocks}}
-%D \stopexample
-%D \stopsubject
-%D
-%D \startsubject[title={Using the module}]
-%D
-%D If the collating marks should be placed, then the system should be setup with
-%D
-%D \starttyping
-%D \usemodule[collatingmarks][Collatingmarks=yes]
-%D \setupMPvariables
-%D [pages=8,
-%D sheets=2,
-%D horpageshift=0mm]
-%D \stoptyping
-%D
-%D Note that the
-%D collating marks-setup needs to know how many pages are placed on a
-%D doublesided printed sheet of paper and how many such sheets result in a
-%D section i.e. these values depend on the \type{\setuparranging} command. The
-%D shift-option is 0~mm if no horizontal page shifting is issued during
-%D imposition. If a horizontal page shifting is used, then the shift option is
-%D used to position the collating mark precisely on the centre of the spine.
-%D
-%D Be aware that the use of collating marks in MKII causes a lot of calls to
-%D \METAPOST, resulting in very long compilation times.
-%D
-%D So better use MKIV or LMTX where METAPOST\ is included as a
-%D library. In this case the time overhead is absolutely minimal.
-%D
-%D \stopsubject
-%D
-%D \startsubject[title={Vocabulary}]
-%D
-%D EN: Collating mark, DE: Kollationiermarke, NL: collationeerblokje
-%D
-%D\stopsubject
-%D
-%D \startsubject[title=The module code]
-
-
-\writestatus{loading}{Context User Module / Collating Marks}
-
-\unprotect
-
-\setupmodule[Collatingmarks=yes]
-
-
-\def\MCMpages{16}
-\def\MCMsheets{1}
-\def\MCMshift{0mm}
-
-\setupMPvariables
- [Collatingmarks]
- [pages=\MCMpages, %pages per sheet doublesided
- sheets=\MCMsheets,% number of sheets forming one section
- horpageshift=\MCMshift]
-
-%D We prepare collating marks:
-
-\processaction[\currentmoduleparameter{Collatingmarks}]
- [yes=>\def\Collatingmarks{Collatingmarks},
- no=>\def\Collatingmarks{},
- \v!unknown=>\def\Collatingmarks{},
- \v!default=>\def\Collatingmarks{}]
-
-\startusableMPgraphic{Collatingmarks}
- StartPage;
-
- numeric offset, sectionno, pages, sheets, factor, correction, offset, pageshift;
- path p,q;
-
- pages := \MPvar{pages};
- sheets := \MPvar{sheets};
- pageshift:=\MPvar{horpageshift};
-
- z5colm = ulcorner Page;
- z6colm = (x5colm, y5colm-10mm);
-
- p := unitsquare xscaled 1mm yscaled 7mm;
-
- if \realfolio mod 2 = 1 : % on uneven pages only
- sectionno := \realfolio div (sheets*pages)+ 1;
- label.lrt(textext("\switchtobodyfont[5pt]"& decimal sectionno &""),llcorner Page shifted (1mm,-2mm));
- if \realfolio mod (sheets*pages) = 1 : % on the first page of a section only
- nofmarkings := (y6colm-7mm) div 7mm;
- offset := y6colm-sectionno*7mm;
- if sectionno > nofmarkings :
- correction := sectionno div nofmarkings;
- offset := y6colm-(sectionno-correction*nofmarkings)*7mm;
- fi;
- p := p shifted (-1mm-2pageshift,offset);
- fill p withcolor black;
- if sectionno < 9 :
- label.rt(textext("\switchtobodyfont[3pt] \white "& decimal sectionno &""), center p shifted (-1.3mm,0));
- else :
- label.rt(textext("\switchtobodyfont[3pt] \white "& decimal sectionno &""), center p shifted (-1.5mm,0));
- fi;
- fi;
- fi;
-\stopusableMPgraphic
-
-
-%D \startsubsubject[title={Implementation}]
-%D
-%D Collating marks are calculated and drawn by \METAPOST. The result is
-%D placed into an overlay which is used as a page background
-%D
-%D \starttyping
-%D \defineoverlay[Collatingmarks][\useMPgraphic{Collatingmarks}]
-%D \stoptyping
-%D
-\defineoverlay[Collatingmarks][\useMPgraphic{Collatingmarks}]
-%D
-%D \starttyping
-%D \setupbackgrounds[page][state=repeat,background={\Collatingmarks}]
-%D \stoptyping
-%D
-\setupbackgrounds[page][state=repeat,background={\Collatingmarks}]
-%D
-%D We let \METAPOST do the calculations and draw de collating marks.
-%D
-%D \stopsubsubject
-
-\protect
-
-%D \stopsubject
-%D
-%M \stopmodule
-
-
-
-
-\doifnotmode{demo}{\endinput}
-
-%D \startsubject[title={Example}]
-%D \starttyping
-%D \usemodule[collatingmarks][Collatingmarks=yes]
-%D \setuppapersize[A5][A2]
-%D \setuplayout[location=middle,marking=on]
-%D \setuppagenumbering[alternative=doublesided]
-%D \setuparranging[2*4]
-%D
-%D \setupMPvariables
-%D [pages=8, % pages per sheet of paper doublesided
-%D sheets=1, % sheets of paper used per section
-%D horpageshift=0mm] % used for correction if horizontal page-shifting is used while imposition is active
-%D
-%D \starttext
-%D \dorecurse
-%D {10}
-%D {\startsection[title={Text \recurselevel}]
-%D \input tufte \par
-%D \startsubject[title={Ward}]
-%D \input ward\par
-%D \stopsubject
-%D \stopsection%
-%D }
-%D \stoptext
-%D \stoptyping
-%D \stopsubject
-%D \stoptext
-
-
-\usemodule[collatingmarks][Collatingmarks=yes]
-\setuppapersize[A5][A2]
-\setuplayout[location=middle,marking=on]
-\setuppagenumbering[alternative=doublesided]
-\setuparranging[2*4]
-
-\setupMPvariables
- [pages=8, % pages per sheet of paper doublesided
- sheets=1, % sheets of paper used per section
- horpageshift=0mm] % used for correction if horizontal page-shifting is used while imposition is active
-
-\starttext
- \dorecurse
- {10}
- {\startsection[title={Text \recurselevel}]
- \input tufte \par
- \startsubject[title={Ward}]
- \input ward\par
- \stopsubject
- \stopsection%
- }
-\stoptext
-