Debian Codegraph @

texmf-dist/source/latex/koma-script/japanlco.dtx

raw
1 % \iffalse meta-comment
2 % ======================================================================
3 % japanlco.dtx
4 % Copyright (c) Markus Kohm, 2008-2023
5 %
6 % This file is part of the LaTeX2e KOMA-Script bundle.
7 %
8 % This work may be distributed and/or modified under the conditions of
9 % the LaTeX Project Public License, version 1.3c of the license.
10 % The latest version of this license is in
11 % http://www.latex-project.org/lppl.txt
12 % and version 1.3c or later is part of all distributions of LaTeX
13 % version 2005/12/01 or later and of this work.
14 %
15 % This work has the LPPL maintenance status "author-maintained".
16 %
17 % The Current Maintainer and author of this work is Markus Kohm.
18 %
19 % This work consists of all files listed in MANIFEST.md.
20 % ======================================================================
21 %%% From File: $Id: japanlco.dtx 4032 2023-04-17 09:45:11Z kohm $
22 %<Ni&EARLY&LOW&head>%%% (run: Ni,EARLY,LOW,head)
23 %<Ni&EARLY&LOW&body>%%% (run: Ni,EARLY,LOW,body)
24 %<Ni&EARLY&HIGH&head>%%% (run: Ni,EARLY,HIGH,head)
25 %<Ni&EARLY&HIGH&body>%%% (run: Ni,EARLY,HIGH,body)
26 %<Ni&LATE&LOW&head>%%% (run: Ni,LATE,LOW,head)
27 %<Ni&LATE&LOW&body>%%% (run: Ni,LATE,LOW,body)
28 %<Ni&LATE&HIGH&head>%%% (run: Ni,LATE,HIGH,head)
29 %<Ni&LATE&HIGH&body>%%% (run: Ni,LATE,HIGH,body)
30 %<Ni&RIGHT&LOW&head>%%% (run: Ni,RIGHT,LOW,head)
31 %<Ni&RIGHT&LOW&body>%%% (run: Ni,RIGHT,LOW,body)
32 %<Kaku&LATE&LOW&head>%%% (run: Kaku,LATE,LOW,head)
33 %<Kaku&LATE&LOW&body>%%% (run: Kaku,LATE,LOW,body)
34 %<*dtx>
35 \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
36 \begingroup
37 \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
38 \filedate$Date: 2023-04-17 11:45:11 +0200 (Mo, 17. Apr 2023) $
39 \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
40 \filerevision$Revision: 4032 $
41 \endgroup
42 \ProvidesFile{japanlco.dtx}[\filedate\space\filerevision\space
43 KOMA-Script (letter class options)]
44 \ifx\documentclass\undefined
45 \ifx\ifTopLevel\undefined
46 \input scrdocstrip.tex
47 \@@input scrkernel-version.dtx
48 \@@input scrstrip.inc
49 \KOMAdefVariable{COPYRIGHTFROM}{2007}
50 \generate{\usepreamble\defaultpreamble
51 \file{NipponEL.lco}{%
52 \from{scrkernel-version.dtx}{trace}%
53 \from{japanlco.dtx}{lco,Ni,EARLY,LOW,head}%
54 \from{japanlco.dtx}{lco,Ni,EARLY,LOW,body}%
55 }%
56 \file{NipponEH.lco}{%
57 \from{scrkernel-version.dtx}{trace}%
58 \from{japanlco.dtx}{lco,Ni,EARLY,HIGH,head}%
59 \from{japanlco.dtx}{lco,Ni,EARLY,HIGH,body}%
60 }%
61 \file{NipponLL.lco}{%
62 \from{scrkernel-version.dtx}{trace}%
63 \from{japanlco.dtx}{lco,Ni,LATE,LOW,head}%
64 \from{japanlco.dtx}{lco,Ni,LATE,LOW,body}%
65 }%
66 \file{NipponLH.lco}{%
67 \from{scrkernel-version.dtx}{trace}%
68 \from{japanlco.dtx}{lco,Ni,LATE,HIGH,head}%
69 \from{japanlco.dtx}{lco,Ni,LATE,HIGH,body}%
70 }%
71 \file{NipponRL.lco}{%
72 \from{scrkernel-version.dtx}{trace}%
73 \from{japanlco.dtx}{lco,Ni,RIGHT,LOW,head}%
74 \from{japanlco.dtx}{lco,Ni,RIGHT,LOW,body}%
75 }%
76 \file{KakuLL.lco}{%
77 \from{scrkernel-version.dtx}{trace}%
78 \from{japanlco.dtx}{lco,Kaku,LATE,LOW,head}%
79 \from{japanlco.dtx}{lco,Kaku,LATE,LOW,body}%
80 }%
81 }%
82 \@@input scrstrop.inc
83 \fi
84 \else
85 \let\endbatchfile\relax
86 \fi
87 \endbatchfile
88 \documentclass[USenglish]{koma-script-source-doc}
89 \usepackage{babel}
90 \usepackage{graphicx}
91 \begin{document}
92 \DocInput{japanlco.dtx}
93 \end{document}
94 %</dtx>
95 % \fi
96 %
97 % \changes{v2.98}{2007/11/13}{first version based on lco files from Gernot
98 % Hassenpflug}
99 % \changes{v3.36}{2022/01/21}{switch over to \cls*{koma-script-source-doc}}
100 % \changes{v3.36}{2022/01/21}{using \cs{setplength} and \cs{addtoplength}
101 % instead of \cs{@setplength} and \cs{@addtoplength}}
102 % \changes{v3.36}{2022/02/02}{self-extracting}
103 % \changes{v3.36}{2022/02/02}{extended documentation}
104 % \changes{v3.40}{2023/04/17}{guide names changed}
105 %
106 % \GetFileInfo{japanlco.dtx}
107 % \title{\href{https://komascript.de}{\KOMAScript} \partname\
108 % \texttt{\filename}}
109 % \date{Version \fileversion{} of \filedate}
110 % \author{Markus Kohm}
111 % \maketitle
112 % \tableofcontents
113 %
114 % \section{Option Files for Japanese Letters}
115 %
116 % Gernot Hassenpflug wrote a lot of \file{lco}-files for use of Japanese
117 % envelope formats. Markus Kohm, the author of \KOMAScript, adapted them to
118 % an extended version of \cls*{scrlttr2} and wrote a \file{dtx}-file with the
119 % moste recent \file{lco}-files. Table~\ref{tab:japan.envelopes} shows all
120 % \file{lco}-files of the supported envelopes with their datas.
121 %
122 % \begin{table}
123 % \begin{tabular}{@{}llllllll@{}}
124 % \hline
125 % \file{lco}-file & \multicolumn3{l}{Envelope} & \multicolumn4{l@{}}{Window} \\
126 % & Name & Length & Width & H-pos & V-pos & Width & Height\\
127 % \cline{1-3}\cline{4-8}
128 % \texttt{NipponEL} &
129 % Chou/You 3 & 235\,mm & 120\,mm & 22\,mm & 12\,mm & 90\,mm & 45\,mm \\
130 % \texttt{NipponEH} &
131 % Chou/You 3 & 235\,mm & 120\,mm & 22\,mm & 12\,mm & 90\,mm & 55\,mm \\
132 % \texttt{NipponLL} &
133 % Chou/You 3 & 235\,mm & 120\,mm & 25\,mm & 12\,mm & 90\,mm & 45\,mm \\
134 % \texttt{NipponLH} &
135 % Chou/You 3 & 235\,mm & 120\,mm & 25\,mm & 12\,mm & 90\,mm & 55\,mm \\
136 % \texttt{NipponEL} &
137 % Chou/You 4 & 205\,mm & 90\,mm & 22\,mm & 12\,mm & 90\,mm & 45\,mm \\
138 % \texttt{NipponEH} &
139 % Chou/You 4 & 205\,mm & 90\,mm & 22\,mm & 12\,mm & 90\,mm & 55\,mm \\
140 % \texttt{NipponLL} &
141 % Chou/You 4 & 205\,mm & 90\,mm & 25\,mm & 12\,mm & 90\,mm & 45\,mm \\
142 % \texttt{NipponLH} &
143 % Chou/You 4 & 205\,mm & 90\,mm & 25\,mm & 12\,mm & 90\,mm & 55\,mm \\
144 % \texttt{NipponRL} &
145 % Chou/You 4 & 205\,mm & 90\,mm & 98\,mm & 28\,mm & 90\,mm & 45\,mm \\
146 % \texttt{KakuLL} &
147 % Kaku-kata & 312\,mm & 228\,mm & 25\,mm & 24\,mm & 90\,mm & 45\,mm \\
148 % \hline
149 % \end{tabular}
150 % \caption{The supported Japanese envelopes}
151 % \label{tab:japan.envelopes}
152 % \end{table}
153 %
154 % \iftrue
155 % The following pages show images of example envelopes. For more information
156 % see the English \file{scrguide-en.pdf} or the German
157 % \file{scrguide-de.pdf}.
158 %
159 % \newcommand\japanenvelope[7]{%
160 % \begingroup
161 % \setlength{\unitlength}{1mm}%^^A
162 % \rotatebox{90}{\begin{picture}(#1,#2)
163 % \thinlines
164 % \put(0,0){^^A
165 % \framebox(#1,#2){}%^^A
166 % }%^^A
167 % \put(5,5){\texttt{#7}: #1\,mm$\times$#2\,mm (B$\times$H)}%^^A
168 % \csname @tempcnta\endcsname #2
169 % \advance\csname @tempcnta\endcsname -#4
170 % \put(0,\csname @tempcnta\endcsname){\vector(1,0){#3}}%^^A
171 % \put(#3,\csname @tempcnta\endcsname){\vector(-1,0){#3}}%^^A
172 % \put(0,\csname @tempcnta\endcsname){^^A
173 % \makebox(#3,\baselineskip\csname @gobble\endcsname){#3\,mm}}%^^A
174 % \put(#3,#2){\vector(0,-1){#4}}%^^A
175 % \put(#3,\csname @tempcnta\endcsname){\vector(0,1){#4}}%^^A
176 % \put(#3,\csname @tempcnta\endcsname){^^A
177 % \makebox(0,#4)[l]{~#4\,mm}}
178 % \advance\csname @tempcnta\endcsname -#6
179 % \put(#3,\csname @tempcnta\endcsname){^^A
180 % \framebox(#5,#6){}%^^A
181 % }%^^A
182 % \put(#3,\csname @tempcnta\endcsname){^^A
183 % \makebox(0,5)[l]{~#5\,mm$\times$#6\,mm (B$\times$H)}%^^A
184 % }%^^A
185 % \end{picture}}
186 % \endgroup
187 % }
188 %
189 % \expandafter\ifx\csname rotatebox\endcsname\relax\else
190 % \clearpage
191 % \vspace*{\fill}\smash{\japanenvelope{235}{120}{22}{12}{90}{45}{Chou 3 EL}}%
192 % \clearpage
193 % \vspace*{\fill}\smash{\japanenvelope{235}{120}{22}{12}{90}{55}{Chou 3 EH}}%
194 % \clearpage
195 % \vspace*{\fill}\smash{\japanenvelope{235}{120}{25}{12}{90}{45}{Chou 3 LL}}%
196 % \clearpage
197 % \vspace*{\fill}\smash{\japanenvelope{235}{120}{25}{12}{90}{55}{Chou 3 LH}}%
198 % \clearpage
199 % \vspace*{\fill}\smash{\japanenvelope{205}{90}{22}{12}{90}{45}{Chou 4 EL}}%
200 % \clearpage
201 % \vspace*{\fill}\smash{\japanenvelope{205}{90}{22}{12}{90}{55}{Chou 4 EH}}%
202 % \clearpage
203 % \vspace*{\fill}\smash{\japanenvelope{205}{90}{25}{12}{90}{45}{Chou 4 LL}}%
204 % \clearpage
205 % \vspace*{\fill}\smash{\japanenvelope{205}{90}{25}{12}{90}{55}{Chou 4 LH}}%
206 % \clearpage
207 % \vspace*{\fill}\smash{\japanenvelope{205}{90}{98}{28}{90}{45}{Chou 4 RL}}%
208 % \clearpage
209 % \fi
210 %\fi
211 %
212 % \StopEventually{\PrintIndex}
213 %
214 % \section{Implementation}
215 % \begin{macrocode}
216 %<*lco>
217 % \end{macrocode}
218 %
219 % \subsection{The File Header}
220 %
221 % Declaration of the file.
222 % \begin{macrocode}
223 %<*head>
224 \ProvidesFile{%
225 %<Ni> Nippon%
226 %<Kaku> Kaku%
227 %<EARLY> E%
228 %<LATE> L%
229 %<RIGHT> R%
230 %<LOW> L%
231 %<HIGH> H%
232 }[%
233 %!KOMAScriptVersion
234 Japanese letter-class-option]
235 % \end{macrocode}
236 %
237 % \begin{command}{\LCOWarningNoLine}
238 % \begin{command}{\LCOWarning}
239 % We need macros that are similar to |\ClassWarningNoLine| or
240 % |\PackageWarningNoLine| and |\ClassWarning| or |\PackageWarning|
241 % \begin{macrocode}
242 \providecommand*\LCOWarningNoLine[2]{%
243 \LCOWarning{#1}{#2\@gobble}%
244 }
245 \providecommand*\LCOWarning[2]{%
246 \GenericWarning{%
247 (#1)\@spaces\@spaces\@spaces\@spaces\@spaces\@spaces\@spaces
248 }{%
249 Letter class option #1 Warning: #2%
250 }%
251 }
252 %</head>
253 % \end{macrocode}
254 % \end{command}
255 % \end{command}
256 %
257 %
258 % \subsection{Main-Part}
259 %
260 % Check the class.
261 % \changes{v3.25a}{2018/04/17}{check not only for \cls*{scrlttr2} but also
262 % for \pkg*{scrletter}}%^^A
263 % \begin{macrocode}
264 %<*body>
265 \@ifundefined{scr@fromname@var}{%
266 \LCOWarningNoLine{%
267 %<Ni> Nippon%
268 %<Kaku> Kaku%
269 %<EARLY> E%
270 %<LATE> L%
271 %<RIGHT> R%
272 %<LOW> L%
273 %<HIGH> H%
274 }{%
275 This letter class option file was made only\MessageBreak
276 to be used with KOMA-Script letter class\MessageBreak
277 `scrlttr2' or letter package `scrletter'.\MessageBreak
278 Use with other classes and without that package\MessageBreak
279 can result in a lot of errors%
280 }%
281 }{}
282 % \end{macrocode}
283 %
284 % Is the expected paper size used?
285 % \begin{macrocode}
286 \LetterOptionNeedsPapersize{%
287 %<Ni> Nippon%
288 %<Kaku> Kaku%
289 %<EARLY> E%
290 %<LATE> L%
291 %<RIGHT> R%
292 %<LOW> L%
293 %<HIGH> H%
294 }{a4}
295 % \end{macrocode}
296 %
297 % All the values
298 % \begin{variable}{fromzipcode}
299 % \changes{v3.03}{2009/03/04}{set term of variable \texttt{fromzipcode}}
300 % \begin{macrocode}
301 \setkomavar*{fromzipcode}{J}
302 % \end{macrocode}
303 % \end{variable}
304 % \begin{pseudolength}{foldmarkhpos,
305 % tfoldmarkvpos,tfoldmarklength,
306 % mfoldmarkvpos,mfoldmarklength,
307 % bfoldmarkvpos,bfoldmarklength,
308 % foldmarkvpos,lfoldmarkhpos}
309 % The fold marks. All of them are universal for Japanese \file{lco}-files.
310 % \begin{macrocode}
311 \setplength{foldmarkhpos}{3.5mm}
312 \setplength{tfoldmarkvpos}{83mm}
313 \setplength{tfoldmarklength}{4mm}
314 \setplength{mfoldmarkvpos}{116mm}
315 \setplength{mfoldmarklength}{2mm}
316 \setplength{bfoldmarkvpos}{232mm}
317 \setplength{bfoldmarklength}{2mm}
318 \setplength{foldmarkvpos}{3.5mm}
319 \setplength{lfoldmarkhpos}{202mm}
320 % \end{macrocode}
321 % \end{pseudolength}
322 % \begin{pseudolength}{toaddrhpos,toaddrvpos,toaddrwidth,toaddrheight}
323 % The size and position of the address window. These values are the main
324 % difference of the envelopes. The original values (all in cm) by Gernot:
325 % \begin{center}
326 % \begin{tabular}{lcccc}
327 % \hline
328 % Type & x & w & y & h \\
329 % \hline
330 % NipponEL & 22 & 90 & 12 & 45 \\
331 % NipponEH & 22 & 90 & 12 & 55 \\
332 % NipponLL & 25 & 90 & 12 & 45 \\
333 % NipponLH & 25 & 90 & 12 & 55 \\
334 % NipponRL & 98 & 90 & 28 & 45 \\
335 % KakuLL & 25 & 90 & 24 & 45 \\
336 % \hline
337 % \end{tabular}
338 % \end{center}
339 % \begin{macrocode}
340 %<EARLY>\setplength{toaddrhpos}{22mm}
341 %<LATE>\setplength{toaddrhpos}{25mm}
342 %<RIGHT>\setplength{toaddrhpos}{-22mm}
343 \setplength{toaddrwidth}{90mm}
344 %<Ni&!RIGHT>\setplength{toaddrvpos}{12mm}
345 %<Ni&RIGHT>\setplength{toaddrvpos}{28mm}
346 %<Kaku>\setplength{toaddrvpos}{24mm}
347 %<LOW>\setplength{toaddrheight}{40mm}
348 %<HIGH>\setplength{toaddrheight}{50mm}
349 % \end{macrocode}
350 % \end{pseudolength}
351 % \begin{pseudolength}{toaddrindent,backaddrheight,
352 % specialmailindent,specialmailrightindent}
353 % These are also inside the address window and same for all Japanese
354 % envelopes.
355 % \begin{macrocode}
356 \setplength{toaddrindent}{\z@}
357 \setplength{backaddrheight}{5mm}
358 \setplength{specialmailindent}{\fill}
359 \setplength{specialmailrightindent}{1em}
360 % \end{macrocode}
361 % \end{pseudolength}
362 % \begin{pseudolength}{locwidth,locheight}
363 % The location field also depends on the address field.
364 % \begin{macrocode}
365 \setplength{locwidth}{\z@}
366 %<Ni>\setplength{locheight}{55mm}%
367 %<Kaku>\setplength{locheight}{45mm}%
368 % \end{macrocode}
369 % \end{pseudolength}
370 % \begin{pseudolength}{refvpos,refwidth,refaftervskip}
371 % While the position of the reference line also depends on the address field,
372 % the space below it is fix. The zero of \plen{revwidth} is a magic. See
373 % \file{scrkernel-notepaper.dtx} for more information.
374 % \begin{macrocode}
375 %<!Ni|!RIGHT>\setplength{refvpos}{69mm}
376 %<Ni&RIGHT>\setplength{refvpos}{84mm}
377 \setplength{refaftervskip}{\baselineskip}
378 \setplength{refwidth}{\z@}
379 % \end{macrocode}
380 % \end{pseudolength}
381 % \begin{pseudolength}{firstheadvpos,firstheadwidth}
382 % The header also depends on the address field. This is the reason we have
383 % not defined it first, despite it is the first field.
384 % \begin{macrocode}
385 \setplength{firstheadvpos}{8mm}
386 \setplength{firstheadwidth}{\paperwidth}
387 \ifdim \useplength{toaddrhpos}>\z@
388 \addtoplength[-2]{firstheadwidth}{\useplength{toaddrhpos}}
389 \else
390 \addtoplength[2]{firstheadwidth}{\useplength{toaddrhpos}}
391 \fi
392 % \end{macrocode}
393 % \end{pseudolength}
394 % \begin{pseudolength}{firstfootwidth,firstfootvpos}
395 % The width of the footer depends on the width of the header. The position
396 % depends on the paper height.
397 % \begin{macrocode}
398 \setplength{firstfootwidth}{\useplength{firstheadwidth}}
399 \setplength{firstfootvpos}{\paperheight}
400 \addtoplength{firstfootvpos}{-16mm}
401 % \end{macrocode}
402 % \end{pseudolength}
403 % \begin{pseudolength}{sigindent,sigbeforevskip}
404 % Values of the signature
405 % \begin{macrocode}
406 \setplength{sigindent}{\z@}
407 \setplength{sigbeforevskip}{2\baselineskip}
408 % \end{macrocode}
409 % \end{pseudolength}
410 % \begin{command}{\raggedsignature}
411 % The signature is centered, but maybe this should be changed to
412 % \cs{raggedright}?
413 % \begin{macrocode}
414 \let\raggedsignature=\centering
415 % \end{macrocode}
416 % \end{command}
417 %
418 % \begin{option}{fromalign}
419 % The default alignment of the sender is in the location field.
420 % \begin{macrocode}
421 \ifcase\@alignfrom
422 \KOMAoptions{fromalign=locationright}%
423 \or
424 \KOMAoptions{fromalign=locationright}%
425 \or
426 \KOMAoptions{fromalign=locationright}%
427 \fi
428 % \end{macrocode}
429 % \end{option}
430 %
431 % \begin{macrocode}
432 %</body>
433 %</lco>
434 % \end{macrocode}
435 %
436 % \Finale
437 % \PrintChanges
438 %
439 \endinput
440 % Local Variables:
441 % mode: doctex
442 % ispell-local-dictionary: "en_US"
443 % eval: (flyspell-mode 1)
444 % TeX-master: t
445 % TeX-engine: luatex-dev
446 % eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
447 % End: