Debian Codegraph @

texmf-dist/source/latex/koma-script/doc/variables-tikz.tex

raw
1 % ======================================================================
2 % variables-tikz.tex
3 % Copyright (c) Markus Kohm, 2005-2022
4 %
5 % This file is part of the LaTeX2e KOMA-Script bundle.
6 %
7 % This work may be distributed and/or modified under the conditions of
8 % the LaTeX Project Public License, version 1.3c of the license.
9 % The latest version of this license is in
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.3c or later is part of all distributions of LaTeX
12 % version 2005/12/01 or later and of this work.
13 %
14 % This work has the LPPL maintenance status "author-maintained".
15 %
16 % The Current Maintainer and author of this work is Markus Kohm.
17 %
18 % This work consists of all files listed in MANIFEST.md.
19 % ======================================================================
20 %
21 % Generation of plength figures at scrlttr2 chapter of the KOMA-Script
22 % guide
23 %
24 % Maintained by Markus Kohm
25 % Original metapost source by Stephan Hennig
26 % Original TikZ source by Marei Peischl
27 %
28 % ======================================================================
29
30 \KOMAProvidesFile{variables-tikz.tex}%
31 [$Date: 2022-06-05 12:40:11 +0200 (So, 05. Jun 2022) $
32 KOMA-Script guide (figure in scrlttr2.tex)]
33
34 \ExplSyntaxOn
35 \prop_if_exist:NF \l_this_plength_description_prop {
36 \prop_new:N \l_this_plength_description_prop
37 }
38 \prop_set_from_keyval:Nn \l_this_plength_description_prop {
39 firsthead=\Multi{\DescRef{scrlttr2.variable.firsthead}\\
40 \DescRef{scrlttr2.variable.fromname}\and
41 \DescRef{scrlttr2.variable.fromaddress}\and
42 \DescRef{scrlttr2.variable.fromphone}\and
43 \DescRef{scrlttr2.variable.fromfax}\and
44 \DescRef{scrlttr2.variable.fromemail}\and
45 \DescRef{scrlttr2.variable.fromurl}},
46 firstfoot=\DescRef{scrlttr2.variable.firstfoot},
47 backaddress =\DescRef{scrlttr2.variable.backaddress},
48 specialmail=\DescRef{scrlttr2.variable.specialmail},
49 refline=\Multi{\DescRef{scrlttr2.variable.yourref}\and
50 \DescRef{scrlttr2.variable.yourmail}\and
51 \DescRef{scrlttr2.variable.myref}\and
52 \DescRef{scrlttr2.variable.customer}\and
53 \DescRef{scrlttr2.variable.invoice}\and
54 \DescRef{scrlttr2.variable.place}\and
55 \DescRef{scrlttr2.variable.date}},
56 title=\DescRef{scrlttr2.variable.title},
57 subject=\DescRef{scrlttr2.variable.subject},
58 signature=\DescRef{scrlttr2.variable.signature},
59 location= \DescRef{scrlttr2.variable.location},
60 toaddr=\Macro{begin}\PParameter{\DescRef{scrlttr2.env.letter}}\Parameter{\toaddrname},
61 opening=\DescRef{scrlttr2.cmd.opening}\Parameter{\openingargumentname},
62 body=\desc\letterbodyname,
63 closing=\DescRef{scrlttr2.cmd.closing}\Parameter{\closingargumentname},
64 }
65
66 \prop_if_exist:NF \l_this_plength_var_prop {
67 \prop_new:N \l_this_plength_var_prop
68 }
69
70 \prop_set_from_keyval:Nn \l_this_plength_var_prop {
71 ticksize=1,
72 textwidth= 147,
73 textheight= 209.4,
74 evensidemargin= 6.1,
75 oddsidemargin = 6.1,
76 paperwidth = 210,
77 paperheight = 297,
78 baselineskip = .9\baselineskip, %3.86607,
79 headheight = 6,
80 headsep =7.2,
81 footskip =16.73,
82 foldmarkhpos = 3.5,
83 tfoldmarkvpos = 105,
84 bfoldmarkvpos = 210,
85 tfoldmarklength = 2,
86 pfoldmarklength = 4,
87 bfoldmarklength = 2,
88 toaddrvpos = 45,
89 refvpos = 98.5,
90 refaftervskip = \UseVar{baselineskip},
91 toaddrhpos = 20,
92 toaddrwidth = 85,
93 toaddrheight = 40,
94 toaddrindent = 6,
95 specialmailwidth = 50,
96 specialmailrightindent = 4,
97 specialmailheight = \UseVar{baselineskip},
98 locwidth = 37.5,
99 backaddrheight = 5,
100 firstheadvpos = 8,
101 firstheadwidth = \UseVar{paperwidth} - 2 * \UseVar{toaddrhpos},
102 firstfootwidth = \UseVar{firstheadwidth},
103 firstfootvpos = 16.58 + \UseVar{headheight} + \UseVar{headsep} + \UseVar{textheight} + \UseVar{footskip},
104 refwidth = 0,
105 sigindent = 0,
106 toaddrindent =0,
107 sigbeforevskip = 2*\UseVar{baselineskip},
108 firstheadhpos = 0.5* \UseVar{paperwidth}-.5*\UseVar{firstheadwidth},
109 firstheadheight = 5*\UseVar{baselineskip},
110 firstfoothpos = 0.5*(\UseVar{paperwidth}-\UseVar{firstfootwidth}),
111 firstfootheight = 3*\UseVar{baselineskip},
112 fromrulewidth = 0.5 * \UseVar{firstheadwidth},
113 lochpos = \UseVar{paperwidth}-\UseVar{toaddrhpos}-\UseVar{locwidth},
114 refhpos = 25.40+\UseVar{oddsidemargin},
115 text = \UseVar{refhpos},
116 textcenter = \UseVar{refhpos}+0.5*\UseVar{textwidth},
117 refheight = 2*\UseVar{baselineskip},
118 refwidth = \UseVar{textwidth},
119 titlevpos = \UseVar{refvpos}+\UseVar{refheight}+\UseVar{refaftervskip},
120 titlewidth = 90,
121 titleheight = 1.2*\UseVar{baselineskip},
122 subjectvpos = \UseVar{titlevpos}+\UseVar{titleheight}+1*\UseVar{baselineskip},
123 subjectwidth = 80,
124 subjectheight = \UseVar{baselineskip},
125 openingvpos = \UseVar{subjectvpos}+\UseVar{subjectheight}+2*\UseVar{baselineskip},
126 openingwidth = 60,
127 openingheight = \UseVar{baselineskip},
128 bodyvpos = \UseVar{openingvpos}+\UseVar{openingheight}+\UseVar{baselineskip},
129 bodywidth = \UseVar{textwidth},
130 bodyheight = 6*\UseVar{baselineskip},
131 typeareabottom = \UseVar{firstfootvpos}-\UseVar{footskip},
132 sigvpos = \UseVar{bodyvpos}+\UseVar{bodyheight}+\UseVar{baselineskip},
133 sigwidth = 50,
134 sigheight = \UseVar{baselineskip},
135 locvpos = \UseVar{toaddrvpos},
136 locheight = \UseVar{toaddrheight},
137 }
138 \def\UseVar#1{
139 \fp_eval:n {\prop_item:Nn \l_this_plength_var_prop {#1}}
140 }
141
142 \def\UseDesc#1{
143 \prop_item:Nn \l_this_plength_description_prop {#1}
144 }
145
146 \ExplSyntaxOff
147
148 \def\desc{\itshape}
149
150 \providecommand*{\Multi}[1]{%
151 {\def\and{, }%
152 \begin{tabular}{@{}l@{}}
153 #1
154 \end{tabular}
155 }%
156 }
157
158 \begin{tikzpicture}[fill=black!20]
159 \draw (0,0)rectangle (\UseVar{paperwidth},\UseVar{paperheight});
160
161 \filldraw(\UseVar{firstheadhpos},\UseVar{firstheadvpos})rectangle node{\UseDesc{firsthead}}+(\UseVar{firstheadwidth},\UseVar{firstheadheight});
162
163 \filldraw(\UseVar{toaddrhpos},\UseVar{toaddrvpos}) rectangle
164 node {\UseDesc{backaddress}}
165 +(\UseVar{toaddrwidth},\UseVar{backaddrheight});
166
167 \filldraw(\UseVar{toaddrhpos}+.5*\UseVar{toaddrwidth}-\UseVar{specialmailrightindent},\UseVar{toaddrvpos}+\UseVar{backaddrheight}) rectangle
168 node {\UseDesc{specialmail}}
169 +(.5*\UseVar{toaddrwidth},\UseVar{specialmailheight});
170
171 \filldraw(\UseVar{toaddrhpos}+\UseVar{toaddrindent},\UseVar{toaddrvpos}+\UseVar{backaddrheight}+\UseVar{specialmailheight})
172 rectangle node {\UseDesc{toaddr}}
173 +(\UseVar{toaddrwidth}-2*\UseVar{toaddrindent},\UseVar{toaddrheight}-\UseVar{backaddrheight}-\UseVar{specialmailheight});
174
175 \draw(\UseVar{toaddrhpos},\UseVar{toaddrvpos})rectangle+(\UseVar{toaddrwidth},\UseVar{toaddrheight});
176
177 \filldraw (\UseVar{refhpos},\UseVar{refvpos})rectangle node{\UseDesc{refline}}
178 +(\UseVar{refwidth},\UseVar{refheight});
179
180 \filldraw (\UseVar{textcenter}-.5*\UseVar{titlewidth},\UseVar{titlevpos})rectangle node{\UseDesc{title}}
181 +(\UseVar{titlewidth},\UseVar{titleheight});
182
183 \filldraw (\UseVar{text},\UseVar{subjectvpos})rectangle node{\UseDesc{subject}}
184 +(\UseVar{subjectwidth},\UseVar{subjectheight});
185
186 \filldraw (\UseVar{text},\UseVar{openingvpos})rectangle node{\UseDesc{opening}}
187 +(\UseVar{openingwidth},\UseVar{openingheight});
188
189 \filldraw (\UseVar{text},\UseVar{bodyvpos})rectangle node{\UseDesc{body}}
190 +(\UseVar{bodywidth},\UseVar{bodyheight});
191
192 \filldraw (\UseVar{text}+\UseVar{sigindent},\UseVar{sigvpos})rectangle node{\UseDesc{closing}}
193 +(\UseVar{sigwidth},\UseVar{sigheight});
194
195 \filldraw (\UseVar{text}+\UseVar{sigindent}+.1*\UseVar{sigwidth},\UseVar{sigvpos}+\UseVar{sigheight}+\UseVar{sigbeforevskip})rectangle node{\UseDesc{signature}}
196 +(.8*\UseVar{sigwidth},\UseVar{sigheight});
197
198 \filldraw (\UseVar{lochpos},\UseVar{locvpos}) rectangle node{\UseDesc{location}}+(\UseVar{locwidth},\UseVar{locheight});
199
200 \filldraw (\UseVar{firstfoothpos},\UseVar{firstfootvpos}) rectangle node{\UseDesc{firstfoot}} +(\UseVar{firstfootwidth},\UseVar{firstfootheight});
201
202 \draw[thick] (\UseVar{foldmarkhpos},\UseVar{tfoldmarkvpos}) --+(\UseVar{tfoldmarklength},0);
203 \draw[thick] (\UseVar{foldmarkhpos},.5*\UseVar{paperheight}) --+(\UseVar{pfoldmarklength},0);
204 \draw[thick] (\UseVar{foldmarkhpos},\UseVar{bfoldmarkvpos}) --+(\UseVar{bfoldmarklength},0);
205 \end{tikzpicture}
206
207 \endinput
208
209 %%% Local Variables:
210 %%% mode: latex
211 %%% coding: utf-8
212 %%% End: