summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bookcover
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-12-06 22:15:49 +0000
committerKarl Berry <karl@freefriends.org>2020-12-06 22:15:49 +0000
commitee7ad4e344ed96fd200349a08cc117577b65c83e (patch)
tree4baa405c1ef96a128e552222aa03fd399feb0ef4 /Master/texmf-dist/tex/latex/bookcover
parent3fdb50c0c03b81f4a73e2aded83a4cd2e8b35e86 (diff)
bookcover (6dec20)
git-svn-id: svn://tug.org/texlive/trunk@57079 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bookcover')
-rw-r--r--Master/texmf-dist/tex/latex/bookcover/bookcover.cls659
1 files changed, 445 insertions, 214 deletions
diff --git a/Master/texmf-dist/tex/latex/bookcover/bookcover.cls b/Master/texmf-dist/tex/latex/bookcover/bookcover.cls
index 855ca6fb87f..61b1a8403f5 100644
--- a/Master/texmf-dist/tex/latex/bookcover/bookcover.cls
+++ b/Master/texmf-dist/tex/latex/bookcover/bookcover.cls
@@ -19,7 +19,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesClass{bookcover}[2020/11/16 v2.5 class for book covers and dust jackets]
+\ProvidesClass{bookcover}[2020/12/06 v3.0 class for book covers and dust jackets]
%% OPTIONS
@@ -32,17 +32,20 @@
\DeclareStringOption[240mm]{coverheight}
\DeclareStringOption[5mm]{spinewidth}
\DeclareStringOption[0mm]{flapwidth}
+\DeclareStringOption[0mm]{wrapwidth}
\DeclareStringOption[10mm]{marklength}
\DeclareStringOption[.4pt]{markthick}
\DeclareStringOption[5mm]{bleedwidth}
\DeclareStringOption[red]{markcolor}
+\DeclareStringOption[white]{pagecolor}
+\DeclareStringOption[white]{trimmingcolor}
\DeclareBoolOption[false]{trimmed}
\ProcessKeyvalOptions{bookcover}
%% CLASS AND PACKAGES
\LoadClass{article}
-\RequirePackage{geometry,graphicx,calc,ifthen,tikz,environ}
+\RequirePackage{geometry,graphicx,calc,tikz,xparse,etoolbox}
\RequirePackage[nonefgrulers]{fgruler}
%% PAGE STYLE
@@ -60,6 +63,7 @@
\newlength{\coverheight}
\newlength{\spinewidth}
\newlength{\flapwidth}
+\newlength{\wrapwidth}
\newlength{\marklength}
\newlength{\markthick}
\newlength{\bleedwidth}
@@ -75,8 +79,6 @@
\newlength{\bookcover@tikz@trimmed@part@height@minus}
\newlength{\bookcover@tikz@trimmed@part@push@right}
\newlength{\bookcover@tikz@trimmed@part@push@up}
-\newlength{\bookcover@rulerwidth@}
-\newlength{\bookcover@rulerheight@}
\let\partheight\bookcover@partheight@
\let\partwidth\bookcover@partwidth@
@@ -86,6 +88,8 @@
\setlength{\coverheight}{\bookcover@coverheight}
\setlength{\spinewidth}{\bookcover@spinewidth}
\setlength{\flapwidth}{\bookcover@flapwidth}
+\setlength{\wrapwidth}{\bookcover@wrapwidth}
+\ifdim\flapwidth=0pt\setlength{\wrapwidth}{0pt}\fi
\setlength{\marklength}{\bookcover@marklength}
\setlength{\markthick}{\bookcover@markthick}
\setlength{\bleedwidth}{\bookcover@bleedwidth}
@@ -94,7 +98,7 @@
\geometry{%
margin=0pt,
- paperwidth=2\marklength+2\bleedwidth+2\coverwidth+2\flapwidth+\spinewidth,
+ paperwidth=2\marklength+2\bleedwidth+2\coverwidth+2\flapwidth+2\wrapwidth+\spinewidth,
paperheight=2\marklength+2\bleedwidth+\coverheight}
%% INTERNAL LENGTHS SETTING
@@ -114,6 +118,12 @@
\let\setpartheight\bookcover@partheight
\let\settrimmedpart\bookcover@tikz@trimmed@part@param
+%% SETBOOKCOVER
+
+\def\setbookcover#1{%
+ \setkeys{bookcover}{#1}%
+ \setlength{\markthick}{\bookcover@markthick}}
+
%% BOOKCOVERDESCGEOMETRY
\def\bookcoverdescgeometry#1{\def\bookcover@descgeometry{#1}}
@@ -128,209 +138,180 @@
%% POSBOX
-\newcommand{\bookcover@posbox}[4]{%
- \setlength{\bookcover@templength@}{#3}%
- \put(#2,-\bookcover@templength@){\parbox[b][0pt][t]{#1}{#4}}}
+\newcommand{\bookcover@posbox}[5]{%
+ \setlength{\bookcover@templength@}{#4}%
+ \put(#3,-\bookcover@templength@){%
+ \parbox[b][0pt][t]{#1}{%
+ \parbox[t][#2][t]{#1}{#5}}}}
%% MARKS
-\def\bookcover@vmark{%
- \bookcover@posbox{\bookcover@partwidth@}{\bookcover@xpos@}{\bookcover@ypos@}{%
- {\color{\bookcover@markcolor}\rule[0pt]{\markthick}{\marklength}}}}
-
-\def\bookcover@hmark{%
- \bookcover@posbox{\bookcover@partwidth@}{\bookcover@xpos@}{\bookcover@ypos@}{%
- {\color{\bookcover@markcolor}\rule[0pt]{\marklength}{\markthick}}}}
-
-\def\bookcover@marks{
- \bookcover@ypos{0mm}
- \bookcover@partwidth{\markthick}
- \bookcover@xpos{\marklength+\bleedwidth-.5\markthick}
- \bookcover@vmark
- \ifdim\flapwidth>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
- \bookcover@vmark\fi
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
- \bookcover@vmark
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark
- \ifdim\flapwidth>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark\fi
- \bookcover@xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark
- \bookcover@ypos{\paperheight-\marklength}
- \bookcover@partwidth{\markthick}
- \bookcover@xpos{\marklength+\bleedwidth-.5\markthick}
- \bookcover@vmark
- \ifdim\flapwidth>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
- \bookcover@vmark\fi
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
- \bookcover@vmark
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark
- \ifdim\flapwidth>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark\fi
- \bookcover@xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark
- \bookcover@xpos{0mm}
- \bookcover@partwidth{\marklength}
- \bookcover@ypos{\marklength+\bleedwidth-.5\markthick}
- \bookcover@hmark
- \bookcover@ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
- \bookcover@hmark
- \bookcover@xpos{\paperwidth-\marklength}
- \bookcover@partwidth{\marklength}
- \bookcover@ypos{\marklength+\bleedwidth-.5\markthick}
- \bookcover@hmark
- \bookcover@ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
- \bookcover@hmark}
+\def\bookcover@marks{\bookcovercomponent{bookcovertype@tikz}{bookcoverpart@wholepage}{
+ \begin{scope}[line width=\markthick,\bookcover@markcolor]
+ \draw (\marklength+\bleedwidth,0mm) -- +(0mm,\marklength);
+ \ifdim\flapwidth>0mm\draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth,0) -- +(0,\marklength);\fi
+ \draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth,0) -- +(0,\marklength);
+ \draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth,0) -- +(0,\marklength);
+ \ifdim\flapwidth>0mm\draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth,0) -- +(0,\marklength);\fi
+ \draw (\marklength+\bleedwidth+2\flapwidth+2\wrapwidth+2\coverwidth+\spinewidth,0) -- +(0,\marklength);
+ \draw (\marklength+\bleedwidth,\paperheight) -- +(0,-\marklength);
+ \ifdim\flapwidth>0mm\draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth,\paperheight) -- +(0,-\marklength);\fi%
+ \draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth,\paperheight) -- +(0,-\marklength);
+ \draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth,\paperheight) -- +(0,-\marklength);
+ \ifdim\flapwidth>0mm\draw (\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth,\paperheight) -- +(0,-\marklength);\fi
+ \draw (\marklength+\bleedwidth+2\flapwidth+2\wrapwidth+2\coverwidth+\spinewidth,\paperheight) -- +(0,-\marklength);
+ \draw (0,\paperheight-\marklength-\bleedwidth) -- +(\marklength,0);
+ \draw (0,\marklength+\bleedwidth) -- +(\marklength,0);
+ \draw (\paperwidth,\paperheight-\marklength-\bleedwidth) -- +(-\marklength,0);
+ \draw (\paperwidth,\marklength+\bleedwidth) -- +(-\marklength,0);
+ \end{scope}}}
%% TRIMMING
-\def\bookcover@trimming{%
- \bookcover@posbox{\paperwidth}{0mm}{0mm}{%
- \begin{tikzpicture}
- \begin{scope}[color=white]
- \fill(0,0)--
- (\paperwidth,0)--
- (\paperwidth,\marklength+\bleedwidth)--
- (0,\marklength+\bleedwidth)--cycle;
- \fill(0,\paperheight)--
- (\paperwidth,\paperheight)--
- (\paperwidth,\paperheight-\marklength-\bleedwidth)--
- (0,\paperheight-\marklength-\bleedwidth)--cycle;
- \fill(0,0)--
- (\marklength+\bleedwidth,0)--
- (\marklength+\bleedwidth,\paperheight)--
- (0,\paperheight)--cycle;
- \fill(\paperwidth-\marklength-\bleedwidth,0)--
- (\paperwidth,0)--
- (\paperwidth,\paperheight)--
- (\paperwidth-\marklength-\bleedwidth,\paperheight)--cycle;
- \end{scope}
- \draw[color=\bookcover@markcolor,line width=\markthick]
- (\marklength+\bleedwidth,\marklength+\bleedwidth)--
- (\paperwidth-\marklength-\bleedwidth,\marklength+\bleedwidth)--
- (\paperwidth-\marklength-\bleedwidth,\paperheight-\marklength-\bleedwidth)--
- (\marklength+\bleedwidth,\paperheight-\marklength-\bleedwidth)--cycle;
- \end{tikzpicture}}
- \bookcover@ypos{\bleedwidth}
- \bookcover@partwidth{\markthick}
- \ifdim\flapwidth>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
- \bookcover@vmark
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark\fi
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
- \bookcover@vmark
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark
- \bookcover@ypos{\paperheight-\marklength-\bleedwidth}
- \bookcover@partwidth{\markthick}
- \ifdim\flapwidth>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
- \bookcover@vmark
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark\fi
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
- \bookcover@vmark
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
- \bookcover@vmark}
+\def\bookcover@trimming@part{%
+ \expandafter\ifblank\expandafter{\bookcover@trimmedpart}{\def\bookcover@trimmedpart{bookcoverpart@whole}}{}%
+ \@ifundefined{bookcover@part@param@\bookcover@trimmedpart}{\@latexerr{Part '\bookcover@trimmedpart' is undefined.}{}}{%
+ \begingroup%
+ \csname bookcover@part@param@\bookcover@trimmedpart\endcsname%
+ \expandafter\bookcover@setpartmargin\expandafter(\bookcover@trimmedmargin)%
+ \ifdim\bookcover@partwidth@>0mm
+ \ifdim\bookcover@partheight@>0mm
+ \bookcover@posbox{\paperwidth}{\paperheight}{0mm}{0mm}{%
+ \begin{tikzpicture}
+ \begin{scope}[\bookcover@trimmingcolor]
+ \fill (0,0) rectangle (\paperwidth,\paperheight-\bookcover@ypos@-\bookcover@partheight@);
+ \fill (0,\paperheight) rectangle (\paperwidth,\paperheight-\bookcover@ypos@);
+ \fill (0,0) rectangle (\bookcover@xpos@,\paperheight);
+ \fill (\bookcover@xpos@+\bookcover@partwidth@,0) rectangle (\paperwidth,\paperheight);
+ \end{scope}
+ \end{tikzpicture}}\fi\fi
+ \endgroup}}
+
+\NewDocumentCommand{\bookcovertrimmedpart}{ m O{,,,} }{\def\bookcover@trimmedpart{#1}\def\bookcover@trimmedmargin{#2}}
+\def\bookcover@trimmedpart{bookcoverpart@whole}
+\def\bookcover@trimmedmargin{,,,}
%% BOOKCOVER ENVIRONMENT
\def\bookcover{%
\@inbookcoverenvtrue%
\newpage%
+ \pagecolor{\bookcover@pagecolor}
\noindent%
\begin{picture}(\paperwidth,\paperheight)(0,-\paperheight)}
\def\endbookcover{%
+ \ifbookcover@trimmed\bookcover@trimming@part\fi%
\bookcover@marks%
- \ifbookcover@trimmed\bookcover@trimming\fi%
\end{picture}%
- \@inbookcoverenvfalse}
+ \par\@inbookcoverenvfalse}
%% BOOKCOVER COMPONENT
-\long\def\bookcovercomponent#1#2#3{
- \if@inbookcoverenv\else
- \@latexerr{\string\bookcovercomponent\space is not in 'bookcover' environment.}{}\fi
- \bookcover@xpos{0pt}
- \bookcover@ypos{0pt}
- \bookcover@partwidth{0pt}
- \bookcover@partheight{0pt}
- \bookcover@tikz@trimmed@part@param{0pt}{0pt}{0pt}{0pt}
- \@ifundefined{bookcover@part@param@#2}{\@latexerr{Part '#2' undefined.}{}}{
- \@ifundefined{bookcover@componenttype@#1}{\@latexerr{Component type '#1' undefined.}{}}{
- \ifx\@empty#3\else
- \csname bookcover@part@param@#2\endcsname
- \ifdim\bookcover@partwidth@>0mm
- \ifdim\bookcover@partheight@>0mm
- \csname bookcover@componenttype@#1\endcsname{#3}\fi\fi\fi}}}
+\def\bookcover@setpartmargin(#1,#2,#3,#4){%
+ \ifblank{#1}{}{%
+ \addtolength{\bookcover@xpos@}{#1}%
+ \addtolength{\bookcover@partwidth@}{-#1}}%
+ \ifblank{#2}{}{%
+ \addtolength{\bookcover@partheight@}{-#2}}%
+ \ifblank{#3}{}{%
+ \addtolength{\bookcover@partwidth@}{-#3}}%
+ \ifblank{#4}{}{%
+ \addtolength{\bookcover@ypos@}{#4}%
+ \addtolength{\bookcover@partheight@}{-#4}}}
+
+\NewDocumentCommand{\bookcovercomponent}{ m m O{,,,} +m }{%
+ \if@inbookcoverenv\else%
+ \@latexerr{Use \string\bookcovercomponent\space or 'bookcoverelement' in 'bookcover' environment!}{}\fi%
+ \@ifundefined{bookcover@part@param@#2}{\@latexerr{Part '#2' is undefined.}{}}{%
+ \@ifundefined{bookcover@componenttype@#1}{\@latexerr{Component type '#1' is undefined.}{}}{%
+ \ifblank{#4}{}{%
+ \begingroup%
+ \csname bookcover@part@param@#2\endcsname%
+ \bookcover@setpartmargin(#3)%
+ \ifdim\bookcover@partwidth@>0mm%
+ \ifdim\bookcover@partheight@>0mm%
+ \csname bookcover@componenttype@#1\endcsname{#4}\fi\fi%
+ \endgroup}}}}
%% BOOKCOVERELEMENT ENVIRONMENT
-\NewEnviron{bookcoverelement}[2]{\bookcovercomponent{#1}{#2}{\BODY}}
+\NewDocumentEnvironment{bookcoverelement}{ m m O{,,,} +b }{\bookcovercomponent{#1}{#2}[#3]{#4}}
%% NEW BOOKCOVER PART
-\def\newbookcoverpart#1#2{
- \@ifundefined{bookcover@part@param@#1}{
+\def\newbookcoverpart#1#2{%
+ \@ifundefined{bookcover@part@param@#1}{%
\expandafter\def\csname bookcover@part@param@#1\endcsname{#2}}
- {\@latexerr{Part '#1' already defined.}{}}}
+ {\@latexerr{Part '#1' is already defined.}{}}}
%% RENEW BOOKCOVER PART
-\def\renewbookcoverpart#1#2{
- \@ifundefined{bookcover@part@param@#1}{\@latexerr{Part '#1' undefined.}{}}{
+\def\renewbookcoverpart#1#2{%
+ \ifstrequal{#1}{bookcoverpart@wholepage}{\@latexerr{Part '#1' is protected.}{}}%
+ \ifstrequal{#1}{bookcoverpart@whole}{\@latexerr{Part '#1' is protected.}{}}%
+ \@ifundefined{bookcover@part@param@#1}{\@latexerr{Part '#1' is undefined.}{}}{%
\expandafter\def\csname bookcover@part@param@#1\endcsname{#2}}}
%% NEW NAME BOOKCOVER PART
-\def\newnamebookcoverpart#1#2{
- \@ifundefined{bookcover@part@param@#1}{
- \@ifundefined{bookcover@part@param@#2}{\@latexerr{Part '#2' undefined.}{}}{
+\def\newnamebookcoverpart#1#2{%
+ \@ifundefined{bookcover@part@param@#1}{%
+ \@ifundefined{bookcover@part@param@#2}{\@latexerr{Part '#2' is undefined.}{}}{%
\expandafter\def\csname bookcover@part@param@#1\endcsname{%
\csname bookcover@part@param@#2\endcsname}}}
- {\@latexerr{Part '#1' already defined.}{}}}
+ {\@latexerr{Part '#1' is already defined.}{}}}
+
+%% LET NAME BOOKCOVER PART
+
+\def\letnamebookcoverpart#1#2{%
+ \@ifundefined{bookcover@part@param@#1}{%
+ \@ifundefined{bookcover@part@param@#2}{\@latexerr{Part '#2' is undefined.}{}}{%
+ \csletcs{bookcover@part@param@#1}{bookcover@part@param@#2}}}
+ {\@latexerr{Part '#1' is already defined.}{}}}
%% NEW BOOKCOVER COMPONENT TYPE
\def\newbookcovercomponenttype#1#2{%
\@ifundefined{bookcover@componenttype@#1}{%
\long\expandafter\def\csname bookcover@componenttype@#1\endcsname##1{%
- \bookcover@posbox{\bookcover@partwidth@}{\bookcover@xpos@}{\bookcover@ypos@}{#2}}}
- {\@latexerr{Component type '#1' already defined.}{}}}
+ \bookcover@posbox{\bookcover@partwidth@}{\bookcover@partheight@}{\bookcover@xpos@}{\bookcover@ypos@}{#2}}}
+ {\@latexerr{Component type '#1' is already defined.}{}}}
%% RENEW BOOKCOVER COMPONENT TYPE
\def\renewbookcovercomponenttype#1#2{%
- \@ifundefined{bookcover@componenttype@#1}{\@latex@error{Component type '#1' undefined.}{}}{%
+ \ifstrequal{#1}{bookcovertype@tikz}{\@latexerr{Component type '#1' is protected.}{}}%
+ \@ifundefined{bookcover@componenttype@#1}{\@latexerr{Component type '#1' is undefined.}{}}{%
\long\expandafter\def\csname bookcover@componenttype@#1\endcsname##1{%
- \bookcover@posbox{\bookcover@partwidth@}{\bookcover@xpos@}{\bookcover@ypos@}{#2}}}}
+ \bookcover@posbox{\bookcover@partwidth@}{\bookcover@partheight@}{\bookcover@xpos@}{\bookcover@ypos@}{#2}}}}
%% NEW NAME BOOKCOVER COMPONENT TYPE
-\def\newnamebookcovercomponenttype#1#2{
- \@ifundefined{bookcover@componenttype@#1}{
- \@ifundefined{bookcover@componenttype@#2}{\@latexerr{Component type '#2' undefined.}{}}{
+\def\newnamebookcovercomponenttype#1#2{%
+ \@ifundefined{bookcover@componenttype@#1}{%
+ \@ifundefined{bookcover@componenttype@#2}{\@latexerr{Component type '#2' is undefined.}{}}{%
\expandafter\def\csname bookcover@componenttype@#1\endcsname{%
\csname bookcover@componenttype@#2\endcsname}}}
- {\@latexerr{Component type '#1' already defined.}{}}}
+ {\@latexerr{Component type '#1' is already defined.}{}}}
+
+%% LET NAME BOOKCOVER COMPONENT TYPE
+
+\def\letnamebookcovercomponenttype#1#2{%
+ \@ifundefined{bookcover@componenttype@#1}{%
+ \@ifundefined{bookcover@componenttype@#2}{\@latexerr{Component type '#2' is undefined.}{}}{%
+ \csletcs{bookcover@componenttype@#1}{bookcover@componenttype@#2}}}
+ {\@latexerr{Component type '#1' is already defined.}{}}}
%% COMPONENT TYPES
-\newbookcovercomponenttype{color}{
+\newbookcovercomponenttype{color}{%
\tikz\fill\expandafter[#1] (0,0) rectangle (\bookcover@partwidth@,\bookcover@partheight@);}
-\newbookcovercomponenttype{picture}{
+\newbookcovercomponenttype{picture}{%
\includegraphics[width=\bookcover@partwidth@,height=\bookcover@partheight@]{#1}}
-\newbookcovercomponenttype{tikz}{
+\newbookcovercomponenttype{tikz}{%
\begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@]
\begin{scope}[transparent,line width=0pt]
\pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@}
@@ -344,7 +325,9 @@
#1
\end{tikzpicture}}
-\newbookcovercomponenttype{tikz clip}{
+\letnamebookcovercomponenttype{bookcovertype@tikz}{tikz} % bookcovertype@tikz is protected type
+
+\newbookcovercomponenttype{tikz clip}{%
\begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@]
\begin{scope}[transparent,line width=0pt]
\pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@}
@@ -359,31 +342,22 @@
#1
\end{tikzpicture}}
-\newbookcovercomponenttype{normal}{
- \parbox[t][\bookcover@partheight@][t]{\bookcover@partwidth@}{#1}}
+\newbookcovercomponenttype{normal}{#1}
+
+\newbookcovercomponenttype{center}{\vfill\begin{center}#1\end{center}\vfill}
-\newbookcovercomponenttype{center}{
- \parbox[t][\bookcover@partheight@][c]{\bookcover@partwidth@}{\begin{center}#1\end{center}}}
+\newbookcovercomponenttype{ruler}{\expandafter\bookcover@setruler\expandafter(#1)}
-\newbookcovercomponenttype{ruler}{
- \parbox[t][\bookcover@partheight@][t]{\bookcover@partwidth@}{#1}}
-\newcommand{\setruler}[5][cm]{%
+\def\bookcover@setruler(#1,#2,#3){%
\rulernorotatenum%
- \rulerparams{}{}{#5}{}{}%
- \setlength{\bookcover@rulerwidth@}{\bookcover@partwidth@-#3}%
- \setlength{\bookcover@rulerheight@}{\bookcover@partheight@-#4}%
- \ifthenelse{\equal{#2}{upper left}}{%
- \vspace{#4}%
- \hspace{#3}%
- \squareruler[#1]{upperleft}{\bookcover@rulerwidth@}{\bookcover@rulerheight@}}{}%
- \ifthenelse{\equal{#2}{upper right}}{%
- \vspace{#4}%
- \squareruler[#1]{upperright}{\bookcover@rulerwidth@}{\bookcover@rulerheight@}}{}%
- \ifthenelse{\equal{#2}{lower left}}{%
- \hspace{#3}%
- \squareruler[#1]{lowerleft}{\bookcover@rulerwidth@}{\bookcover@rulerheight@}}{}%
- \ifthenelse{\equal{#2}{lower right}}{%
- \squareruler[#1]{lowerright}{\bookcover@rulerwidth@}{\bookcover@rulerheight@}}{}}
+ \ifblank{#3}{\rulerparams{}{}{\bookcover@markcolor}{}{}}{\rulerparams{}{}{#3}{}{}}%
+ \ifblank{#2}%
+ {\ifblank{#1}%
+ {\squareruler{upperleft}{\bookcover@partwidth@}{\bookcover@partheight@}}%
+ {\squareruler[#1]{upperleft}{\bookcover@partwidth@}{\bookcover@partheight@}}}%
+ {\ifblank{#1}%
+ {\squareruler{#2}{\bookcover@partwidth@}{\bookcover@partheight@}}%
+ {\squareruler[#1]{#2}{\bookcover@partwidth@}{\bookcover@partheight@}}}}
%% BOOKCOVER PARTS
@@ -395,11 +369,19 @@
\bookcover@partwidth{\flapwidth+\bleedwidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+\newbookcoverpart{bg back wrap}{
+ \ifdim\flapwidth>0mm
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@partwidth{\wrapwidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
\newbookcoverpart{bg back}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
\ifdim\flapwidth>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
\bookcover@partwidth{\coverwidth}
\bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
\else
@@ -410,14 +392,14 @@
\newbookcoverpart{bg spine}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
\bookcover@partwidth{\spinewidth}
\bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}}
\newbookcoverpart{bg front}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
\ifdim\flapwidth>0mm
\bookcover@partwidth{\coverwidth}
\bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
@@ -425,26 +407,47 @@
\bookcover@partwidth{\coverwidth+\bleedwidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+\newbookcoverpart{bg front wrap}{
+ \ifdim\flapwidth>0mm
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth}
+ \bookcover@partwidth{\wrapwidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
\newbookcoverpart{bg front flap}{
\ifdim\flapwidth>0mm
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\wrapwidth+2\coverwidth+\spinewidth}
\bookcover@partwidth{\flapwidth+\bleedwidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
-\newbookcoverpart{bg back and flap}{
+\newbookcoverpart{bg back flap and wrap}{
+ \ifdim\flapwidth>0mm
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \bookcover@xpos{\marklength}
+ \bookcover@partwidth{\flapwidth+\wrapwidth+\bleedwidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg back and wrap}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
- \bookcover@xpos{\marklength}
- \bookcover@partwidth{\bleedwidth+\flapwidth+\coverwidth}
- \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
+ \ifdim\flapwidth>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@partwidth{\coverwidth+\wrapwidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+ \else
+ \bookcover@xpos{\marklength}
+ \bookcover@partwidth{\coverwidth+\bleedwidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
\newbookcoverpart{bg back and spine}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
\ifdim\flapwidth>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
\bookcover@partwidth{\coverwidth+\spinewidth}
\bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
\else
@@ -455,7 +458,7 @@
\newbookcoverpart{bg front and spine}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
\ifdim\flapwidth>0mm
\bookcover@partwidth{\coverwidth+\spinewidth}
\bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
@@ -463,26 +466,99 @@
\bookcover@partwidth{\coverwidth+\spinewidth+\bleedwidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+\newbookcoverpart{bg front and wrap}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
+ \ifdim\flapwidth>0mm
+ \bookcover@partwidth{\coverwidth+\wrapwidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+ \else
+ \bookcover@partwidth{\coverwidth+\bleedwidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front flap and wrap}{
+ \ifdim\flapwidth>0mm
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth}
+ \bookcover@partwidth{\flapwidth+\wrapwidth+\bleedwidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg back and flap}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \bookcover@xpos{\marklength}
+ \bookcover@partwidth{\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
+
+\newbookcoverpart{bg back and spine and wrap}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \ifdim\flapwidth>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@partwidth{\wrapwidth+\coverwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+ \else
+ \bookcover@xpos{\marklength}
+ \bookcover@partwidth{\wrapwidth+\coverwidth+\bleedwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg back and spine and front}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \ifdim\flapwidth>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
+ \bookcover@partwidth{2\coverwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+ \else
+ \bookcover@xpos{\marklength}
+ \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front and spine and wrap}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
+ \ifdim\flapwidth>0mm
+ \bookcover@partwidth{\coverwidth+\spinewidth+\wrapwidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+ \else
+ \bookcover@partwidth{\coverwidth+\spinewidth+\bleedwidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
\newbookcoverpart{bg front and flap}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
- \bookcover@partwidth{\coverwidth+\flapwidth+\bleedwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
+ \bookcover@partwidth{\coverwidth+\flapwidth+\wrapwidth+\bleedwidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}}
\newbookcoverpart{bg back and flap and spine}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
\bookcover@xpos{\marklength}
- \bookcover@partwidth{\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+ \bookcover@partwidth{\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
-\newbookcoverpart{bg whole without flaps}{
+\newbookcoverpart{bg back and spine and front and back wrap}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
\ifdim\flapwidth>0mm
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
- \bookcover@partwidth{2\coverwidth+\spinewidth}
+ \bookcover@partwidth{2\coverwidth+\spinewidth+\wrapwidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+ \else
+ \bookcover@xpos{\marklength}
+ \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg back and spine and front and front wrap}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \ifdim\flapwidth>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
+ \bookcover@partwidth{2\coverwidth+\spinewidth+\wrapwidth}
\bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
\else
\bookcover@xpos{\marklength}
@@ -492,16 +568,51 @@
\newbookcoverpart{bg front and flap and spine}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
- \bookcover@partwidth{\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
+ \bookcover@partwidth{\coverwidth+\flapwidth+\bleedwidth+\wrapwidth+\spinewidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}}
+\newbookcoverpart{bg whole without front flap and wrap}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \bookcover@xpos{\marklength}
+ \ifdim\flapwidth>0mm
+ \bookcover@partwidth{2\coverwidth+\flapwidth+\wrapwidth+\bleedwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}
+ \else
+ \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg whole without flaps}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \ifdim\flapwidth>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@partwidth{2\coverwidth+\spinewidth+2\wrapwidth}
+ \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+ \else
+ \bookcover@xpos{\marklength}
+ \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg whole without back flap and wrap}{
+ \bookcover@ypos{\marklength}
+ \bookcover@partheight{\coverheight+2\bleedwidth}
+ \ifdim\flapwidth>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
+ \bookcover@partwidth{2\coverwidth+\flapwidth+\wrapwidth+\bleedwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0mm}{\bleedwidth}
+ \else
+ \bookcover@xpos{\marklength}
+ \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+ \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
\newbookcoverpart{bg whole without front flap}{
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
\bookcover@xpos{\marklength}
\ifdim\flapwidth>0mm
- \bookcover@partwidth{2\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+ \bookcover@partwidth{2\coverwidth+\flapwidth+2\wrapwidth+\bleedwidth+\spinewidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}
\else
\bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
@@ -512,7 +623,7 @@
\bookcover@partheight{\coverheight+2\bleedwidth}
\ifdim\flapwidth>0mm
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
- \bookcover@partwidth{2\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+ \bookcover@partwidth{2\coverwidth+\flapwidth+2\wrapwidth+\bleedwidth+\spinewidth}
\bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0mm}{\bleedwidth}
\else
\bookcover@xpos{\marklength}
@@ -523,13 +634,15 @@
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
\bookcover@xpos{\marklength}
- \bookcover@partwidth{2\coverwidth+2\bleedwidth+2\flapwidth+\spinewidth}
+ \bookcover@partwidth{2\coverwidth+2\bleedwidth+2\flapwidth+2\wrapwidth+\spinewidth}
\bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
\newbookcoverpart{whole page}{
\bookcover@partheight{\paperheight}
\bookcover@partwidth{\paperwidth}}
+\letnamebookcoverpart{bookcoverpart@wholepage}{whole page} % bookcoverpart@wholepage is protected part
+
\newbookcoverpart{back flap}{
\ifdim\flapwidth>0mm
\bookcover@ypos{\marklength+\bleedwidth}
@@ -537,118 +650,236 @@
\bookcover@xpos{\marklength+\bleedwidth}
\bookcover@partwidth{\flapwidth}\fi}
+\newbookcoverpart{back wrap}{
+ \ifdim\flapwidth>0mm
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@partwidth{\wrapwidth}\fi}
+
\newbookcoverpart{back}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
\bookcover@partwidth{\coverwidth}}
\newbookcoverpart{spine}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
\bookcover@partwidth{\spinewidth}}
\newbookcoverpart{front}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
\bookcover@partwidth{\coverwidth}}
+\newbookcoverpart{front wrap}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth}
+ \bookcover@partwidth{\wrapwidth}}
+
\newbookcoverpart{front flap}{
\ifdim\flapwidth>0mm
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\wrapwidth+2\coverwidth+\spinewidth}
\bookcover@partwidth{\flapwidth}\fi}
\newbookcoverpart{above front}{
\ifdim\marklength>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
\bookcover@ypos{0mm}
\bookcover@partwidth{\coverwidth}
\bookcover@partheight{\marklength}\fi}
\newbookcoverpart{below front}{
\ifdim\marklength>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
\bookcover@ypos{\marklength+2\bleedwidth+\coverheight}
\bookcover@partwidth{\coverwidth}
\bookcover@partheight{\marklength}\fi}
\newbookcoverpart{above back}{
\ifdim\marklength>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
\bookcover@ypos{0mm}
\bookcover@partwidth{\coverwidth}
\bookcover@partheight{\marklength}\fi}
\newbookcoverpart{below back}{
\ifdim\marklength>0mm
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
\bookcover@ypos{\marklength+2\bleedwidth+\coverheight}
\bookcover@partwidth{\coverwidth}
\bookcover@partheight{\marklength}\fi}
-\newbookcoverpart{back and flap}{
+\newbookcoverpart{back flap and wrap}{
\bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
\bookcover@xpos{\marklength+\bleedwidth}
- \bookcover@partwidth{\flapwidth+\coverwidth}
- \bookcover@partheight{\coverheight}}
+ \bookcover@partwidth{\flapwidth+\wrapwidth}}
-\newbookcoverpart{back and spine}{
+\newbookcoverpart{back and wrap}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@partwidth{\coverwidth+\wrapwidth}}
+
+\newbookcoverpart{back and spine}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
\bookcover@partwidth{\coverwidth+\spinewidth}}
\newbookcoverpart{front and spine}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
\bookcover@partwidth{\coverwidth+\spinewidth}}
+\newbookcoverpart{front and wrap}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
+ \bookcover@partwidth{\coverwidth+\wrapwidth}}
+
+\newbookcoverpart{front flap and wrap}{
+ \ifdim\flapwidth>0mm
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+2\coverwidth+\spinewidth}
+ \bookcover@partwidth{\flapwidth+\wrapwidth}\fi}
+
+\newbookcoverpart{back and flap}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@xpos{\marklength+\bleedwidth}
+ \bookcover@partwidth{\flapwidth+\wrapwidth+\coverwidth}
+ \bookcover@partheight{\coverheight}}
+
+\newbookcoverpart{back and spine and wrap}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@partwidth{\coverwidth+\spinewidth+\wrapwidth}}
+
+\newbookcoverpart{back and spine and front}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
+ \bookcover@partwidth{2\coverwidth+\spinewidth}}
+
+\newbookcoverpart{front and spine and wrap}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
+ \bookcover@partwidth{\coverwidth+\spinewidth+\wrapwidth}}
+
\newbookcoverpart{front and flap}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
- \bookcover@partwidth{\coverwidth+\flapwidth}}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
+ \bookcover@partwidth{\coverwidth+\flapwidth+\wrapwidth}}
\newbookcoverpart{back and flap and spine}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@xpos{\marklength+\bleedwidth}
- \bookcover@partwidth{\flapwidth+\coverwidth+\spinewidth}
+ \bookcover@partwidth{\flapwidth+\wrapwidth+\coverwidth+\spinewidth}
\bookcover@partheight{\coverheight}}
-\newbookcoverpart{whole without flaps}{
+\newbookcoverpart{back and spine and front and back wrap}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
- \bookcover@partwidth{2\coverwidth+\spinewidth}}
+ \bookcover@partwidth{2\coverwidth+\spinewidth+\wrapwidth}}
+
+\newbookcoverpart{back and spine and front and front wrap}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
+ \bookcover@partwidth{2\coverwidth+\spinewidth+\wrapwidth}}
\newbookcoverpart{front and flap and spine}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
- \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
- \bookcover@partwidth{\coverwidth+\flapwidth+\spinewidth}}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth+\coverwidth}
+ \bookcover@partwidth{\coverwidth+\flapwidth+\wrapwidth+\spinewidth}}
+
+\newbookcoverpart{whole without front flap and wrap}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth}
+ \bookcover@partwidth{2\coverwidth+\flapwidth+\wrapwidth+\spinewidth}}
+
+\newbookcoverpart{whole without flaps}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@partwidth{2\coverwidth+\spinewidth+2\wrapwidth}}
+
+\newbookcoverpart{whole without back flap and wrap}{
+ \bookcover@ypos{\marklength+\bleedwidth}
+ \bookcover@partheight{\coverheight}
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\wrapwidth}
+ \bookcover@partwidth{2\coverwidth+\flapwidth+\wrapwidth+\spinewidth}}
\newbookcoverpart{whole without front flap}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
\bookcover@xpos{\marklength+\bleedwidth}
- \bookcover@partwidth{2\coverwidth+\flapwidth+\spinewidth}}
+ \bookcover@partwidth{2\coverwidth+\flapwidth+2\wrapwidth+\spinewidth}}
\newbookcoverpart{whole without back flap}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
- \bookcover@partwidth{2\coverwidth+\flapwidth+\spinewidth}}
+ \bookcover@partwidth{2\coverwidth+\flapwidth+2\wrapwidth+\spinewidth}}
\newbookcoverpart{whole}{
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
\bookcover@xpos{\marklength+\bleedwidth}
- \bookcover@partwidth{2\coverwidth+2\flapwidth+\spinewidth}}
+ \bookcover@partwidth{2\coverwidth+2\flapwidth+2\wrapwidth+\spinewidth}}
+
+\letnamebookcoverpart{bookcoverpart@whole}{whole} % bookcoverpart@whole is protected part
+
+%% SYNONYMOUS PART NAMES FOR INSIDE COVER ('INSIDE FRONT' = 'BACK', 'INSIDE BACK' = 'FRONT')
+
+\@for\bookcover@partname@:={%
+bg back flap,bg back wrap,bg back,bg front,bg front wrap,bg front flap,%
+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,%
+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,%
+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,%
+bg whole without front flap and wrap,bg whole without back flap and wrap,%
+bg whole without front flap,bg whole without back flap,%
+back flap,back wrap,back,front,front wrap,front flap,above back,above front,below back,below front,%
+back flap and wrap,back and wrap,back and spine,front and spine,front and wrap,front flap and wrap,%
+back and flap,back and spine and wrap,back and spine and front,front and spine and wrap,front and flap,%
+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,%
+whole without front flap and wrap,whole without back flap and wrap,%
+whole without front flap,whole without back flap}%
+\do{%
+\let\bookcover@partname@original@\bookcover@partname@%
+\patchcmd{\bookcover@partname@}{back}{b@ck}{}{}%
+\patchcmd{\bookcover@partname@}{front}{fr@nt}{}{}%
+\patchcmd{\bookcover@partname@}{b@ck}{inside front}{}{}%
+\patchcmd{\bookcover@partname@}{fr@nt}{inside back}{}{}%
+\letnamebookcoverpart{\bookcover@partname@}{\bookcover@partname@original@}}
+
+%% SHORT PART NAMES
+
+\def\bookcover@shortpartname@#1=#2.{\letnamebookcoverpart{#1}{#2}\letnamebookcoverpart{bg #1}{bg #2}}
+\@for\bookcover@partname@:={%
+lF=back flap.,lW=back wrap.,lC=back.,S=spine.,rC=front.,rW=front wrap.,rF=front flap.,%
+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.,%
+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.,%
+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.,%
+lF-rC=whole without front flap and wrap.,lW-rW=whole without flaps.,lC-rF=whole without back flap and wrap.,%
+lF-rW=whole without front flap.,lW-rF=whole without back flap.,%
+lF-rF=whole.}%
+\do{\expandafter\bookcover@shortpartname@\bookcover@partname@}
\endinput
%%