Debian Codegraph @

texmf-dist/source/latex/bookcover/bookcover.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2015-2026 by Tibor Tómács
4 %
5 % This file may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.2
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in:
9 %
10 % http://www.latex-project.org/lppl.txt
11 %
12 % and version 1.2 or later is part of all distributions of LaTeX
13 % version 1999/12/01 or later.
14 %
15 % \fi
16 %
17 % \iffalse
18 %<*driver>
19 \ProvidesFile{bookcover.dtx}
20 \newcommand{\eifiledate}{2026/01/11}
21 \newcommand{\eifilever}{v3.9}
22 %</driver>
23 %<class>
24 %<class>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
25 %<class>\ProvidesClass{bookcover}[2026/01/11 v3.9 Class for book covers and dust jackets]
26 %
27 %<*driver>
28 \documentclass{ltxdoc}
29 \OnlyDescription
30 \usepackage[T1]{fontenc}
31 \AddToHook{begindocument/before}[doc/hyperref]{\hypersetup{pdfstartview=FitH,bookmarksnumbered,colorlinks,allcolors=teal}}
32 \usepackage[a4paper,margin=1in]{geometry}
33 \usepackage[english]{babel}
34 \usepackage{graphicx,listings,paralist,eso-pic,tikz,calc,lmodern}
35
36 \colorlet{command}{blue!80!black}
37 \colorlet{param}{green!50!black}
38 \colorlet{example}{teal}
39 \colorlet{bgexample}{black!10}
40
41 \lstnewenvironment{examplelst}{\lstset{
42 gobble=2,
43 basicstyle=\small\ttfamily,
44 backgroundcolor=\color{bgexample},
45 columns=fullflexible,
46 comment=[l][\ttfamily\color{teal}]{\%},
47 frame=single,
48 framesep=3pt,
49 framerule=1pt,
50 rulecolor=\color{example},
51 xleftmargin=4pt,
52 xrightmargin=4pt,
53 keepspaces}}{}
54
55 \lstnewenvironment{commandlst}{\lstset{
56 literate={<}{{$\langle$}}1{>}{{$\rangle$}}1,
57 delim=[is][\color{param}\normalfont\itshape\small]{!}{!},
58 gobble=2,
59 basicstyle=\color{command}\ttfamily,
60 columns=fullflexible,
61 frame=single,
62 framesep=3pt,
63 framerule=1pt,
64 rulecolor=\color{command!80!black},
65 xleftmargin=4pt,
66 xrightmargin=4pt,
67 keepspaces}}{}
68
69 \lstdefinestyle{examplefile}{
70 basicstyle=\small\ttfamily,
71 backgroundcolor=\color{bgexample},
72 columns=fullflexible,
73 keepspaces,
74 frame=single,
75 framesep=3pt,
76 framerule=1pt,
77 rulecolor=\color{example},
78 xleftmargin=4pt,
79 xrightmargin=4pt,
80 comment=[l][\ttfamily\color{teal}]{\%}}
81
82 \newcommand*{\commandinline}{\lstinline[
83 literate={<}{{$\langle$}}1{>}{{$\rangle$}}1,
84 delim={[is][\color{param}\normalfont\itshape\small]{!}{!}},
85 basicstyle=\color{command}\ttfamily,
86 columns=fullflexible,
87 keepspaces]}
88
89 \renewcommand*{\meta}[1]{{\color{param}\normalfont\itshape\small$\langle$#1$\rangle$}}
90
91 \newcommand*{\example}{\par\medskip\hspace*{-2em}{\usefont{T1}{ugq}{b}{n}\color{example}EXAMPLE}}
92
93 \newcommand*{\BookCover}{{\usefont{T1}{ugq}{b}{n}
94 \color{black!90}\mbox{}\lower.15ex\hbox{[B}ook%
95 \color{red!70!black}\lower.15ex\hbox{C}over\lower.15ex\hbox{]}}}
96
97 \def\bookcoversizename#1(#2,#3)#4{\texttt{\color{command}#1} ($#2\times#3$\,#4)}
98
99 \setlength{\parindent}{0pt}
100 \renewcommand*{\descriptionlabel}[1]{\hspace{0pt}}
101 \setlength{\fboxsep}{0pt}
102 \newcounter{partfig}
103
104 \begin{document}
105 \DocInput{./bookcover.dtx}
106 \end{document}
107 %</driver>
108 % \fi
109 %
110 % \CharacterTable
111 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
112 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
113 % Digits \0\1\2\3\4\5\6\7\8\9
114 % Exclamation \! Double quote \" Hash (number) \#
115 % Dollar \$ Percent \% Ampersand \&
116 % Acute accent \' Left paren \( Right paren \)
117 % Asterisk \* Plus \+ Comma \,
118 % Minus \- Point \. Solidus \/
119 % Colon \: Semicolon \; Less than \<
120 % Equals \= Greater than \> Question mark \?
121 % Commercial at \@ Left bracket \[ Backslash \\
122 % Right bracket \] Circumflex \^ Underscore \_
123 % Grave accent \` Left brace \{ Vertical bar \|
124 % Right brace \} Tilde \~}
125 %
126 % \GetFileInfo{bookcover.cls}
127 %
128 % \title{{\Huge\BookCover\\[5mm]}
129 % \textsf{Class for book covers and dust jackets}\\[2mm]
130 % {\large\texttt{bookcover.cls}\\
131 % \eifilever\ (\eifiledate)}}
132 % \author{Tibor Tómács\\{\normalsize\href{mailto:[email protected]}{\texttt{[email protected]}}}}
133 % \date{}
134 % \maketitle
135 %
136 % \AddToShipoutPictureBG*{\tikz[overlay]\fill[top color=black!50, bottom color=white, middle color=white] (current page.north west) rectangle (current page.south east);}
137 %
138 % \section{Introduction}
139 %
140 % The \texttt{bookcover} document class can be used to create dust jackets and book covers for hardcover and paperback books.
141 %
142 % \paragraph{Dust jacket.}
143 %
144 % The following image shows a typical dust jacket of a hardcover book, which is a detachable outer cover of the book.
145 % Its parts are the back flap, the back cover, the spine, the front cover and the front flap.
146 % \begin{center}
147 % \includegraphics{figures/bookcover-dustjacket}
148 % \end{center}
149 % When preparing a dust jacket for printing, some marks are needed to know where to trim or fold the cover.
150 % The crop marks define a special area of the sheet called the ``bleed'' (see the gray area in the next figure).
151 % The bleed will be trimmed off.
152 % The background will be extended to the bleed, taking into account the slight inaccuracy of the trim.
153 % If there is no bleed, there is a high probability that there will be a white stripe around the edge of the finished product.
154 % In the next schematics figure, the red lines are the marks.
155 % The marks closest to the corners are the crop marks and the others are the fold marks.
156 % \begin{center}
157 % \includegraphics{figures/bookcover-scheme-withflaps}
158 % \end{center}
159 % If the book cover is detachable, it is advisable to leave folding areas (called ``wraps'') between the front cover and the front flap, and between the back cover and the back flap (see the black bars in the previous figure).
160 % This is important if the book board is thick, because when the book is folded, this area will be visible on the edges of the book board.
161 % In this case, the background color or image should not stop at the outer edge of the front or back cover.
162 % It should be extended to the wraps, as on the bleed, otherwise, due to minor cutting and folding inaccuracies, a stripe may appear on the cover that is not necessarily parallel to the edges, which would give an aesthetically unacceptable result when the book is folded.
163 %
164 % \paragraph{Book cover for paperback book.}
165 %
166 % The cover of a paperback book is glued to the spine of the book and usually has no flaps.
167 % The function of the bleed here is the same as before.
168 % The crop marks are closest to the corners, and the others are the fold marks.
169 % \begin{center}
170 % \includegraphics{figures/bookcover-scheme-withoutflaps}
171 % \end{center}
172 % Rarely, the cover of a paperback book may have flaps.
173 % In this case, the scheme is similar to that of a dust jacket.
174 %
175 % \paragraph{Book cover for hardcover book.}
176 %
177 % The outside of the cover of a hardcover book is glued to the boards of the book.
178 % This, of course, never has flaps.
179 % \begin{center}
180 % \includegraphics{figures/bookcover-scheme-foldingmargin}
181 % \end{center}
182 % In this case, the function of the bleed is not to eliminate cutting inaccuracies.
183 % It is not trimmed, but is a margin that is folded back and glued to the inside of the book boards.
184 % In this way it will cover all the edges of the boards.
185 % The crop marks are closest to the corners, and the others are the fold marks.
186 %
187 % \section{Loading class and options}\label{sec:class}
188 %
189 % Load the class as usual, with
190 % \begin{commandlst}
191 % \documentclass[!<options>!]{bookcover}
192 % \end{commandlst}
193 %
194 % \medskip The list of \meta{options}:
195 %
196 % \medskip
197 % \begin{compactdesc}
198 % \item \commandinline|cover=!<size name>!|
199 % It specifies the front/back cover width and height (without bleed) by name (default \texttt{cover=default}).
200 % Allowed \meta{size name} (width${}\times{}$height):
201 % \bookcoversizename{default}(170,240){mm}
202 % \bookcoversizename{a0}(841,1189){mm}
203 % \bookcoversizename{a1}(594,841){mm}
204 % \bookcoversizename{a2}(420,594){mm}
205 % \bookcoversizename{a3}(297,420){mm}
206 % \bookcoversizename{a4}(210,297){mm}
207 % \bookcoversizename{a5}(148,210){mm}
208 % \bookcoversizename{a6}(105,148){mm}
209 % \bookcoversizename{b0}(1000,1414){mm}
210 % \bookcoversizename{b1}(707,1000){mm}
211 % \bookcoversizename{b2}(500,707){mm}
212 % \bookcoversizename{b3}(353,500){mm}
213 % \bookcoversizename{b4}(250,353){mm}
214 % \bookcoversizename{b5}(176,250){mm}
215 % \bookcoversizename{b6}(125,176){mm}
216 % \bookcoversizename{c0}(917,1297){mm}
217 % \bookcoversizename{c1}(648,917){mm}
218 % \bookcoversizename{c2}(458,648){mm}
219 % \bookcoversizename{c3}(324,458){mm}
220 % \bookcoversizename{c4}(229,324){mm}
221 % \bookcoversizename{c5}(162,229){mm}
222 % \bookcoversizename{c6}(114,162){mm}
223 % \bookcoversizename{b0j}(1030,1456){mm}
224 % \bookcoversizename{b1j}(728,1030){mm}
225 % \bookcoversizename{b2j}(515,728){mm}
226 % \bookcoversizename{b3j}(364,515){mm}
227 % \bookcoversizename{b4j}(257,364){mm}
228 % \bookcoversizename{b5j}(182,257){mm}
229 % \bookcoversizename{b6j}(128,182){mm}
230 % \bookcoversizename{ansia}(8.5,11){in}
231 % \bookcoversizename{ansib}(11,17){in}
232 % \bookcoversizename{ansic}(17,22){in}
233 % \bookcoversizename{ansid}(22,34){in}
234 % \bookcoversizename{ansie}(34,44){in}
235 % \bookcoversizename{letter}(8.5,11){in}
236 % \bookcoversizename{legal}(8.5,14){in}
237 % \bookcoversizename{executive}(7.25,10.5){in}
238 % \item \commandinline|coverheight=!<length>!|
239 % Cover height without bleed.
240 % It overrides the height specified by the \texttt{cover} option.
241 % \item \commandinline|coverwidth=!<length>!|
242 % Front/back cover width.
243 % It overrides the width specified by the \texttt{cover} option.
244 % \item \commandinline|spinewidth=!<length>!|
245 % Spine width (default \texttt{spinewidth=5mm}).
246 % \item \commandinline|flapwidth=!<length>!|
247 % Flap width (default \texttt{flapwidth=0mm}).
248 % \item \commandinline|wrapwidth=!<length>!|
249 % Wrap width (default \texttt{wrapwidth=0mm}).
250 % It has no effect with \texttt{flapwidth=0mm} option.
251 % \item \commandinline|bleedwidth=!<length>!|
252 % Bleed width (default \texttt{bleedwidth=5mm}).
253 % \item \commandinline|marklength=!<length>!|
254 % Mark length (default \texttt{marklength=10mm}).
255 % \item \commandinline|foldingmargin=!<boolean>!|
256 % If the \meta{boolean} is \commandinline|true|, then the bleed will be not a trimmed area but a fold margin.
257 % The crop marks will be placed at the corners of the bleed and the options \texttt{flapwidth} and \texttt{wrapwidth} will be ineffective, i.e.~there will be no flaps.
258 % (Default \texttt{foldingmargin=false}.)
259 % \item \commandinline|10pt|, \commandinline|11pt|, \commandinline|12pt|
260 % Normal font size (default \texttt{10pt}).
261 % \item \commandinline|markthick=!<length>!|
262 % Thickness of marks (default \texttt{markthick=0.4pt}).
263 % \item \commandinline|markcolor=!<color name>!|
264 % Color of marks (default \texttt{markcolor=red}).
265 % \item \commandinline|pagecolor=!<color name>!|
266 % Color of page (default \texttt{pagecolor=white}).
267 % \item \commandinline|trimmed=!<boolean>!|
268 % If the \meta{boolean} is \commandinline|true|, then the result will be the trimmed version for demonstration.
269 % (Default \texttt{trimmed=false} for printing.)
270 % See an example in subsection~\ref{subsec:trimming}.
271 % \item \commandinline|trimmingcolor=!<color name>!|
272 % Color of trimming (default \texttt{trimmingcolor=white}).
273 % \item \commandinline|showonlypart={!<part>!}|
274 % The dimensions of the pdf will match the dimensions of the \meta{part} and only the \meta{part} will be visible (see in the section~\ref{sec:parts}).
275 % This ignores the \texttt{trimmed} option.
276 % See an example in subsection~\ref{subsec:showonly}.
277 % \item \commandinline|showonlycovernum=!<number>!|
278 % If there are multiple covers in a document (e.g.\ outer and inner), only the \meta{number}\textsuperscript{th} will be displayed.
279 % See an example in subsection~\ref{subsec:showonly}.
280 % \end{compactdesc}
281 %
282 % \medskip
283 % The \texttt{bookcover.cls} requires the services of the \texttt{article} class and the following packages:
284 % \texttt{kvoptions}, \texttt{geometry}, \texttt{graphicx}, \texttt{calc}, \texttt{tikz}, \texttt{etoolbox}, \texttt{fgruler}.
285 %
286 % \section{Commands and environments}
287 %
288 % Use the \commandinline{bookcover} environment in the document body to create a new book cover.
289 % If you need to edit both sides of the cover, you can do it with two \texttt{bookcover} environments (see an example in the subsection~\ref{subsec-two-sided-example}).
290 % You can create a book cover component by using the following command or environment in the \texttt{bookcover} environment:
291 % \begin{commandlst}
292 % \bookcovercomponent{!<component type>!}{!<part>!}[!<left>!,!<bottom>!,!<right>!,!<top>!]{!<content>!}
293 % \end{commandlst}
294 % or its equivalent
295 % \begin{commandlst}
296 % \begin{bookcoverelement}{!<component type>!}{!<part>!}[!<left>!,!<bottom>!,!<right>!,!<top>!]
297 % !<content>!
298 % \end{bookcoverelement}
299 % \end{commandlst}
300 %
301 % \begin{compactdesc}
302 % \item \meta{component type}
303 % It determines the type of the bookcover component (see the section~\ref{sec:componenttypes}).
304 % Predefined component types:
305 % \commandinline{color}, \commandinline{tikz}, \commandinline{tikz clip}, \commandinline{picture}, \commandinline{normal}, \commandinline{center}, \commandinline{ruler}.
306 % \item \meta{part}
307 % This determines where in the book cover the \meta{content} is located.
308 % You can read the description of \meta{part} in the section~\ref{sec:parts}.
309 % Some predefined parts:
310 % \commandinline{front} (front cover), \commandinline{bg front} (front cover extended to the bleed), \commandinline{back} (back cover), \commandinline{bg back} (back cover extended to the bleed), \commandinline{whole} (whole book cover), \commandinline{bg whole} (whole book cover extended to the bleed), \commandinline{spine}, etc.
311 % \item \meta{left},\meta{bottom},\meta{right},\meta{top}
312 % These are the margins of the \meta{part}.
313 % The default value of every margin is \texttt{0mm}.
314 % If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}.
315 % If the value of a margin is negative, the part size will increase instead of decreasing.
316 % \item \meta{content}
317 % This can be text, image, color, etc., which depends on the \meta{component type} (see the section~\ref{sec:componenttypes}).
318 % This will be located in the \meta{part}.
319 % \end{compactdesc}
320 %
321 % \medskip
322 % You can use the following length commands in the \meta{content} and to specify the margins of the \meta{part}:
323 %
324 % \medskip
325 % \begin{compactdesc}
326 % \item \commandinline{\partheight}
327 % The height of the \meta{part} (in the \meta{content} it will be reduced by \meta{bottom} and \meta{top}).
328 % \item \commandinline{\partwidth}
329 % The width of the \meta{part} (in the \meta{content} it will be reduced by \meta{left} and \meta{right}).
330 % \item \commandinline{\coverheight}
331 % Cover height.
332 % \item \commandinline{\coverwidth}
333 % Front/back cover width.
334 % \item \commandinline{\spinewidth}
335 % Spine width.
336 % \item \commandinline{\flapwidth}
337 % Flap width.
338 % \item \commandinline{\wrapwidth}
339 % Wrap width.
340 % \item \commandinline{\bleedwidth}
341 % Bleed width.
342 % \item \commandinline{\marklength}
343 % Mark length.
344 % \end{compactdesc}
345 %
346 % \medskip
347 % Each |\bookcovercomponent| command and |bookcoverelement| environment creates a layer on the sheet.
348 % The first one creates the bottom layer and the last one creates the top layer.
349 %
350 % \medskip
351 % The following two examples are equivalent.
352 %
353 % \example
354 % \begin{examplelst}
355 % \documentclass[spinewidth=15mm,markcolor=black]{bookcover}
356 %
357 % \begin{document}
358 %
359 % \begin{bookcover}
360 % \bookcovercomponent{color}{bg whole}{orange}
361 % \bookcovercomponent{normal}{front}[,,,0.4\partheight]{
362 % \centering\bfseries\huge Book title}
363 % \end{bookcover}
364 %
365 % \end{document}
366 % \end{examplelst}
367 %
368 % \example
369 % \begin{examplelst}
370 % \documentclass[spinewidth=15mm,markcolor=black]{bookcover}
371 %
372 % \begin{document}
373 %
374 % \begin{bookcover}
375 % \begin{bookcoverelement}{color}{bg whole}
376 % orange
377 % \end{bookcoverelement}
378 % \begin{bookcoverelement}{normal}{front}[,,,0.4\partheight]
379 % \centering\bfseries\huge Book title
380 % \end{bookcoverelement}
381 % \end{bookcover}
382 %
383 % \end{document}
384 % \end{examplelst}
385 %
386 % Use the \commandinline{bookcoverdescription} environment in the document body to add the description of the book cover and other information.
387 % Do not use it in |bookcover| environment!
388 % You can set the page geometry of the description by using the following command:
389 % \begin{commandlst}
390 % \bookcoverdescgeometry{!<geometry parameteres>!}
391 % \end{commandlst}
392 % The possible \meta{geometry parameters} are the same as for |\newgeometry| in the |geometry| package.
393 % Its default value is |margin=1in|.
394 % Unlike |\newgeometry|, it can be used in the preamble as well.
395 % See an example in the subsection~\ref{subsec:desc}.
396 %
397 % \medskip
398 % If you want to check the dimensions, use the following command in the |bookcoverdescription| environment:
399 % \begin{commandlst}
400 % \showbookcoverparameters
401 % \end{commandlst}
402 %
403 % If the value of the \texttt{trimmed} option is \texttt{true}, then you can set the trimmed part by using the following command before any \texttt{bookcover} environment:
404 % \begin{commandlst}
405 % \bookcovertrimmedpart{!<trimmed part>!}[!<left>!,!<bottom>!,!<right>!,!<top>!]
406 % \end{commandlst}
407 %
408 % Without this command, or if the \meta{trimmed part} is empty or space, then its value will be \texttt{whole} (see the section~\ref{sec:parts}).
409 % The \meta{left}, \meta{bottom}, \meta{right} and \meta{top} are the margins of the \meta{trimmed part}.
410 % The default value of every margin is \texttt{0mm}.
411 % If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}.
412 % The trimmed area will be the \meta{trimmed part} reduced by the margins.
413 % If the value of a margin is negative, the size of the \meta{trimmed part} size will increase instead of decreasing.
414 %
415 % \medskip
416 % You can change some options before each \texttt{bookcover} environment by using the following command:
417 % \begin{commandlst}
418 % \setbookcover{!<options>!}
419 % \end{commandlst}
420 % The \meta{options} can be as follows:
421 % \commandinline|markthick=!<length>!|, \commandinline|markcolor=!<color name>!|, \commandinline|pagecolor=!<color name>!|, \commandinline|trimmed|, \commandinline|trimmed=false|, \commandinline|trimmingcolor=!<color name>!| (see the section~\ref{sec:class}).
422 % See an example in the subsection~\ref{subsec:trimming}.
423 %
424 % \section{Book cover parts}\label{sec:parts}
425 %
426 % The parts are the rectangular subspaces of the sheet.
427 % The foreground parts are the back flap, back wrap, back cover, spine, front cover, front wrap, front flap and various combinations of these.
428 % These can be referred to by their names (see later).
429 % The foreground parts do not extend to the bleed.
430 %
431 % \medskip
432 % The background parts are extended to the bleed.
433 % Their names start with \commandinline{bg} followed by a space before the foreground part name.
434 %
435 % \medskip
436 % If your book also has printing on the inside cover, the layout for the inside cover will be the exact opposite of the layout for the outside cover.
437 % This is why these parts have synonymous names.
438 % The synonymous names contain \commandinline{inside front} instead of \commandinline{back} and \commandinline{inside back} instead of \commandinline{front}.
439 % For example \commandinline{bg front} is the same as \commandinline{bg inside back}, \commandinline{above back} is the same as \commandinline{above inside front}, etc.
440 %
441 % \medskip
442 % You can also use short names to specify parts.
443 % The elements of the abbreviations are as follows:
444 % \commandinline{F} (flap), \commandinline{W} (wrap), \commandinline{C} (cover), \commandinline{S} (spine), \commandinline{l} (a part to the left of the spine), \commandinline{r} (a part to the right of the spine).
445 % For example \commandinline{lC} is the abbreviation for the left cover, i.e.~the back cover of the outside cover, or the inside front cover of the inside cover.
446 % It is not extended to the bleed, i.e.~it is a foreground part.
447 % If you want to extend a part to the bleed, type \commandinline{bg} followed by a space before the name.
448 % For example \commandinline{bg lC} is the left cover extended to the bleed.
449 % Use a hyphen to specify multiple parts.
450 % For example, \commandinline{lW-S} is the part from the left wrap to the spine that does not extend to the bleed.
451 %
452 % \medskip
453 % The following figures also show the full and abbreviated names of the blue parts.
454 %
455 % \subsection{Book cover without flaps -- background parts}
456 %
457 % \setcounter{partfig}{1}
458 % \loop
459 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
460 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
461 % \ifnum\value{partfig}<7\repeat
462 %
463 % \subsection{Book cover without flaps -- foreground parts}
464 %
465 % \loop
466 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
467 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
468 % \ifnum\value{partfig}<13\repeat
469 %
470 % \subsection{Book cover without flaps -- other parts}
471 %
472 % \loop
473 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
474 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
475 % \ifnum\value{partfig}<17\repeat
476 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\stepcounter{partfig}
477 %
478 % \subsection{Book cover with flaps -- background parts}
479 %
480 % \loop
481 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
482 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
483 % \ifnum\value{partfig}<46\repeat
484 %
485 % \subsection{Book cover with flaps -- foreground parts}
486 %
487 % \loop
488 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
489 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
490 % \ifnum\value{partfig}<74\repeat
491 %
492 % \subsection{Book cover with flaps -- other parts}
493 %
494 % \loop
495 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\hfill\stepcounter{partfig}
496 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}\par\bigskip\stepcounter{partfig}
497 % \ifnum\value{partfig}<78\repeat
498 % \fbox{\includegraphics[page=\thepartfig]{figures/bookcover-parts.pdf}}
499 %
500 % \subsection{Defining part}
501 %
502 % You can define a new rectangular part or redefine a defined part using the following commands:
503 % \begin{commandlst}
504 % \newbookcoverpart{!<new part>!}{!<setting>!}
505 % \renewbookcoverpart{!<defined part>!}{!<setting>!}
506 % \end{commandlst}
507 %
508 % In \meta{setting} you have to set the new part sizes, the coordinates of its upper left corner (the origin is the upper left corner of the printed area), and the parameters of the \texttt{trimmed part} rectangle node in the \texttt{tikz} and \texttt{tikz clip} component types (see in the section~\ref{sec:componenttypes}).
509 % Use the following commands to do this:
510 % \begin{commandlst}
511 % \setpartposx{!<coord x>!}
512 % \setpartposy{!<coord y>!}
513 % \setpartwidth{!<width>!}
514 % \setpartheight{!<height>!}
515 % \settrimmedpart{!<width minus>!}{!<height minus>!}{!<shift x>!}{!<shift y>!}
516 % \end{commandlst}
517 %
518 % \begin{center}
519 % \includegraphics{./figures/bookcover-newpart}
520 % \end{center}
521 %
522 % To specify the previous lengths, you can use the following length commands, which are declared by the options of the document class:
523 % \commandinline{\coverheight},
524 % \commandinline{\coverwidth},
525 % \commandinline{\spinewidth},
526 % \commandinline{\flapwidth},
527 % \commandinline{\wrapwidth},
528 % \commandinline{\bleedwidth},
529 % \commandinline{\marklength}.
530 %
531 % \example
532 % \begin{examplelst}
533 % \documentclass[flapwidth=3cm]{bookcover} % Also try it with flapwidth=0cm option!
534 %
535 % \newbookcoverpart{bg half front}{
536 % \setpartposx{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\spinewidth+1.5\coverwidth}
537 % \setpartposy{\marklength}
538 % \setpartheight{\coverheight+2\bleedwidth}
539 % \ifdim\flapwidth>0mm
540 % \setpartwidth{.5\coverwidth}
541 % \settrimmedpart{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
542 % \else
543 % \setpartwidth{.5\coverwidth+\bleedwidth}
544 % \settrimmedpart{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
545 %
546 % \begin{document}
547 %
548 % \begin{bookcover}
549 % \bookcovercomponent{tikz}{bg half front}{
550 % \fill[blue] (part.south west) rectangle (part.north east);
551 % \fill[green] (trimmed part.south west) rectangle (trimmed part.north east);}
552 % \end{bookcover}
553 %
554 % \end{document}
555 % \end{examplelst}
556 %
557 % You can rename a defined part using the following commands:
558 % \begin{commandlst}
559 % \newnamebookcoverpart{!<new part>!}{!<defined part>!}
560 % \letnamebookcoverpart{!<new part>!}{!<defined part>!}[!<left>!,!<bottom>!,!<right>!,!<top>!]
561 % \end{commandlst}
562 %
563 % With |\newnamebookcoverpart|, the definition of the \meta{new part} and the \meta{defined part} are always the same, even if you redefine the \meta{defined part} later with the |\renewbookcoverpart|.
564 %
565 % \medskip
566 % Using |\letnamebookcoverpart|, the definition of the \meta{new part} is the same as the current definition of the \meta{defined part} reduced by the \meta{left}, \meta{bottom}, \meta{right} and \meta{top} margins.
567 % If you change the \meta{defined part} later with the |\renewbookcoverpart|, the \meta{new part} will not change with it.
568 % The default value of every margin is \texttt{0mm}.
569 % If the \meta{left}, \meta{bottom}, \meta{right} or \meta{top} is empty or space, then its value will be \texttt{0mm}.
570 % If the value of a margin is negative, the part size will increase instead of decreasing.
571 % You can use the following length commands to specify the margins:
572 % \commandinline{\partheight} (the height of the \meta{defined part}),
573 % \commandinline{\partwidth} (the width of the \meta{defined part}),
574 % \commandinline{\coverheight},
575 % \commandinline{\coverwidth},
576 % \commandinline{\spinewidth},
577 % \commandinline{\flapwidth},
578 % \commandinline{\wrapwidth},
579 % \commandinline{\bleedwidth},
580 % \commandinline{\marklength}.
581 %
582 % \example
583 % \begin{examplelst}
584 % \documentclass[spinewidth=2cm]{bookcover}
585 %
586 % \letnamebookcoverpart{extended bg spine}{bg spine}[-\spinewidth,,-\spinewidth,]
587 %
588 % \begin{document}
589 %
590 % \begin{bookcover}
591 % \bookcovercomponent{color}{bg whole}{blue}
592 % \bookcovercomponent{color}{extended bg spine}{opacity=0.5}
593 % \end{bookcover}
594 %
595 % \end{document}
596 % \end{examplelst}
597 %
598 % \section{Book cover component types}\label{sec:componenttypes}
599 %
600 % The predefined component types:
601 % \commandinline{color}, \commandinline{tikz}, \commandinline{tikz clip}, \commandinline{picture}, \commandinline{normal}, \commandinline{center}, \commandinline{ruler}.
602 %
603 % \subsection{The color component type}
604 %
605 % It determines the color of the \meta{part}.
606 % The \meta{content} is the options of the |\fill| in the \texttt{tikz} package:
607 %
608 % \medskip
609 % \begin{compactdesc}
610 % \item \commandinline{!<color name>!}
611 % (See it in the \texttt{xcolor} package.)
612 % \item \commandinline{color=!<color name>!}
613 % (It is equivalent to the previous one.)
614 % \item \commandinline{top color=!<color name>!}
615 % \item \commandinline{bottom color=!<color name>!}
616 % \item \commandinline{middle color=!<color name>!}
617 % \item \commandinline{inner color=!<color name>!}
618 % \item \commandinline{outer color=!<color name>!}
619 % \item \commandinline{ball color=!<color name>!}
620 % \item \commandinline{shading angle=!<degree>!}
621 % It rotates the shading by the given angle.
622 % \item \commandinline{opacity=!<value>!}
623 % Sets the filling opacity.
624 % The \meta{value} is between 0 and 1.
625 % \end{compactdesc}
626 %
627 % \example
628 % \begin{examplelst}
629 % \begin{bookcover}
630 % \bookcovercomponent{color}{bg front}{red}
631 % \bookcovercomponent{color}{bg back}{
632 % top color=white, bottom color=blue!50!black, shading angle=60}
633 % \end{bookcover}
634 % \end{examplelst}
635 %
636 % \subsection{The tikz component type}
637 %
638 % The \meta{content} is a Ti\emph{k}Z code without |\tikz| command and |tikzpicture| environment.
639 % The origin of the Ti\emph{k}Z figure is the lower left corner of the \meta{part}.
640 % Two rectangular nodes are created:
641 % \commandinline{part} and \commandinline{trimmed part}.
642 % (Thanks to Zunbeltz Izaola for the idea.)
643 %
644 % \example
645 % \begin{examplelst}
646 % \begin{bookcover}
647 % \bookcovercomponent{tikz}{bg whole}{
648 % \fill[black] (part.south west) rectangle (part.north east);
649 % \fill[gray] (trimmed part.south east) rectangle (trimmed part.north west);}
650 % \bookcovercomponent{tikz}{bg front}{
651 % \fill[blue] (part.south west) -- (part.center) -- (part.north west) -- cycle;}
652 % \end{bookcover}
653 % \end{examplelst}
654 % \begin{center}
655 % \fcolorbox{black!50}{white}{\includegraphics{figures/bookcover-tikz}}
656 % \end{center}
657 %
658 % \subsection{The tikz clip component type}
659 %
660 % It works in the same way as the \texttt{tikz} component type, but it clips the \meta{part}.
661 %
662 % \example
663 % \begin{examplelst}
664 % \begin{bookcover}
665 % \bookcovercomponent{tikz clip}{front}{
666 % \fill[blue] (part.west) circle [radius=8mm];}
667 % \bookcovercomponent{tikz}{front}{
668 % \fill[gray] (part.west) circle [radius=4mm];}
669 % \end{bookcover}
670 % \end{examplelst}
671 % \begin{center}
672 % \fcolorbox{black!50}{white}{\includegraphics{figures/bookcover-tikzclip}}
673 % \end{center}
674 %
675 % \subsection{The picture component type}
676 %
677 % The \meta{content} is an image file that is resized according to the size of the \meta{part}.
678 %
679 % \example
680 % \begin{examplelst}
681 % \begin{bookcover}
682 % \bookcovercomponent{picture}{bg whole}{fig.png}
683 % \end{bookcover}
684 % \end{examplelst}
685 %
686 % \subsection{The normal component type}
687 %
688 % In this case, the \meta{content} is not specific.
689 % You can choose it as text or picture etc.
690 %
691 % \example
692 % \begin{examplelst}
693 % \begin{bookcover}
694 % \bookcovercomponent{normal}{front}[,,,5cm]{
695 % \centering
696 % {\bfseries\huge Book title}\\[5mm]
697 % \includegraphics[width=0.4\partwidth]{fig.png}}
698 % \end{bookcover}
699 % \end{examplelst}
700 %
701 % \subsection{The center component type}
702 %
703 % It works in the same way as the \texttt{normal} component type, but the position of the content is the centre of the part horizontally and vertically.
704 %
705 % \example
706 % \begin{examplelst}
707 % \begin{bookcover}
708 % \bookcovercomponent{center}{above front}{
709 % \textcolor{blue}{Remark above front}}
710 % \bookcovercomponent{center}{spine}{
711 % \rotatebox[origin=c]{-90}{\bfseries\Large Book title}}
712 % \end{bookcover}
713 % \end{examplelst}
714 %
715 % \subsection{The ruler component type}
716 %
717 % Use the \texttt{ruler} component type to check the dimensions of the part.
718 % It draws a square ruler at the borders of the part.
719 % The \meta{content} is
720 % \begin{commandlst}
721 % !<unit>!,!<origin>!,!<color name>!
722 % \end{commandlst}
723 %
724 % \begin{compactdesc}
725 % \item \meta{unit}
726 % The ruler unit:
727 %
728 % \begin{compactdesc}
729 % \item \commandinline{cm}
730 % Metric ruler (centimeter).
731 % If the \meta{unit} is empty or space, then its value will be \texttt{cm}.
732 % \item \commandinline{in}
733 % English ruler (inch).
734 % \end{compactdesc}
735 %
736 % \item \meta{origin}
737 % The origin of the square ruler:
738 %
739 % \begin{compactdesc}
740 % \item \commandinline{upperleft }
741 % The origin is the upper left corner of the part.
742 % Directions: down and right.
743 % If the \meta{origin} is empty or space, then its value will be \texttt{upperleft}.
744 % \item \commandinline{upperright}
745 % The origin is the upper right corner of the part.
746 % Directions: down and left.
747 % \item \commandinline{lowerleft }
748 % The origin is the lower left corner of the part.
749 % Directions: up and right.
750 % \item \commandinline{lowerright}
751 % The origin is the lower right corner of the part.
752 % Directions: up and left.
753 % \end{compactdesc}
754 %
755 % \item \meta{color name}
756 % The color of the ruler.
757 % If it is empty or space, then its value will be the color of the marks.
758 % \end{compactdesc}
759 %
760 % \example
761 % \begin{examplelst}
762 % \begin{bookcover}
763 % \bookcovercomponent{ruler}{back}{,,}
764 % \bookcovercomponent{ruler}{back}[2cm,,,1cm]{,,blue}
765 % \bookcovercomponent{ruler}{front}{,lowerright,green}
766 % \bookcovercomponent{ruler}{front}[,1cm,2cm,]{,lowerright,gray}
767 % \end{bookcover}
768 % \end{examplelst}
769 % \begin{center}
770 % \fcolorbox{black!50}{white}{\includegraphics{figures/bookcover-ruler}}
771 % \end{center}
772 %
773 % \subsection{Defining component type}
774 %
775 % You can define a new component type, redefine or rename a defined component type using the following commands:
776 % \begin{commandlst}
777 % \newbookcovercomponenttype{!<new component type>!}{!<formatting>!}
778 % \renewbookcovercomponenttype{!<defined component type>!}{!<formatting>!}
779 % \newnamebookcovercomponenttype{!<new component type>!}{!<defined component type>!}
780 % \letnamebookcovercomponenttype{!<new component type>!}{!<defined component type>!}
781 % \end{commandlst}
782 %
783 % \medskip
784 % With |\newnamebookcovercomponenttype|, the definition of the \meta{new component type} and the \meta{defined component type} are always the same, even if you redefine the \meta{defined component type} later with the |\renewbookcovercomponenttype|.
785 %
786 % \medskip
787 % With |\letnamebookcovercomponenttype|, the definition of the \meta{new component type} is the same as the current definition of the \meta{defined component type}.
788 % If you change the \meta{defined component type} later with |\renewbookcovercomponenttype|, the \meta{new component type} doesn't change with it.
789 %
790 % \medskip
791 % You can use the following length commands in \meta{formatting}:
792 %
793 % \medskip
794 % \begin{compactdesc}
795 % \item \commandinline{\partwidth}
796 % The width of the part (reduced by the margins) in which you are using the defined component type.
797 % \item \commandinline{\partheight}
798 % The height of the part (reduced by the margins) in which you are using the defined component type.
799 % \end{compactdesc}
800 %
801 % \medskip
802 % You must refer to the content as \verb|#1|.
803 %
804 % \example
805 % \begin{examplelst}
806 % \documentclass{bookcover}
807 %
808 % \newbookcovercomponenttype{center picture}{
809 % \vfill
810 % \centering
811 % \includegraphics[width=0.5\partwidth]{#1}
812 % \vfill}
813 %
814 % \begin{document}
815 %
816 % \begin{bookcover}
817 % \bookcovercomponent{center picture}{front}{fig.pdf}
818 % \end{bookcover}
819 %
820 % \end{document}
821 % \end{examplelst}
822 %
823 % \newpage
824 % \section{Examples}
825 %
826 % This section provides some examples to help you better understand the use and functionality of the commands and options of the \texttt{bookcover} document class.
827 % Several templates are available to download from the \url{https://tibortomacs.github.io/bookcovertemplates} website.
828 %
829 % \subsection{Barcode and QR code}
830 %
831 % \begin{center}
832 % \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{figures/bookcover-barcode}}
833 % \end{center}
834 %
835 % \begin{examplelst}
836 % \documentclass[spinewidth=15mm]{bookcover}
837 % \usepackage{GS1,qrcode}
838 %
839 % \begin{document}
840 %
841 % \begin{bookcover}
842 %
843 % \bookcovercomponent{color}{bg whole}{blue!50}
844 %
845 % \bookcovercomponent{normal}{back}[,1cm,,]{
846 % \vfill
847 % \centering
848 % \savebox0{\EANBarcode[module_height=25mm]{ISBN 978-615-5297-19-9}}
849 % \colorbox{white}{%
850 % \usebox0
851 % \raisebox{\depth}{\qrcode[height=\ht0]{https://www.ctan.org/pkg/bookcover}}}}
852 %
853 % \end{bookcover}
854 %
855 % \end{document}
856 % \end{examplelst}
857 %
858 % \newpage
859 % \subsection{Description}\label{subsec:desc}
860 %
861 % \begin{center}
862 % \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-.8pt]{figures/bookcover-description}}\\[5mm]
863 % \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-.8pt]{figures/bookcover-description}}
864 % \end{center}
865 %
866 % \newpage
867 % \begin{examplelst}
868 % \documentclass[markcolor=black,spinewidth=15mm]{bookcover}
869 %
870 % \usepackage[english]{babel}
871 % \usepackage{kantlipsum,multicol,microtype}
872 % \bookcoverdescgeometry{vmargin=25mm,hmargin=9cm}
873 %
874 % \begin{document}
875 %
876 % % Description text
877 % \begin{bookcoverdescription}
878 % \title{Description}
879 % \author{John Taylor}
880 % \date{}
881 % \maketitle
882 % \begin{multicols}{3}
883 % \kant[1-5]
884 % \end{multicols}
885 % \end{bookcoverdescription}
886 %
887 % % Book cover
888 % \begin{bookcover}
889 % \bookcovercomponent{center}{front}{\Huge BOOK TITLE}
890 % \end{bookcover}
891 %
892 % \end{document}
893 % \end{examplelst}
894 %
895 % \newpage
896 % \subsection{Usage of margins}
897 %
898 % \begin{center}
899 % \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{figures/bookcover-margins}}
900 % \end{center}
901 %
902 % \begin{examplelst}
903 % \documentclass[spinewidth=30mm]{bookcover}
904 % \begin{document}
905 %
906 % \begin{bookcover}
907 % \bookcovercomponent{color}{bg whole}{gray}
908 % \bookcovercomponent{color}{back}{blue}
909 % \bookcovercomponent{color}{back}[5mm,5mm,5mm,5mm]{blue!50}
910 % \bookcovercomponent{color}{front}{red}
911 % \bookcovercomponent{color}{front}[5mm,5mm,5mm,5mm]{red!50}
912 % \bookcovercomponent{color}{spine}{green!50!black}
913 % \bookcovercomponent{color}{spine}[5mm,5mm,5mm,5mm]{green!50}
914 % \bookcovercomponent{color}{spine}
915 % [-\spinewidth,15mm,-\spinewidth,\partheight-\spinewidth-15mm]{opacity=0.5}
916 % \end{bookcover}
917 %
918 % \end{document}
919 % \end{examplelst}
920 %
921 % or its equivalent
922 %
923 % \begin{examplelst}
924 % \documentclass[spinewidth=30mm]{bookcover}
925 %
926 % \letnamebookcoverpart{back typing area}{back}[5mm,5mm,5mm,5mm]
927 % \letnamebookcoverpart{front typing area}{front}[5mm,5mm,5mm,5mm]
928 % \letnamebookcoverpart{spine typing area}{spine}[5mm,5mm,5mm,5mm]
929 % \letnamebookcoverpart{spine bottom}{spine}
930 % [-\spinewidth,15mm,-\spinewidth,\partheight-\spinewidth-15mm]
931 %
932 % \begin{document}
933 %
934 % \begin{bookcover}
935 % \bookcovercomponent{color}{bg whole}{gray}
936 % \bookcovercomponent{color}{back}{blue}
937 % \bookcovercomponent{color}{back typing area}{blue!50}
938 % \bookcovercomponent{color}{front}{red}
939 % \bookcovercomponent{color}{front typing area}{red!50}
940 % \bookcovercomponent{color}{spine}{green!50!black}
941 % \bookcovercomponent{color}{spine typing area}{green!50}
942 % \bookcovercomponent{color}{spine bottom}{opacity=0.5}
943 % \end{bookcover}
944 %
945 % \end{document}
946 % \end{examplelst}
947 %
948 % \newpage
949 % \subsection{A dust jacket}
950 %
951 % \begin{center}
952 % \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{bookcover-example1}}
953 % \end{center}
954 % \lstinputlisting[style=examplefile]{bookcover-example1.tex}
955 %
956 % \newpage
957 % \subsection{A two-sided book cover}\label{subsec-two-sided-example}
958 %
959 % \begin{center}
960 % \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-.8pt]{bookcover-example2}}\\[5mm]
961 % \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-.8pt]{bookcover-example2}}
962 % \end{center}
963 % \newpage
964 % \lstinputlisting[style=examplefile]{bookcover-example2.tex}
965 %
966 % \newpage
967 % \subsection{Trimming and checking dimensions}\label{subsec:trimming}
968 %
969 % \begin{center}
970 % \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-.8pt]{figures/bookcover-trimming}}\\[5mm]
971 % \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-.8pt]{figures/bookcover-trimming}}
972 % \end{center}
973 %
974 % This example shows the use of the \texttt{trimmed} option and the |\bookcovertrimmedpart| command.
975 % These allow you to see the finished product for demonstration purposes.
976 % We also check the dimensions of the book cover.
977 % Set the value of the \texttt{trimmed} option to \texttt{false} and clear the \texttt{ruler} component type before printing!
978 %
979 % \begin{examplelst}
980 % \documentclass[
981 % spinewidth=15mm,
982 % markcolor=black,
983 % trimmed,
984 % trimmingcolor=gray,
985 % ]{bookcover}
986 %
987 % \usepackage[latin]{babel}
988 % \usepackage{lipsum,microtype}
989 %
990 % \begin{document}
991 %
992 % % Trimmed outside cover
993 % \begin{bookcover}
994 %
995 % \bookcovercomponent{color}{bg whole}{
996 % top color=white, bottom color=green!30!black}
997 %
998 % \bookcovercomponent{normal}{front}[22mm,60mm,22mm,70mm]{
999 % \centering
1000 % {\huge\bfseries ANNALES\\ INFORMATICAE\par}
1001 % \vfill
1002 % {\large\bfseries TOMUS 43.~(2026)}
1003 % \vfill
1004 % {\large COMMISSIO REDACTORIUM}\\[3mm]
1005 % \lipsum[2]}
1006 %
1007 % \bookcovercomponent{normal}{back}[22mm,10mm,22mm,30mm]{
1008 % {\centering\large ABSTRACTUM\\[5mm]}
1009 % \lipsum[1-4]}
1010 %
1011 % \bookcovercomponent{center}{spine}{
1012 % \rotatebox[origin=c]{-90}{\footnotesize\bfseries
1013 % ANNALES INFORMATICAE 43.~(2026)}}
1014 %
1015 % \bookcovercomponent{ruler}{whole}{,,} % Check dimensions
1016 %
1017 % \end{bookcover}
1018 %
1019 % % Trimmed inside back cover
1020 % \setbookcover{trimmingcolor=black,markcolor=white}
1021 % \bookcovertrimmedpart{inside back}
1022 %
1023 % \begin{bookcover}
1024 %
1025 % \bookcovercomponent{normal}{inside back}[22mm,10mm,22mm,30mm]{
1026 % {\centering\large GRATULATIO\\[5mm]}
1027 % \lipsum[1-4]}
1028 %
1029 % \end{bookcover}
1030 %
1031 % \end{document}
1032 % \end{examplelst}
1033 %
1034 % \newpage
1035 % \subsection{The showonlypart and showonlycovernum options}\label{subsec:showonly}
1036 %
1037 % \begin{center}
1038 % \fcolorbox{black!50}{white}{\includegraphics[width=.5\textwidth-.8pt]{figures/bookcover-showonly}}
1039 % \end{center}
1040 %
1041 % The previous example has been modified with the \texttt{showonlypart} and \texttt{showonlycovernum} options so that only the front part of the outer cover appears in the pdf.
1042 %
1043 % \begin{examplelst}
1044 % \documentclass[
1045 % spinewidth=15mm,
1046 % showonlypart={front}, % Show only front part
1047 % showonlycovernum=1, % Show only outside cover
1048 % ]{bookcover}
1049 %
1050 % \usepackage[latin]{babel}
1051 % \usepackage{lipsum,microtype}
1052 %
1053 % \begin{document}
1054 %
1055 % % Outside cover
1056 % \begin{bookcover}
1057 %
1058 % \bookcovercomponent{color}{bg whole}{
1059 % top color=white, bottom color=green!30!black}
1060 %
1061 % \bookcovercomponent{normal}{front}[22mm,60mm,22mm,70mm]{
1062 % \centering
1063 % {\huge\bfseries ANNALES\\ INFORMATICAE\par}
1064 % \vfill
1065 % {\large\bfseries TOMUS 43.~(2026)}
1066 % \vfill
1067 % {\large COMMISSIO REDACTORIUM}\\[3mm]
1068 % \lipsum[2]}
1069 %
1070 % \bookcovercomponent{normal}{back}[22mm,10mm,22mm,30mm]{
1071 % {\centering\large ABSTRACTUM\\[5mm]}
1072 % \lipsum[1-4]}
1073 %
1074 % \bookcovercomponent{center}{spine}{
1075 % \rotatebox[origin=c]{-90}{\footnotesize\bfseries
1076 % ANNALES INFORMATICAE 43.~(2026)}}
1077 %
1078 % \end{bookcover}
1079 %
1080 % % Inside back cover
1081 % \begin{bookcover}
1082 %
1083 % \bookcovercomponent{normal}{inside back}[22mm,10mm,22mm,30mm]{
1084 % {\centering\large GRATULATIO\\[5mm]}
1085 % \lipsum[1-4]}
1086 %
1087 % \end{bookcover}
1088 %
1089 % \end{document}
1090 % \end{examplelst}
1091 %
1092 % \newpage
1093 % \subsection{A book cover with folding margin for hardcover book}
1094 %
1095 % \begin{center}
1096 % \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{figures/bookcover-foldingmargin}}
1097 % \end{center}
1098 %
1099 % \begin{examplelst}
1100 % \documentclass[
1101 % coverwidth=150mm,
1102 % coverheight=220mm,
1103 % spinewidth=25mm,
1104 % bleedwidth=20mm,
1105 % markcolor=black,
1106 % foldingmargin,
1107 % 12pt,
1108 % ]{bookcover}
1109 %
1110 % \letnamebookcoverpart{front with margin}{front}[5mm,5mm,5mm,5mm]
1111 % \letnamebookcoverpart{front upper third}{front with margin}[,2\partheight/3,,]
1112 % \letnamebookcoverpart{front lower third}{front with margin}[,,,2\partheight/3]
1113 % \letnamebookcoverpart{back with margin}{back}[5mm,5mm,5mm,5mm]
1114 % \letnamebookcoverpart{back text area}{back}[27mm,,22mm,27mm]
1115 % \letnamebookcoverpart{bg spine bottom}{bg spine}[,,,\partheight-\bleedwidth-\spinewidth]
1116 %
1117 % \newbookcovercomponenttype{center rotate}{
1118 % \vfill\centering\rotatebox[origin=c]{-90}{#1}\vfill}
1119 %
1120 % \usepackage[english]{babel}
1121 % \usepackage{kantlipsum,microtype}
1122 % \usepackage{transparent} % It works only with pdflatex
1123 %
1124 % \begin{document}
1125 %
1126 % \begin{bookcover}
1127 %
1128 % \bookcovercomponent{color}{bg whole}{orange}
1129 %
1130 % \bookcovercomponent{color}{front upper third}{red!60!black}
1131 %
1132 % \bookcovercomponent{color}{front lower third}{red!60!black}
1133 %
1134 % \bookcovercomponent{color}{back with margin}{red!60!black}
1135 %
1136 % \bookcovercomponent{tikz}{front with margin}{
1137 % \draw[opacity=0.4,red,line width=10mm] (\partwidth-15mm,0) -- +(0,\partheight);}
1138 %
1139 % \bookcovercomponent{tikz}{back with margin}{
1140 % \draw[opacity=0.4,red,line width=10mm] (15mm,0) -- +(0,\partheight);}
1141 %
1142 % \bookcovercomponent{tikz}{whole}[5mm,,5mm,]{
1143 % \draw[opacity=0.4,red,line width=10mm] (0,\partheight-20mm) -- +(\partwidth,0);}
1144 %
1145 % \bookcovercomponent{color}{bg spine bottom}{black}
1146 %
1147 % \bookcovercomponent{center}{front upper third}{
1148 % \resizebox*{\partwidth-5mm}{\partheight-5mm}{%
1149 % \color{white}\transparent{0.1}\bfseries\LaTeX}}
1150 %
1151 % \bookcovercomponent{center}{front lower third}{
1152 % \resizebox*{\partwidth-5mm}{\partheight-5mm}{%
1153 % \color{white}\transparent{0.1}\bfseries\LaTeX}}
1154 %
1155 % \bookcovercomponent{center}{front}{
1156 % \resizebox{90mm}{!}{\bfseries\color{white}\LaTeX}}
1157 %
1158 % \bookcovercomponent{normal}{back text area}{\color{white}\kant[1-2]}
1159 %
1160 % \bookcovercomponent{center rotate}{spine}{
1161 % \resizebox{50mm}{!}{\bfseries\color{white}\LaTeX}}
1162 %
1163 % \end{bookcover}
1164 %
1165 % \end{document}
1166 % \end{examplelst}
1167 %
1168 % \StopEventually{}
1169 %
1170 % \begin{macrocode}
1171
1172 %% OPTIONS
1173
1174 \RequirePackage{kvoptions}
1175 \SetupKeyvalOptions{family=bookcover,prefix=bookcover@}
1176 \DeclareVoidOption{10pt}{\PassOptionsToClass{10pt}{article}}
1177 \DeclareVoidOption{11pt}{\PassOptionsToClass{11pt}{article}}
1178 \DeclareVoidOption{12pt}{\PassOptionsToClass{12pt}{article}}
1179 \DeclareStringOption{coverwidth}
1180 \DeclareStringOption{coverheight}
1181 \DeclareStringOption[default]{cover}
1182 \DeclareStringOption[5mm]{spinewidth}
1183 \DeclareStringOption[0mm]{flapwidth}
1184 \DeclareStringOption[0mm]{wrapwidth}
1185 \DeclareStringOption[10mm]{marklength}
1186 \DeclareStringOption[.4pt]{markthick}
1187 \DeclareStringOption[5mm]{bleedwidth}
1188 \DeclareStringOption[red]{markcolor}
1189 \DeclareStringOption[white]{pagecolor}
1190 \DeclareStringOption[white]{trimmingcolor}
1191 \DeclareBoolOption[false]{trimmed}
1192 \DeclareBoolOption[false]{foldingmargin}
1193 \DeclareStringOption{showonlypart}
1194 \DeclareStringOption{showonlycovernum}
1195 \DeclareBoolOption[false]{bgtikznodes}% for old method
1196 \DeclareBoolOption[false]{bgtikzclip}% for old method
1197 \ProcessKeyvalOptions{bookcover}
1198
1199 %% CLASS AND PACKAGES
1200
1201 \LoadClass{article}
1202 \RequirePackage{geometry,calc,tikz}
1203 \RequirePackage[nonefgrulers]{fgruler}% This loads the graphicx and etoolbox packages, which are also needed.
1204
1205 %% PAGE STYLE
1206
1207 \pagestyle{empty}
1208 \def\ps@plain{}
1209
1210 %% NEW IF
1211
1212 \newif\if@inbookcoverenv
1213 \newif\if@bookcoverset@check
1214
1215 %% USER LENGTHS
1216
1217 \newlength{\coverwidth}
1218 \newlength{\coverheight}
1219 \newlength{\spinewidth}
1220 \newlength{\flapwidth}
1221 \newlength{\wrapwidth}
1222 \newlength{\marklength}
1223 \newlength{\markthick}
1224 \newlength{\bleedwidth}
1225
1226 %% INTERNAL LENGTHS
1227
1228 \newlength{\bookcover@templength@a}
1229 \newlength{\bookcover@templength@b}
1230 \newlength{\bookcover@templength@c}
1231 \newlength{\bookcover@templength@d}
1232 \newlength{\bookcover@xpos@}
1233 \newlength{\bookcover@ypos@}
1234 \newlength{\bookcover@partwidth@}
1235 \newlength{\bookcover@partheight@}
1236 \newlength{\bookcover@tikz@trimmed@part@width@minus}
1237 \newlength{\bookcover@tikz@trimmed@part@height@minus}
1238 \newlength{\bookcover@tikz@trimmed@part@push@right}
1239 \newlength{\bookcover@tikz@trimmed@part@push@up}
1240 \let\partheight\bookcover@partheight@
1241 \let\partwidth\bookcover@partwidth@
1242
1243 %% COVER SIZE SETTING
1244
1245 \def\bookcover@coversetsize#1(#2,#3)#4{
1246 \ifdefstring{\bookcover@cover}{#1}{
1247 \ifdefstring{\bookcover@coverwidth}{}{\def\bookcover@coverwidth{#2#4}}{}
1248 \ifdefstring{\bookcover@coverheight}{}{\def\bookcover@coverheight{#3#4}}{}
1249 \@bookcoverset@checktrue}{}}
1250
1251 \bookcover@coversetsize{a0}(841,1189){mm}% ISO A0
1252 \bookcover@coversetsize{a1}(594,841){mm}% ISO A1
1253 \bookcover@coversetsize{a2}(420,594){mm}% ISO A2
1254 \bookcover@coversetsize{a3}(297,420){mm}% ISO A3
1255 \bookcover@coversetsize{a4}(210,297){mm}% ISO A4
1256 \bookcover@coversetsize{a5}(148,210){mm}% ISO A5
1257 \bookcover@coversetsize{a6}(105,148){mm}% ISO A6
1258 \bookcover@coversetsize{b0}(1000,1414){mm}% ISO B0
1259 \bookcover@coversetsize{b1}(707,1000){mm}% ISO B1
1260 \bookcover@coversetsize{b2}(500,707){mm}% ISO B2
1261 \bookcover@coversetsize{b3}(353,500){mm}% ISO B3
1262 \bookcover@coversetsize{b4}(250,353){mm}% ISO B4
1263 \bookcover@coversetsize{b5}(176,250){mm}% ISO B5
1264 \bookcover@coversetsize{b6}(125,176){mm}% ISO B6
1265 \bookcover@coversetsize{c0}(917,1297){mm}% ISO C0
1266 \bookcover@coversetsize{c1}(648,917){mm}% ISO C1
1267 \bookcover@coversetsize{c2}(458,648){mm}% ISO C2
1268 \bookcover@coversetsize{c3}(324,458){mm}% ISO C3
1269 \bookcover@coversetsize{c4}(229,324){mm}% ISO C4
1270 \bookcover@coversetsize{c5}(162,229){mm}% ISO C5
1271 \bookcover@coversetsize{c6}(114,162){mm}% ISO C6
1272 \bookcover@coversetsize{b0j}(1030,1456){mm}% JIS B0
1273 \bookcover@coversetsize{b1j}(728,1030){mm}% JIS B1
1274 \bookcover@coversetsize{b2j}(515,728){mm}% JIS B2
1275 \bookcover@coversetsize{b3j}(364,515){mm}% JIS B3
1276 \bookcover@coversetsize{b4j}(257,364){mm}% JIS B4
1277 \bookcover@coversetsize{b5j}(182,257){mm}% JIS B5
1278 \bookcover@coversetsize{b6j}(128,182){mm}% JIS B6
1279 \bookcover@coversetsize{ansia}(8.5,11){in}
1280 \bookcover@coversetsize{ansib}(11,17){in}
1281 \bookcover@coversetsize{ansic}(17,22){in}
1282 \bookcover@coversetsize{ansid}(22,34){in}
1283 \bookcover@coversetsize{ansie}(34,44){in}
1284 \bookcover@coversetsize{letter}(8.5,11){in}
1285 \bookcover@coversetsize{legal}(8.5,14){in}
1286 \bookcover@coversetsize{executive}(7.25,10.5){in}
1287 \bookcover@coversetsize{default}(170,240){mm}
1288
1289 \if@bookcoverset@check\else
1290 \ClassWarning{bookcover}{'\bookcover@cover' is not valid cover size name (changed to 'default' value)}
1291 \def\bookcover@cover{default}
1292 \ifdefstring{\bookcover@coverwidth}{}{\def\bookcover@coverwidth{170mm}}{}
1293 \ifdefstring{\bookcover@coverheight}{}{\def\bookcover@coverheight{240mm}}{}
1294 \fi
1295
1296 %% USER LENGTHS SETTING
1297
1298 \setlength{\coverwidth}{\bookcover@coverwidth}
1299 \setlength{\coverheight}{\bookcover@coverheight}
1300 \setlength{\spinewidth}{\bookcover@spinewidth}
1301 \ifbookcover@foldingmargin\else\setlength{\flapwidth}{\bookcover@flapwidth}\fi
1302 \ifdim\flapwidth>0pt\setlength{\wrapwidth}{\bookcover@wrapwidth}\fi
1303 \setlength{\marklength}{\bookcover@marklength}
1304 \setlength{\markthick}{\bookcover@markthick}
1305 \setlength{\bleedwidth}{\bookcover@bleedwidth}
1306
1307 %% SHOW BOOKCOVER PARAMETERS
1308
1309 \def\showbookcoverparameters{%
1310 \begin{tabular}{@{}r@{ = }l@{}}
1311 book cover type&
1312 \ifbookcover@foldingmargin book cover for hardcover book
1313 \else
1314 \ifdim\flapwidth>0pt dust jacket
1315 \else
1316 book cover for paperback book
1317 \fi
1318 \fi\\
1319 front/back cover width & \bookcover@coverwidth\\
1320 front/back cover height & \bookcover@coverheight\\
1321 spine width & \bookcover@spinewidth\\
1322 \ifbookcover@foldingmargin
1323 \else
1324 \ifdim\flapwidth>0pt
1325 flap width & \bookcover@flapwidth\\
1326 \ifdim\wrapwidth>0pt wrap width & \bookcover@wrapwidth\\\fi
1327 \fi
1328 \fi
1329 bleed width & \bookcover@bleedwidth\\
1330 mark length & \bookcover@marklength
1331 \end{tabular}}
1332
1333 %% PAGE DIMENSIONS SETTING
1334
1335 \geometry{%
1336 margin=0pt,
1337 paperwidth=2\marklength+2\bleedwidth+2\coverwidth+2\flapwidth+2\wrapwidth+\spinewidth,
1338 paperheight=2\marklength+2\bleedwidth+\coverheight}
1339
1340 %% INTERNAL LENGTHS SETTING
1341
1342 \def\bookcover@xpos#1{\setlength{\bookcover@xpos@}{#1}}
1343 \def\bookcover@ypos#1{\setlength{\bookcover@ypos@}{#1}}
1344 \def\bookcover@partwidth#1{\setlength{\bookcover@partwidth@}{#1}}
1345 \def\bookcover@partheight#1{\setlength{\bookcover@partheight@}{#1}}
1346 \def\bookcover@tikz@trimmed@part@param#1#2#3#4{%
1347 \setlength{\bookcover@tikz@trimmed@part@width@minus}{#1}%
1348 \setlength{\bookcover@tikz@trimmed@part@height@minus}{#2}%
1349 \setlength{\bookcover@tikz@trimmed@part@push@right}{#3}%
1350 \setlength{\bookcover@tikz@trimmed@part@push@up}{#4}}
1351 \let\setpartposx\bookcover@xpos
1352 \let\setpartposy\bookcover@ypos
1353 \let\setpartwidth\bookcover@partwidth
1354 \let\setpartheight\bookcover@partheight
1355 \let\settrimmedpart\bookcover@tikz@trimmed@part@param
1356
1357 %% SETBOOKCOVER
1358
1359 \newif\if@oldsetbookcover% for old method
1360
1361 \long\def\setbookcover#1{%
1362 \@for\bookcover@firstparam:={bgcolor,bgpic,bgtikz,fgsecond,fgfirst}\do{% for old method
1363 \ifdefstring{\bookcover@firstparam}{#1}{\global\@oldsetbookcovertrue}{}}% for old method
1364 \if@oldsetbookcover% for old method
1365 \gdef\bookcover@firstparam{#1}% for old method
1366 \else% for old method
1367 \gdef\oldsetbookcover@{}% for old method
1368 \setkeys{bookcover}{#1}%
1369 \setlength{\markthick}{\bookcover@markthick}%
1370 \fi\oldsetbookcover@% for old method
1371 }
1372
1373 %% BOOKCOVERDESCGEOMETRY
1374
1375 \def\bookcoverdescgeometry#1{\def\bookcover@descgeometry{#1}}
1376 \def\bookcover@descgeometry{margin=1in}
1377
1378 %% BOOKCOVERDESCRIPTION
1379
1380 \newenvironment{bookcoverdescription}{%
1381 \if@inbookcoverenv\@latexerr{Don't use 'bookcoverdescription' in 'bookcover' environment!}{}\fi}{}
1382 \AddToHook{env/bookcoverdescription/before}{\expandafter\newgeometry\expandafter{\bookcover@descgeometry}}
1383 \AddToHook{env/bookcoverdescription/after}{\restoregeometry}
1384
1385 %% POSBOX
1386
1387 \newcommand{\bookcover@posbox}[5]{%
1388 \setlength{\bookcover@templength@a}{#4}%
1389 \put(#3,-\bookcover@templength@a){%
1390 \parbox[b][0pt][t]{#1}{%
1391 \parbox[t][#2][t]{#1}{#5}}}}
1392
1393 %% MARKS
1394
1395 \def\bookcover@marks{\bookcovercomponent{bookcovertype@tikz}{bookcoverpart@wholepage}{
1396 \begin{scope}[line width=\markthick,\bookcover@markcolor]
1397 \draw (\marklength+\bleedwidth,0mm) -- +(0mm,\marklength);
1398 \ifdim\flapwidth>0mm\draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth,0) -- +(0,\marklength);\fi
1399 \draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth,0) -- +(0,\marklength);
1400 \draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth,0) -- +(0,\marklength);
1401 \ifdim\flapwidth>0mm\draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth,0) -- +(0,\marklength);\fi
1402 \draw (\marklength+\bleedwidth+2\flapwidth+2\wrapwidth+2\coverwidth+\spinewidth,0) -- +(0,\marklength);
1403 \draw (\marklength+\bleedwidth,\paperheight) -- +(0,-\marklength);
1404 \ifdim\flapwidth>0mm\draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth,\paperheight) -- +(0,-\marklength);\fi%
1405 \draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth,\paperheight) -- +(0,-\marklength);
1406 \draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth,\paperheight) -- +(0,-\marklength);
1407 \ifdim\flapwidth>0mm\draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth,\paperheight) -- +(0,-\marklength);\fi
1408 \draw (\marklength+\bleedwidth+2\flapwidth+2\wrapwidth+2\coverwidth+\spinewidth,\paperheight) -- +(0,-\marklength);
1409 \draw (0,\paperheight-\marklength-\bleedwidth) -- +(\marklength,0);
1410 \draw (0,\marklength+\bleedwidth) -- +(\marklength,0);
1411 \draw (\paperwidth,\paperheight-\marklength-\bleedwidth) -- +(-\marklength,0);
1412 \draw (\paperwidth,\marklength+\bleedwidth) -- +(-\marklength,0);
1413 \ifbookcover@foldingmargin
1414 \draw (\marklength,0) -- +(0,\marklength);
1415 \draw (\paperwidth-\marklength,0) -- +(0,\marklength);
1416 \draw (\marklength,\paperheight) -- +(0,-\marklength);
1417 \draw (\paperwidth-\marklength,\paperheight) -- +(0,-\marklength);
1418 \draw (0,\marklength) -- +(\marklength,0);
1419 \draw (0,\paperheight-\marklength) -- +(\marklength,0);
1420 \draw (\paperwidth,\marklength) -- +(-\marklength,0);
1421 \draw (\paperwidth,\paperheight-\marklength) -- +(-\marklength,0);\fi
1422 \end{scope}}}
1423
1424 %% TRIMMING
1425
1426 \def\bookcover@trimming@part{%
1427 \expandafter\ifblank\expandafter{\bookcover@trimmedpart}{\def\bookcover@trimmedpart{bookcoverpart@whole}}{}%
1428 \@ifundefined{bookcover@part@param@\bookcover@trimmedpart}{\@latexerr{Part '\bookcover@trimmedpart' is undefined.}{}}{%
1429 \begingroup%
1430 \csname bookcover@part@param@\bookcover@trimmedpart\endcsname%
1431 \expandafter\bookcover@setpartmargin\expandafter(\bookcover@trimmedmargin)%
1432 \ifdim\bookcover@partwidth@>0mm
1433 \ifdim\bookcover@partheight@>0mm
1434 \bookcover@posbox{\paperwidth}{\paperheight}{0mm}{0mm}{%
1435 \begin{tikzpicture}
1436 \begin{scope}[\bookcover@trimmingcolor]
1437 \fill (0,0) rectangle (\paperwidth,\paperheight-\bookcover@ypos@-\bookcover@partheight@);
1438 \fill (0,\paperheight) rectangle (\paperwidth,\paperheight-\bookcover@ypos@);
1439 \fill (0,0) rectangle (\bookcover@xpos@,\paperheight);
1440 \fill (\bookcover@xpos@+\bookcover@partwidth@,0) rectangle (\paperwidth,\paperheight);
1441 \end{scope}
1442 \end{tikzpicture}}\fi\fi
1443 \endgroup}}
1444
1445 \NewDocumentCommand{\bookcovertrimmedpart}{ m O{,,,} }{\def\bookcover@trimmedpart{#1}\def\bookcover@trimmedmargin{#2}}
1446 \bookcovertrimmedpart{bookcoverpart@whole}
1447
1448 %% SHOWONLYPART OPTION
1449
1450 \ifdefempty{\bookcover@showonlypart}{}{
1451 \AddToHook{begindocument/before}{
1452 \@ifundefined{bookcover@part@param@\bookcover@showonlypart}{\@latexerr{Part '\bookcover@showonlypart' is undefined.}{}}{
1453 \RenewDocumentEnvironment{bookcoverdescription}{ +b }{}{}
1454 \RemoveFromHook{env/bookcoverdescription/before}
1455 \RemoveFromHook{env/bookcoverdescription/after}
1456 \let\bookcover@marks\relax
1457 \bookcover@trimmedfalse
1458 \csname bookcover@part@param@\bookcover@showonlypart\endcsname
1459 \def\Gm@warning#1{}
1460 \geometry{%
1461 paperwidth=\bookcover@partwidth@,
1462 paperheight=\bookcover@partheight@,
1463 left=-\bookcover@xpos@,
1464 top=-\bookcover@ypos@}}}}
1465
1466 %% SHOWONLYCOVERNUM OPTION
1467
1468 \ifdefempty{\bookcover@showonlycovernum}{}{
1469 \newcounter{bookcover@num}
1470 \AddToHook{env/bookcover/begin}{%
1471 \stepcounter{bookcover@num}%
1472 \ifnum\value{bookcover@num}=\bookcover@showonlycovernum\else%
1473 \RenewDocumentEnvironment{bookcover}{ +b }{}{}%
1474 \fi}}
1475
1476 %% BOOKCOVER ENVIRONMENT
1477
1478 \def\bookcover{%
1479 \@inbookcoverenvtrue%
1480 \newpage%
1481 \pagecolor{\bookcover@pagecolor}
1482 \noindent%
1483 \begin{picture}(\paperwidth,\paperheight)(0,-\paperheight)}
1484
1485 \def\endbookcover{%
1486 \ifbookcover@trimmed\bookcover@trimming@part\fi%
1487 \ifdim\bookcover@markthick>0pt\ifdim\bookcover@marklength>0pt\bookcover@marks\fi\fi%
1488 \end{picture}%
1489 \par%
1490 \@inbookcoverenvfalse}
1491
1492 %% BOOKCOVER COMPONENT
1493
1494 \def\bookcover@setpartmargin(#1,#2,#3,#4){%
1495 \setlength{\bookcover@templength@a}{0mm}
1496 \setlength{\bookcover@templength@b}{0mm}
1497 \setlength{\bookcover@templength@c}{0mm}
1498 \setlength{\bookcover@templength@d}{0mm}
1499 \ifblank{#1}{}{\setlength{\bookcover@templength@a}{#1}}%
1500 \ifblank{#2}{}{\setlength{\bookcover@templength@b}{#2}}%
1501 \ifblank{#3}{}{\setlength{\bookcover@templength@c}{#3}}%
1502 \ifblank{#4}{}{\setlength{\bookcover@templength@d}{#4}}%
1503 \addtolength{\bookcover@xpos@}{\bookcover@templength@a}%
1504 \addtolength{\bookcover@partwidth@}{-\bookcover@templength@a}%
1505 \addtolength{\bookcover@partheight@}{-\bookcover@templength@b}%
1506 \addtolength{\bookcover@partwidth@}{-\bookcover@templength@c}%
1507 \addtolength{\bookcover@ypos@}{\bookcover@templength@d}%
1508 \addtolength{\bookcover@partheight@}{-\bookcover@templength@d}%
1509 \ifdim\bookcover@tikz@trimmed@part@width@minus>\dimexpr\bookcover@tikz@trimmed@part@push@right+\bookcover@templength@c\relax%
1510 \addtolength{\bookcover@tikz@trimmed@part@width@minus}{-\bookcover@tikz@trimmed@part@push@right-\bookcover@templength@c}%
1511 \else\setlength{\bookcover@tikz@trimmed@part@width@minus}{0mm}\fi%
1512 \ifdim\bookcover@tikz@trimmed@part@push@right>\bookcover@templength@a%
1513 \addtolength{\bookcover@tikz@trimmed@part@push@right}{-\bookcover@templength@a}%
1514 \else\setlength{\bookcover@tikz@trimmed@part@push@right}{0mm}\fi%
1515 \addtolength{\bookcover@tikz@trimmed@part@width@minus}{\bookcover@tikz@trimmed@part@push@right}%
1516 \ifdim\bookcover@tikz@trimmed@part@height@minus>\dimexpr\bookcover@tikz@trimmed@part@push@up+\bookcover@templength@d\relax%
1517 \addtolength{\bookcover@tikz@trimmed@part@height@minus}{-\bookcover@tikz@trimmed@part@push@up-\bookcover@templength@d}%
1518 \else\setlength{\bookcover@tikz@trimmed@part@height@minus}{0mm}\fi%
1519 \ifdim\bookcover@tikz@trimmed@part@push@up>\bookcover@templength@b%
1520 \addtolength{\bookcover@tikz@trimmed@part@push@up}{-\bookcover@templength@b}%
1521 \else\setlength{\bookcover@tikz@trimmed@part@push@up}{0mm}\fi%
1522 \addtolength{\bookcover@tikz@trimmed@part@height@minus}{\bookcover@tikz@trimmed@part@push@up}}
1523
1524 \NewDocumentCommand{\bookcovercomponent}{ m m O{,,,} +m }{%
1525 \if@inbookcoverenv\else%
1526 \@latexerr{Use \string\bookcovercomponent\space or 'bookcoverelement' in 'bookcover' environment!}{}\fi%
1527 \@ifundefined{bookcover@part@param@#2}{\@latexerr{Part '#2' is undefined.}{}}{%
1528 \@ifundefined{bookcover@componenttype@#1}{\@latexerr{Component type '#1' is undefined.}{}}{%
1529 \ifblank{#4}{}{%
1530 \begingroup%
1531 \csname bookcover@part@param@#2\endcsname%
1532 \bookcover@setpartmargin(#3)%
1533 \ifdim\bookcover@partwidth@>0mm%
1534 \ifdim\bookcover@partheight@>0mm%
1535 \csname bookcover@componenttype@#1\endcsname{#4}\fi\fi%
1536 \endgroup}}}}
1537
1538 %% BOOKCOVERELEMENT ENVIRONMENT
1539
1540 \NewDocumentEnvironment{bookcoverelement}{ m m O{,,,} +b }{\bookcovercomponent{#1}{#2}[#3]{#4}}{}
1541
1542 %% NEW BOOKCOVER PART
1543
1544 \def\newbookcoverpart#1#2{%
1545 \@ifundefined{bookcover@part@param@#1}{%
1546 \expandafter\def\csname bookcover@part@param@#1\endcsname{#2}}
1547 {\@latexerr{Part '#1' is already defined.}{}}}
1548
1549 %% RENEW BOOKCOVER PART
1550
1551 \def\renewbookcoverpart#1#2{%
1552 \ifstrequal{#1}{bookcoverpart@wholepage}{\@latexerr{Part '#1' is protected.}{}}%
1553 \ifstrequal{#1}{bookcoverpart@whole}{\@latexerr{Part '#1' is protected.}{}}%
1554 \@ifundefined{bookcover@part@param@#1}{\@latexerr{Part '#1' is undefined.}{}}{%
1555 \expandafter\def\csname bookcover@part@param@#1\endcsname{#2}}}
1556
1557 %% NEW NAME BOOKCOVER PART
1558
1559 \def\newnamebookcoverpart#1#2{%
1560 \@ifundefined{bookcover@part@param@#1}{%
1561 \@ifundefined{bookcover@part@param@#2}{\@latexerr{Part '#2' is undefined.}{}}{%
1562 \expandafter\def\csname bookcover@part@param@#1\endcsname{%
1563 \csname bookcover@part@param@#2\endcsname}}}
1564 {\@latexerr{Part '#1' is already defined.}{}}}
1565
1566 %% LET NAME BOOKCOVER PART
1567
1568 \NewDocumentCommand{\letnamebookcoverpart}{ m m O{,,,} }{%
1569 \@ifundefined{bookcover@part@param@#1}{%
1570 \@ifundefined{bookcover@part@param@#2}{\@latexerr{Part '#2' is undefined.}{}}{%
1571 \csletcs{bookcover@part@baseparam@#1}{bookcover@part@param@#2}%
1572 \protected@csedef{bookcover@part@margin@#1}{\bookcover@setpartmargin(#3)}%
1573 \protected@csedef{bookcover@part@param@#1}{\csuse{bookcover@part@baseparam@#1}\csuse{bookcover@part@margin@#1}}}}
1574 {\@latexerr{Part '#1' is already defined.}{}}}
1575
1576 %% NEW BOOKCOVER COMPONENT TYPE
1577
1578 \def\newbookcovercomponenttype#1#2{%
1579 \@ifundefined{bookcover@componenttype@#1}{%
1580 \long\expandafter\def\csname bookcover@componenttype@#1\endcsname##1{%
1581 \bookcover@posbox{\bookcover@partwidth@}{\bookcover@partheight@}{\bookcover@xpos@}{\bookcover@ypos@}{#2}}}
1582 {\@latexerr{Component type '#1' is already defined.}{}}}
1583
1584 %% RENEW BOOKCOVER COMPONENT TYPE
1585
1586 \def\renewbookcovercomponenttype#1#2{%
1587 \ifstrequal{#1}{bookcovertype@tikz}{\@latexerr{Component type '#1' is protected.}{}}%
1588 \@ifundefined{bookcover@componenttype@#1}{\@latexerr{Component type '#1' is undefined.}{}}{%
1589 \long\expandafter\def\csname bookcover@componenttype@#1\endcsname##1{%
1590 \bookcover@posbox{\bookcover@partwidth@}{\bookcover@partheight@}{\bookcover@xpos@}{\bookcover@ypos@}{#2}}}}
1591
1592 %% NEW NAME BOOKCOVER COMPONENT TYPE
1593
1594 \def\newnamebookcovercomponenttype#1#2{%
1595 \@ifundefined{bookcover@componenttype@#1}{%
1596 \@ifundefined{bookcover@componenttype@#2}{\@latexerr{Component type '#2' is undefined.}{}}{%
1597 \expandafter\def\csname bookcover@componenttype@#1\endcsname{%
1598 \csname bookcover@componenttype@#2\endcsname}}}
1599 {\@latexerr{Component type '#1' is already defined.}{}}}
1600
1601 %% LET NAME BOOKCOVER COMPONENT TYPE
1602
1603 \def\letnamebookcovercomponenttype#1#2{%
1604 \@ifundefined{bookcover@componenttype@#1}{%
1605 \@ifundefined{bookcover@componenttype@#2}{\@latexerr{Component type '#2' is undefined.}{}}{%
1606 \csletcs{bookcover@componenttype@#1}{bookcover@componenttype@#2}}}
1607 {\@latexerr{Component type '#1' is already defined.}{}}}
1608
1609 %% COMPONENT TYPES
1610
1611 \newbookcovercomponenttype{color}{%
1612 \tikz\fill\expandafter[#1] (0,0) rectangle (\bookcover@partwidth@,\bookcover@partheight@);}
1613
1614 \newbookcovercomponenttype{picture}{%
1615 \includegraphics[width=\bookcover@partwidth@,height=\bookcover@partheight@]{#1}}
1616
1617 \def\bookcover@tikz@content#1{%
1618 \begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@]
1619 \begingroup
1620 \pgfset{minimum width=\bookcover@partwidth@,
1621 minimum height=\bookcover@partheight@,
1622 outer sep=0pt}
1623 \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{}}
1624 \pgfset{minimum width=\bookcover@partwidth@-\bookcover@tikz@trimmed@part@width@minus,
1625 minimum height=\bookcover@partheight@-\bookcover@tikz@trimmed@part@height@minus,
1626 outer sep=0pt}
1627 \pgftransformshift{\pgfpoint{\bookcover@tikz@trimmed@part@push@right}
1628 {\bookcover@tikz@trimmed@part@push@up}}
1629 \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{}}
1630 \pgfnodealias{current trimmed part}{trimmed part}% for old method
1631 \pgfnodealias{current part}{part}% for old method
1632 \endgroup
1633 #1
1634 \end{tikzpicture}}
1635
1636 \newbookcovercomponenttype{tikz}{\bookcover@tikz@content{#1}}
1637
1638 \letnamebookcovercomponenttype{bookcovertype@tikz}{tikz} % bookcovertype@tikz is protected type
1639
1640 \newbookcovercomponenttype{tikz clip}{\bookcover@tikz@content{\clip (part.south west) rectangle (part.north east);#1}}
1641
1642 \newbookcovercomponenttype{normal}{#1}
1643
1644 \newbookcovercomponenttype{center}{\vfill{\centering#1\\}\vfill}
1645
1646 \newbookcovercomponenttype{ruler}{\expandafter\bookcover@setruler\expandafter(#1)}
1647
1648 \def\bookcover@setruler(#1,#2,#3){%
1649 \rulernorotatenum%
1650 \ifblank{#3}{\rulerparams{}{}{\bookcover@markcolor}{}{}}{\rulerparams{}{}{#3}{}{}}%
1651 \ifblank{#2}%
1652 {\ifblank{#1}%
1653 {\squareruler{upperleft}{\bookcover@partwidth@}{\bookcover@partheight@}}%
1654 {\squareruler[#1]{upperleft}{\bookcover@partwidth@}{\bookcover@partheight@}}}%
1655 {\ifblank{#1}%
1656 {\squareruler{#2}{\bookcover@partwidth@}{\bookcover@partheight@}}%
1657 {\squareruler[#1]{#2}{\bookcover@partwidth@}{\bookcover@partheight@}}}}
1658
1659 %% BOOKCOVER PARTS
1660
1661 \newbookcoverpart{bg back flap}{
1662 \ifdim\flapwidth>0mm
1663 \bookcover@ypos{\marklength}
1664 \bookcover@partheight{\coverheight+2\bleedwidth}
1665 \bookcover@xpos{\marklength}
1666 \bookcover@partwidth{\flapwidth+\bleedwidth}
1667 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1668
1669 \newbookcoverpart{bg back wrap}{
1670 \ifdim\flapwidth>0mm
1671 \bookcover@ypos{\marklength}
1672 \bookcover@partheight{\coverheight+2\bleedwidth}
1673 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
1674 \bookcover@partwidth{\wrapwidth}
1675 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
1676
1677 \newbookcoverpart{bg back}{
1678 \bookcover@ypos{\marklength}
1679 \bookcover@partheight{\coverheight+2\bleedwidth}
1680 \ifdim\flapwidth>0mm
1681 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
1682 \bookcover@partwidth{\coverwidth}
1683 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1684 \else
1685 \bookcover@xpos{\marklength}
1686 \bookcover@partwidth{\coverwidth+\bleedwidth}
1687 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1688
1689 \newbookcoverpart{bg spine}{
1690 \bookcover@ypos{\marklength}
1691 \bookcover@partheight{\coverheight+2\bleedwidth}
1692 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
1693 \bookcover@partwidth{\spinewidth}
1694 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}}
1695
1696 \newbookcoverpart{bg front}{
1697 \bookcover@ypos{\marklength}
1698 \bookcover@partheight{\coverheight+2\bleedwidth}
1699 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
1700 \ifdim\flapwidth>0mm
1701 \bookcover@partwidth{\coverwidth}
1702 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1703 \else
1704 \bookcover@partwidth{\coverwidth+\bleedwidth}
1705 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
1706
1707 \newbookcoverpart{bg front wrap}{
1708 \ifdim\flapwidth>0mm
1709 \bookcover@ypos{\marklength}
1710 \bookcover@partheight{\coverheight+2\bleedwidth}
1711 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth}
1712 \bookcover@partwidth{\wrapwidth}
1713 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
1714
1715 \newbookcoverpart{bg front flap}{
1716 \ifdim\flapwidth>0mm
1717 \bookcover@ypos{\marklength}
1718 \bookcover@partheight{\coverheight+2\bleedwidth}
1719 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\wrapwidth+2\coverwidth+\spinewidth}
1720 \bookcover@partwidth{\flapwidth+\bleedwidth}
1721 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
1722
1723 \newbookcoverpart{bg back flap and wrap}{
1724 \ifdim\flapwidth>0mm
1725 \bookcover@ypos{\marklength}
1726 \bookcover@partheight{\coverheight+2\bleedwidth}
1727 \bookcover@xpos{\marklength}
1728 \bookcover@partwidth{\flapwidth+\wrapwidth+\bleedwidth}
1729 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1730
1731 \newbookcoverpart{bg back and wrap}{
1732 \bookcover@ypos{\marklength}
1733 \bookcover@partheight{\coverheight+2\bleedwidth}
1734 \ifdim\flapwidth>0mm
1735 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
1736 \bookcover@partwidth{\coverwidth+\wrapwidth}
1737 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1738 \else
1739 \bookcover@xpos{\marklength}
1740 \bookcover@partwidth{\coverwidth+\bleedwidth}
1741 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1742
1743 \newbookcoverpart{bg back and spine}{
1744 \bookcover@ypos{\marklength}
1745 \bookcover@partheight{\coverheight+2\bleedwidth}
1746 \ifdim\flapwidth>0mm
1747 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
1748 \bookcover@partwidth{\coverwidth+\spinewidth}
1749 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1750 \else
1751 \bookcover@xpos{\marklength}
1752 \bookcover@partwidth{\coverwidth+\bleedwidth+\spinewidth}
1753 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1754
1755 \newbookcoverpart{bg front and spine}{
1756 \bookcover@ypos{\marklength}
1757 \bookcover@partheight{\coverheight+2\bleedwidth}
1758 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
1759 \ifdim\flapwidth>0mm
1760 \bookcover@partwidth{\coverwidth+\spinewidth}
1761 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1762 \else
1763 \bookcover@partwidth{\coverwidth+\spinewidth+\bleedwidth}
1764 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
1765
1766 \newbookcoverpart{bg front and wrap}{
1767 \bookcover@ypos{\marklength}
1768 \bookcover@partheight{\coverheight+2\bleedwidth}
1769 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
1770 \ifdim\flapwidth>0mm
1771 \bookcover@partwidth{\coverwidth+\wrapwidth}
1772 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1773 \else
1774 \bookcover@partwidth{\coverwidth+\bleedwidth}
1775 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
1776
1777 \newbookcoverpart{bg front flap and wrap}{
1778 \ifdim\flapwidth>0mm
1779 \bookcover@ypos{\marklength}
1780 \bookcover@partheight{\coverheight+2\bleedwidth}
1781 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth}
1782 \bookcover@partwidth{\flapwidth+\wrapwidth+\bleedwidth}
1783 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
1784
1785 \newbookcoverpart{bg back and flap}{
1786 \bookcover@ypos{\marklength}
1787 \bookcover@partheight{\coverheight+2\bleedwidth}
1788 \bookcover@xpos{\marklength}
1789 \bookcover@partwidth{\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
1790 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
1791
1792 \newbookcoverpart{bg back and spine and wrap}{
1793 \bookcover@ypos{\marklength}
1794 \bookcover@partheight{\coverheight+2\bleedwidth}
1795 \ifdim\flapwidth>0mm
1796 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
1797 \bookcover@partwidth{\wrapwidth+\coverwidth+\spinewidth}
1798 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1799 \else
1800 \bookcover@xpos{\marklength}
1801 \bookcover@partwidth{\wrapwidth+\coverwidth+\bleedwidth+\spinewidth}
1802 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1803
1804 \newbookcoverpart{bg back and spine and front}{
1805 \bookcover@ypos{\marklength}
1806 \bookcover@partheight{\coverheight+2\bleedwidth}
1807 \ifdim\flapwidth>0mm
1808 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
1809 \bookcover@partwidth{2\coverwidth+\spinewidth}
1810 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1811 \else
1812 \bookcover@xpos{\marklength}
1813 \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
1814 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1815
1816 \newbookcoverpart{bg front and spine and wrap}{
1817 \bookcover@ypos{\marklength}
1818 \bookcover@partheight{\coverheight+2\bleedwidth}
1819 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
1820 \ifdim\flapwidth>0mm
1821 \bookcover@partwidth{\coverwidth+\spinewidth+\wrapwidth}
1822 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1823 \else
1824 \bookcover@partwidth{\coverwidth+\spinewidth+\bleedwidth}
1825 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
1826
1827 \newbookcoverpart{bg front and flap}{
1828 \bookcover@ypos{\marklength}
1829 \bookcover@partheight{\coverheight+2\bleedwidth}
1830 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
1831 \bookcover@partwidth{\coverwidth+\flapwidth+\wrapwidth+\bleedwidth}
1832 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}}
1833
1834 \newbookcoverpart{bg back and flap and spine}{
1835 \bookcover@ypos{\marklength}
1836 \bookcover@partheight{\coverheight+2\bleedwidth}
1837 \bookcover@xpos{\marklength}
1838 \bookcover@partwidth{\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
1839 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
1840
1841 \newbookcoverpart{bg back and spine and front and back wrap}{
1842 \bookcover@ypos{\marklength}
1843 \bookcover@partheight{\coverheight+2\bleedwidth}
1844 \ifdim\flapwidth>0mm
1845 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
1846 \bookcover@partwidth{2\coverwidth+\spinewidth+\wrapwidth}
1847 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1848 \else
1849 \bookcover@xpos{\marklength}
1850 \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
1851 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1852
1853 \newbookcoverpart{bg back and spine and front and front wrap}{
1854 \bookcover@ypos{\marklength}
1855 \bookcover@partheight{\coverheight+2\bleedwidth}
1856 \ifdim\flapwidth>0mm
1857 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
1858 \bookcover@partwidth{2\coverwidth+\spinewidth+\wrapwidth}
1859 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1860 \else
1861 \bookcover@xpos{\marklength}
1862 \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
1863 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1864
1865 \newbookcoverpart{bg front and flap and spine}{
1866 \bookcover@ypos{\marklength}
1867 \bookcover@partheight{\coverheight+2\bleedwidth}
1868 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
1869 \bookcover@partwidth{\coverwidth+\flapwidth+\bleedwidth+\wrapwidth+\spinewidth}
1870 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}}
1871
1872 \newbookcoverpart{bg whole without front flap and wrap}{
1873 \bookcover@ypos{\marklength}
1874 \bookcover@partheight{\coverheight+2\bleedwidth}
1875 \bookcover@xpos{\marklength}
1876 \ifdim\flapwidth>0mm
1877 \bookcover@partwidth{2\coverwidth+\flapwidth+\wrapwidth+\bleedwidth+\spinewidth}
1878 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}
1879 \else
1880 \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
1881 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1882
1883 \newbookcoverpart{bg whole without flaps}{
1884 \bookcover@ypos{\marklength}
1885 \bookcover@partheight{\coverheight+2\bleedwidth}
1886 \ifdim\flapwidth>0mm
1887 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
1888 \bookcover@partwidth{2\coverwidth+\spinewidth+2\wrapwidth}
1889 \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
1890 \else
1891 \bookcover@xpos{\marklength}
1892 \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
1893 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1894
1895 \newbookcoverpart{bg whole without back flap and wrap}{
1896 \bookcover@ypos{\marklength}
1897 \bookcover@partheight{\coverheight+2\bleedwidth}
1898 \ifdim\flapwidth>0mm
1899 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
1900 \bookcover@partwidth{2\coverwidth+\flapwidth+\wrapwidth+\bleedwidth+\spinewidth}
1901 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0mm}{\bleedwidth}
1902 \else
1903 \bookcover@xpos{\marklength}
1904 \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
1905 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1906
1907 \newbookcoverpart{bg whole without front flap}{
1908 \bookcover@ypos{\marklength}
1909 \bookcover@partheight{\coverheight+2\bleedwidth}
1910 \bookcover@xpos{\marklength}
1911 \ifdim\flapwidth>0mm
1912 \bookcover@partwidth{2\coverwidth+\flapwidth+2\wrapwidth+\bleedwidth+\spinewidth}
1913 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}
1914 \else
1915 \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
1916 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1917
1918 \newbookcoverpart{bg whole without back flap}{
1919 \bookcover@ypos{\marklength}
1920 \bookcover@partheight{\coverheight+2\bleedwidth}
1921 \ifdim\flapwidth>0mm
1922 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
1923 \bookcover@partwidth{2\coverwidth+\flapwidth+2\wrapwidth+\bleedwidth+\spinewidth}
1924 \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0mm}{\bleedwidth}
1925 \else
1926 \bookcover@xpos{\marklength}
1927 \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
1928 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
1929
1930 \newbookcoverpart{bg whole}{
1931 \bookcover@ypos{\marklength}
1932 \bookcover@partheight{\coverheight+2\bleedwidth}
1933 \bookcover@xpos{\marklength}
1934 \bookcover@partwidth{2\coverwidth+2\bleedwidth+2\flapwidth+2\wrapwidth+\spinewidth}
1935 \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
1936
1937 \newbookcoverpart{whole page}{
1938 \bookcover@partheight{2\marklength+2\bleedwidth+\coverheight}
1939 \bookcover@partwidth{2\marklength+2\bleedwidth+2\coverwidth+2\flapwidth+2\wrapwidth+\spinewidth}}
1940
1941 \letnamebookcoverpart{bookcoverpart@wholepage}{whole page} % bookcoverpart@wholepage is protected part
1942
1943 \newbookcoverpart{back flap}{
1944 \ifdim\flapwidth>0mm
1945 \bookcover@ypos{\marklength+\bleedwidth}
1946 \bookcover@partheight{\coverheight}
1947 \bookcover@xpos{\marklength+\bleedwidth}
1948 \bookcover@partwidth{\flapwidth}\fi}
1949
1950 \newbookcoverpart{back wrap}{
1951 \ifdim\flapwidth>0mm
1952 \bookcover@ypos{\marklength+\bleedwidth}
1953 \bookcover@partheight{\coverheight}
1954 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
1955 \bookcover@partwidth{\wrapwidth}\fi}
1956
1957 \newbookcoverpart{back}{
1958 \bookcover@ypos{\marklength+\bleedwidth}
1959 \bookcover@partheight{\coverheight}
1960 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
1961 \bookcover@partwidth{\coverwidth}}
1962
1963 \newbookcoverpart{spine}{
1964 \bookcover@ypos{\marklength+\bleedwidth}
1965 \bookcover@partheight{\coverheight}
1966 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
1967 \bookcover@partwidth{\spinewidth}}
1968
1969 \newbookcoverpart{front}{
1970 \bookcover@ypos{\marklength+\bleedwidth}
1971 \bookcover@partheight{\coverheight}
1972 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
1973 \bookcover@partwidth{\coverwidth}}
1974
1975 \newbookcoverpart{front wrap}{
1976 \bookcover@ypos{\marklength+\bleedwidth}
1977 \bookcover@partheight{\coverheight}
1978 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth}
1979 \bookcover@partwidth{\wrapwidth}}
1980
1981 \newbookcoverpart{front flap}{
1982 \ifdim\flapwidth>0mm
1983 \bookcover@ypos{\marklength+\bleedwidth}
1984 \bookcover@partheight{\coverheight}
1985 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\wrapwidth+2\coverwidth+\spinewidth}
1986 \bookcover@partwidth{\flapwidth}\fi}
1987
1988 \newbookcoverpart{above front}{
1989 \ifdim\marklength>0mm
1990 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
1991 \bookcover@ypos{0mm}
1992 \bookcover@partwidth{\coverwidth}
1993 \bookcover@partheight{\marklength}\fi}
1994
1995 \newbookcoverpart{below front}{
1996 \ifdim\marklength>0mm
1997 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
1998 \bookcover@ypos{\marklength+2\bleedwidth+\coverheight}
1999 \bookcover@partwidth{\coverwidth}
2000 \bookcover@partheight{\marklength}\fi}
2001
2002 \newbookcoverpart{above back}{
2003 \ifdim\marklength>0mm
2004 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
2005 \bookcover@ypos{0mm}
2006 \bookcover@partwidth{\coverwidth}
2007 \bookcover@partheight{\marklength}\fi}
2008
2009 \newbookcoverpart{below back}{
2010 \ifdim\marklength>0mm
2011 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
2012 \bookcover@ypos{\marklength+2\bleedwidth+\coverheight}
2013 \bookcover@partwidth{\coverwidth}
2014 \bookcover@partheight{\marklength}\fi}
2015
2016 \newbookcoverpart{back flap and wrap}{
2017 \bookcover@ypos{\marklength+\bleedwidth}
2018 \bookcover@partheight{\coverheight}
2019 \bookcover@xpos{\marklength+\bleedwidth}
2020 \bookcover@partwidth{\flapwidth+\wrapwidth}}
2021
2022 \newbookcoverpart{back and wrap}{
2023 \bookcover@ypos{\marklength+\bleedwidth}
2024 \bookcover@partheight{\coverheight}
2025 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
2026 \bookcover@partwidth{\coverwidth+\wrapwidth}}
2027
2028 \newbookcoverpart{back and spine}{
2029 \bookcover@ypos{\marklength+\bleedwidth}
2030 \bookcover@partheight{\coverheight}
2031 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
2032 \bookcover@partwidth{\coverwidth+\spinewidth}}
2033
2034 \newbookcoverpart{front and spine}{
2035 \bookcover@ypos{\marklength+\bleedwidth}
2036 \bookcover@partheight{\coverheight}
2037 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
2038 \bookcover@partwidth{\coverwidth+\spinewidth}}
2039
2040 \newbookcoverpart{front and wrap}{
2041 \bookcover@ypos{\marklength+\bleedwidth}
2042 \bookcover@partheight{\coverheight}
2043 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
2044 \bookcover@partwidth{\coverwidth+\wrapwidth}}
2045
2046 \newbookcoverpart{front flap and wrap}{
2047 \ifdim\flapwidth>0mm
2048 \bookcover@ypos{\marklength+\bleedwidth}
2049 \bookcover@partheight{\coverheight}
2050 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth}
2051 \bookcover@partwidth{\flapwidth+\wrapwidth}\fi}
2052
2053 \newbookcoverpart{back and flap}{
2054 \bookcover@ypos{\marklength+\bleedwidth}
2055 \bookcover@xpos{\marklength+\bleedwidth}
2056 \bookcover@partwidth{\flapwidth+\wrapwidth+\coverwidth}
2057 \bookcover@partheight{\coverheight}}
2058
2059 \newbookcoverpart{back and spine and wrap}{
2060 \bookcover@ypos{\marklength+\bleedwidth}
2061 \bookcover@partheight{\coverheight}
2062 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
2063 \bookcover@partwidth{\coverwidth+\spinewidth+\wrapwidth}}
2064
2065 \newbookcoverpart{back and spine and front}{
2066 \bookcover@ypos{\marklength+\bleedwidth}
2067 \bookcover@partheight{\coverheight}
2068 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
2069 \bookcover@partwidth{2\coverwidth+\spinewidth}}
2070
2071 \newbookcoverpart{front and spine and wrap}{
2072 \bookcover@ypos{\marklength+\bleedwidth}
2073 \bookcover@partheight{\coverheight}
2074 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
2075 \bookcover@partwidth{\coverwidth+\spinewidth+\wrapwidth}}
2076
2077 \newbookcoverpart{front and flap}{
2078 \bookcover@ypos{\marklength+\bleedwidth}
2079 \bookcover@partheight{\coverheight}
2080 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
2081 \bookcover@partwidth{\coverwidth+\flapwidth+\wrapwidth}}
2082
2083 \newbookcoverpart{back and flap and spine}{
2084 \bookcover@ypos{\marklength+\bleedwidth}
2085 \bookcover@xpos{\marklength+\bleedwidth}
2086 \bookcover@partwidth{\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
2087 \bookcover@partheight{\coverheight}}
2088
2089 \newbookcoverpart{back and spine and front and back wrap}{
2090 \bookcover@ypos{\marklength+\bleedwidth}
2091 \bookcover@partheight{\coverheight}
2092 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
2093 \bookcover@partwidth{2\coverwidth+\spinewidth+\wrapwidth}}
2094
2095 \newbookcoverpart{back and spine and front and front wrap}{
2096 \bookcover@ypos{\marklength+\bleedwidth}
2097 \bookcover@partheight{\coverheight}
2098 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
2099 \bookcover@partwidth{2\coverwidth+\spinewidth+\wrapwidth}}
2100
2101 \newbookcoverpart{front and flap and spine}{
2102 \bookcover@ypos{\marklength+\bleedwidth}
2103 \bookcover@partheight{\coverheight}
2104 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
2105 \bookcover@partwidth{\coverwidth+\flapwidth+\wrapwidth+\spinewidth}}
2106
2107 \newbookcoverpart{whole without front flap and wrap}{
2108 \bookcover@ypos{\marklength+\bleedwidth}
2109 \bookcover@partheight{\coverheight}
2110 \bookcover@xpos{\marklength+\bleedwidth}
2111 \bookcover@partwidth{2\coverwidth+\flapwidth+\wrapwidth+\spinewidth}}
2112
2113 \newbookcoverpart{whole without flaps}{
2114 \bookcover@ypos{\marklength+\bleedwidth}
2115 \bookcover@partheight{\coverheight}
2116 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
2117 \bookcover@partwidth{2\coverwidth+\spinewidth+2\wrapwidth}}
2118
2119 \newbookcoverpart{whole without back flap and wrap}{
2120 \bookcover@ypos{\marklength+\bleedwidth}
2121 \bookcover@partheight{\coverheight}
2122 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
2123 \bookcover@partwidth{2\coverwidth+\flapwidth+\wrapwidth+\spinewidth}}
2124
2125 \newbookcoverpart{whole without front flap}{
2126 \bookcover@ypos{\marklength+\bleedwidth}
2127 \bookcover@partheight{\coverheight}
2128 \bookcover@xpos{\marklength+\bleedwidth}
2129 \bookcover@partwidth{2\coverwidth+\flapwidth+2\wrapwidth+\spinewidth}}
2130
2131 \newbookcoverpart{whole without back flap}{
2132 \bookcover@ypos{\marklength+\bleedwidth}
2133 \bookcover@partheight{\coverheight}
2134 \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
2135 \bookcover@partwidth{2\coverwidth+\flapwidth+2\wrapwidth+\spinewidth}}
2136
2137 \newbookcoverpart{whole}{
2138 \bookcover@ypos{\marklength+\bleedwidth}
2139 \bookcover@partheight{\coverheight}
2140 \bookcover@xpos{\marklength+\bleedwidth}
2141 \bookcover@partwidth{2\coverwidth+2\flapwidth+2\wrapwidth+\spinewidth}}
2142
2143 \letnamebookcoverpart{bookcoverpart@whole}{whole} % bookcoverpart@whole is protected part
2144
2145 %% SYNONYMOUS NAMES OF PARTS FOR INSIDE COVER ('INSIDE FRONT' = 'BACK', 'INSIDE BACK' = 'FRONT')
2146
2147 \@for\bookcover@partname@:={%
2148 bg back flap,bg back wrap,bg back,bg front,bg front wrap,bg front flap,%
2149 bg back flap and wrap,bg back and wrap,bg back and spine,bg front and spine,bg front and wrap,bg front flap and wrap,%
2150 bg back and flap,bg back and spine and wrap,bg back and spine and front,bg front and spine and wrap,bg front and flap,%
2151 bg back and flap and spine,bg back and spine and front and back wrap,bg back and spine and front and front wrap,bg front and flap and spine,%
2152 bg whole without front flap and wrap,bg whole without back flap and wrap,%
2153 bg whole without front flap,bg whole without back flap,%
2154 back flap,back wrap,back,front,front wrap,front flap,above back,above front,below back,below front,%
2155 back flap and wrap,back and wrap,back and spine,front and spine,front and wrap,front flap and wrap,%
2156 back and flap,back and spine and wrap,back and spine and front,front and spine and wrap,front and flap,%
2157 back and flap and spine,back and spine and front and back wrap,back and spine and front and front wrap,front and flap and spine,%
2158 whole without front flap and wrap,whole without back flap and wrap,%
2159 whole without front flap,whole without back flap}%
2160 \do{%
2161 \let\bookcover@partname@original@\bookcover@partname@%
2162 \patchcmd{\bookcover@partname@}{back}{b@ck}{}{}%
2163 \patchcmd{\bookcover@partname@}{front}{fr@nt}{}{}%
2164 \patchcmd{\bookcover@partname@}{b@ck}{inside front}{}{}%
2165 \patchcmd{\bookcover@partname@}{fr@nt}{inside back}{}{}%
2166 \letnamebookcoverpart{\bookcover@partname@}{\bookcover@partname@original@}}
2167
2168 %% SHORT NAMES OF PARTS
2169
2170 \def\bookcover@shortpartname@#1=#2.{\letnamebookcoverpart{#1}{#2}\letnamebookcoverpart{bg #1}{bg #2}}
2171 \@for\bookcover@partname@:={%
2172 lF=back flap.,lW=back wrap.,lC=back.,S=spine.,rC=front.,rW=front wrap.,rF=front flap.,%
2173 lF-lW=back flap and wrap.,lW-lC=back and wrap.,lC-S=back and spine.,S-rC=front and spine.,rC-rW=front and wrap.,rW-rF=front flap and wrap.,%
2174 lF-lC=back and flap.,lW-S=back and spine and wrap.,lC-rC=back and spine and front.,S-rW=front and spine and wrap.,rC-rF=front and flap.,%
2175 lF-S=back and flap and spine.,lW-rC=back and spine and front and back wrap.,lC-rW=back and spine and front and front wrap.,S-rF=front and flap and spine.,%
2176 lF-rC=whole without front flap and wrap.,lW-rW=whole without flaps.,lC-rF=whole without back flap and wrap.,%
2177 lF-rW=whole without front flap.,lW-rF=whole without back flap.,%
2178 lF-rF=whole.}%
2179 \do{\expandafter\bookcover@shortpartname@\bookcover@partname@}
2180
2181 \letnamebookcoverpart{remark}{above front}% for old method
2182
2183 %% OLD METHOD
2184
2185 \def\bookcover@reset{
2186 \def\bookcover@bgcolor@whole{}
2187 \def\bookcover@bgcolor@wholewf{}
2188 \def\bookcover@bgcolor@back{}
2189 \def\bookcover@bgcolor@front{}
2190 \def\bookcover@bgcolor@backflap{}
2191 \def\bookcover@bgcolor@frontflap{}
2192 \def\bookcover@bgcolor@spine{}
2193 \def\bookcover@bgpic@whole{}
2194 \def\bookcover@bgpic@wholewf{}
2195 \def\bookcover@bgpic@back{}
2196 \def\bookcover@bgpic@front{}
2197 \def\bookcover@bgpic@backflap{}
2198 \def\bookcover@bgpic@frontflap{}
2199 \def\bookcover@bgpic@spine{}
2200 \def\bookcover@bgtikz@whole{}
2201 \def\bookcover@bgtikz@wholewf{}
2202 \def\bookcover@bgtikz@back{}
2203 \def\bookcover@bgtikz@front{}
2204 \def\bookcover@bgtikz@backflap{}
2205 \def\bookcover@bgtikz@frontflap{}
2206 \def\bookcover@bgtikz@spine{}
2207 \def\bookcover@fgsecond@back{}
2208 \def\bookcover@fgsecond@front{}
2209 \def\bookcover@fgsecond@spine{}
2210 \def\bookcover@fgsecond@backflap{}
2211 \def\bookcover@fgsecond@frontflap{}
2212 \def\bookcover@fgfirst@back{}
2213 \def\bookcover@fgfirst@front{}
2214 \def\bookcover@fgfirst@spine{}
2215 \def\bookcover@fgfirst@backflap{}
2216 \def\bookcover@fgfirst@frontflap{}
2217 \def\bookcover@fgfirst@abovefront{}
2218 \def\bookcover@fgfirst@belowfront{}
2219 \def\bookcover@fgfirst@aboveback{}
2220 \def\bookcover@fgfirst@belowback{}}
2221
2222 \bookcover@reset
2223
2224 \long\def\oldsetbookcover@#1#2{
2225 \ifdefstring{\bookcover@firstparam}{bgcolor}{
2226 \ifstrequal{#1}{whole}{\def\bookcover@bgcolor@whole{\bookcovercomponent{color}{bg #1}{#2}}}{}
2227 \ifstrequal{#1}{whole without flaps}{\def\bookcover@bgcolor@wholewf{\bookcovercomponent{color}{bg #1}{#2}}}{}
2228 \ifstrequal{#1}{back}{\def\bookcover@bgcolor@back{\bookcovercomponent{color}{bg #1}{#2}}}{}
2229 \ifstrequal{#1}{front}{\def\bookcover@bgcolor@front{\bookcovercomponent{color}{bg #1}{#2}}}{}
2230 \ifstrequal{#1}{back flap}{\def\bookcover@bgcolor@backflap{\bookcovercomponent{color}{bg #1}{#2}}}{}
2231 \ifstrequal{#1}{front flap}{\def\bookcover@bgcolor@frontflap{\bookcovercomponent{color}{bg #1}{#2}}}{}
2232 \ifstrequal{#1}{spine}{\def\bookcover@bgcolor@spine{\bookcovercomponent{color}{bg #1}{#2}}}{}}{}
2233 \ifdefstring{\bookcover@firstparam}{bgpic}{
2234 \ifstrequal{#1}{whole}{\def\bookcover@bgpic@whole{\bookcovercomponent{picture}{bg #1}{#2}}}{}
2235 \ifstrequal{#1}{whole without flaps}{\def\bookcover@bgpic@wholewf{\bookcovercomponent{picture}{bg #1}{#2}}}{}
2236 \ifstrequal{#1}{back}{\def\bookcover@bgpic@back{\bookcovercomponent{picture}{bg #1}{#2}}}{}
2237 \ifstrequal{#1}{front}{\def\bookcover@bgpic@front{\bookcovercomponent{picture}{bg #1}{#2}}}{}
2238 \ifstrequal{#1}{back flap}{\def\bookcover@bgpic@backflap{\bookcovercomponent{picture}{bg #1}{#2}}}{}
2239 \ifstrequal{#1}{front flap}{\def\bookcover@bgpic@frontflap{\bookcovercomponent{picture}{bg #1}{#2}}}{}
2240 \ifstrequal{#1}{spine}{\def\bookcover@bgpic@spine{\bookcovercomponent{picture}{bg #1}{#2}}}{}}{}
2241 \ifdefstring{\bookcover@firstparam}{bgtikz}{
2242 \ifbookcover@bgtikzclip
2243 \ifstrequal{#1}{whole}{\def\bookcover@bgtikz@whole{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{}
2244 \ifstrequal{#1}{whole without flaps}{\def\bookcover@bgtikz@wholewf{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{}
2245 \ifstrequal{#1}{back}{\def\bookcover@bgtikz@back{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{}
2246 \ifstrequal{#1}{front}{\def\bookcover@bgtikz@front{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{}
2247 \ifstrequal{#1}{back flap}{\def\bookcover@bgtikz@backflap{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{}
2248 \ifstrequal{#1}{front flap}{\def\bookcover@bgtikz@frontflap{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{}
2249 \ifstrequal{#1}{spine}{\def\bookcover@bgtikz@spine{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{}
2250 \else
2251 \ifstrequal{#1}{whole}{\def\bookcover@bgtikz@whole{\bookcovercomponent{tikz}{bg #1}{#2}}}{}
2252 \ifstrequal{#1}{whole without flaps}{\def\bookcover@bgtikz@wholewf{\bookcovercomponent{tikz}{bg #1}{#2}}}{}
2253 \ifstrequal{#1}{back}{\def\bookcover@bgtikz@back{\bookcovercomponent{tikz}{bg #1}{#2}}}{}
2254 \ifstrequal{#1}{front}{\def\bookcover@bgtikz@front{\bookcovercomponent{tikz}{bg #1}{#2}}}{}
2255 \ifstrequal{#1}{back flap}{\def\bookcover@bgtikz@backflap{\bookcovercomponent{tikz}{bg #1}{#2}}}{}
2256 \ifstrequal{#1}{front flap}{\def\bookcover@bgtikz@frontflap{\bookcovercomponent{tikz}{bg #1}{#2}}}{}
2257 \ifstrequal{#1}{spine}{\def\bookcover@bgtikz@spine{\bookcovercomponent{tikz}{bg #1}{#2}}}{}
2258 \fi}{}
2259 \ifdefstring{\bookcover@firstparam}{fgsecond}{
2260 \ifstrequal{#1}{back}{\def\bookcover@fgsecond@back{\bookcovercomponent{normal}{#1}{#2}}}{}
2261 \ifstrequal{#1}{front}{\def\bookcover@fgsecond@front{\bookcovercomponent{normal}{#1}{#2}}}{}
2262 \ifstrequal{#1}{spine}{\def\bookcover@fgsecond@spine{\bookcovercomponent{normal}{#1}{#2}}}{}
2263 \ifstrequal{#1}{back flap}{\def\bookcover@fgsecond@backflap{\bookcovercomponent{normal}{#1}{#2}}}{}
2264 \ifstrequal{#1}{front flap}{\def\bookcover@fgsecond@frontflap{\bookcovercomponent{normal}{#1}{#2}}}{}}{}
2265 \ifdefstring{\bookcover@firstparam}{fgfirst}{
2266 \ifstrequal{#1}{back}{\def\bookcover@fgfirst@back{\bookcovercomponent{normal}{#1}{#2}}}{}
2267 \ifstrequal{#1}{front}{\def\bookcover@fgfirst@front{\bookcovercomponent{normal}{#1}{#2}}}{}
2268 \ifstrequal{#1}{spine}{\def\bookcover@fgfirst@spine{\bookcovercomponent{normal}{#1}{#2}}}{}
2269 \ifstrequal{#1}{back flap}{\def\bookcover@fgfirst@backflap{\bookcovercomponent{normal}{#1}{#2}}}{}
2270 \ifstrequal{#1}{front flap}{\def\bookcover@fgfirst@frontflap{\bookcovercomponent{normal}{#1}{#2}}}{}
2271 \ifstrequal{#1}{remark}{\def\bookcover@fgfirst@abovefront{\bookcovercomponent{center}{#1}{#2}}}{}
2272 \ifstrequal{#1}{above front}{\def\bookcover@fgfirst@abovefront{\bookcovercomponent{center}{#1}{#2}}}{}
2273 \ifstrequal{#1}{below front}{\def\bookcover@fgfirst@belowfront{\bookcovercomponent{center}{#1}{#2}}}{}
2274 \ifstrequal{#1}{above back}{\def\bookcover@fgfirst@aboveback{\bookcovercomponent{center}{#1}{#2}}}{}
2275 \ifstrequal{#1}{below back}{\def\bookcover@fgfirst@belowback{\bookcovercomponent{center}{#1}{#2}}}{}}{}}
2276
2277 \long\def\makebookcover{%
2278 \begin{bookcover}
2279 \bookcover@bgcolor@whole
2280 \bookcover@bgcolor@wholewf
2281 \bookcover@bgcolor@back
2282 \bookcover@bgcolor@front
2283 \bookcover@bgcolor@backflap
2284 \bookcover@bgcolor@frontflap
2285 \bookcover@bgcolor@spine
2286 \bookcover@bgpic@whole
2287 \bookcover@bgpic@wholewf
2288 \bookcover@bgpic@back
2289 \bookcover@bgpic@front
2290 \bookcover@bgpic@backflap
2291 \bookcover@bgpic@frontflap
2292 \bookcover@bgpic@spine
2293 \bookcover@bgtikz@whole
2294 \bookcover@bgtikz@wholewf
2295 \bookcover@bgtikz@back
2296 \bookcover@bgtikz@front
2297 \bookcover@bgtikz@backflap
2298 \bookcover@bgtikz@frontflap
2299 \bookcover@bgtikz@spine
2300 \bookcover@fgsecond@back
2301 \bookcover@fgsecond@front
2302 \bookcover@fgsecond@spine
2303 \bookcover@fgsecond@backflap
2304 \bookcover@fgsecond@frontflap
2305 \bookcover@fgfirst@back
2306 \bookcover@fgfirst@front
2307 \bookcover@fgfirst@spine
2308 \bookcover@fgfirst@backflap
2309 \bookcover@fgfirst@frontflap
2310 \bookcover@fgfirst@abovefront
2311 \bookcover@fgfirst@belowfront
2312 \bookcover@fgfirst@aboveback
2313 \bookcover@fgfirst@belowback
2314 \end{bookcover}
2315 \bookcover@reset}
2316
2317 % \end{macrocode}
2318 % \Finale
2319 \endinput