diff options
author | Karl Berry <karl@freefriends.org> | 2016-11-12 22:03:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-11-12 22:03:46 +0000 |
commit | 2f02917790deaa8de4efdbd67b88413d59b96faf (patch) | |
tree | 531b847a797ef86cf3d3e78e066b576f085373c3 /Master/texmf-dist/tex/latex/bookcover | |
parent | cf8e9a530012b13b4fbd576b5154c10836f1d803 (diff) |
bookcover (12nov16)
git-svn-id: svn://tug.org/texlive/trunk@42494 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bookcover')
-rw-r--r-- | Master/texmf-dist/tex/latex/bookcover/bookcover.cls | 769 |
1 files changed, 626 insertions, 143 deletions
diff --git a/Master/texmf-dist/tex/latex/bookcover/bookcover.cls b/Master/texmf-dist/tex/latex/bookcover/bookcover.cls index 11e3ae705a7..6bedd06e114 100644 --- a/Master/texmf-dist/tex/latex/bookcover/bookcover.cls +++ b/Master/texmf-dist/tex/latex/bookcover/bookcover.cls @@ -6,7 +6,7 @@ %% %% ./bookcover.dtx (with options: `class') %% This is a generated file. -%% Copyright (C) 2015 Tibor Tomacs +%% Copyright (C) 2015-2016 Tibor Tomacs %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either %% version 1.2 of this license or (at your option) any later @@ -18,7 +18,7 @@ %% LaTeX version 1999/12/01 or later. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesClass{bookcover}[2016/06/08 v1.1.1 class for book covers and dust jackets] +\ProvidesClass{bookcover}[2016/11/12 v2.0 class for book covers and dust jackets] %% %% OPTIONS \RequirePackage{kvoptions} @@ -36,18 +36,22 @@ \DeclareStringOption[5mm]{bleedwidth} \DeclareStringOption[red]{markcolor} \DeclareBoolOption[false]{trimmed} -\DeclareBoolOption[false]{bgtikznodes} -\DeclareBoolOption[false]{bgtikzclip} +\DeclareBoolOption[false]{bgtikznodes}% for old method +\DeclareBoolOption[false]{bgtikzclip}% for old method \ProcessKeyvalOptions{bookcover} +\ifbookcover@bgtikzclip\bookcover@bgtikznodestrue\fi% for old method -%% LOADING CLASS AND PACKAGES +%% CLASS AND PACKAGES \LoadClass{article} \RequirePackage{geometry,graphicx,calc,xcolor,ifthen,tikz,eso-pic} \RequirePackage[absolute]{textpos} -%% PAGE STYLE IS EMPTY +%% PAGE STYLE \pagestyle{empty} +%% NEW IF +\newif\if@inbookcoverenv + %% USER LENGTHS \newlength{\coverwidth} \newlength{\coverheight} @@ -62,8 +66,14 @@ \newlength{\bookcover@ypos@} \newlength{\bookcover@partwidth@} \newlength{\bookcover@partheight@} -\newlength{\bookcover@bgtikz@trimmed@part@width@minus} -\newlength{\bookcover@bgtikz@trimmed@part@push@right} +\newlength{\bookcover@tikz@trimmed@part@width@minus} +\newlength{\bookcover@tikz@trimmed@part@height@minus} +\newlength{\bookcover@tikz@trimmed@part@push@right} +\newlength{\bookcover@tikz@trimmed@part@push@up} +\newlength{\bookcover@ruler@xshift} +\newlength{\bookcover@ruler@yshift} +\let\partheight\bookcover@partheight@ +\let\partwidth\bookcover@partwidth@ %% USER LENGTHS SETTING \setlength{\coverwidth}{\bookcover@coverwidth} @@ -77,76 +87,87 @@ \setlength{\paperheight}{2\marklength+2\bleedwidth+\coverheight} \setlength{\parindent}{0pt} -%% GRID -\ifESO@grid - \setlength{\markthick}{2pt} - \def\bookcover@markcolor{red}\fi - -%% COMMANDS FOR INTERNAL LENGTHS SETTING +%% INTERNAL LENGTHS SETTING \def\bookcover@xpos#1{\setlength{\bookcover@xpos@}{#1}} \def\bookcover@ypos#1{\setlength{\bookcover@ypos@}{#1}} \def\bookcover@partwidth#1{\setlength{\bookcover@partwidth@}{#1}} \def\bookcover@partheight#1{\setlength{\bookcover@partheight@}{#1}} -\def\bookcover@bgtikz@trimmed@part@param#1#2{% - \setlength{\bookcover@bgtikz@trimmed@part@width@minus}{#1}% - \setlength{\bookcover@bgtikz@trimmed@part@push@right}{#2}} +\def\bookcover@tikz@trimmed@part@param#1#2#3#4{% + \setlength{\bookcover@tikz@trimmed@part@width@minus}{#1}% + \setlength{\bookcover@tikz@trimmed@part@height@minus}{#2} + \setlength{\bookcover@tikz@trimmed@part@push@right}{#3} + \setlength{\bookcover@tikz@trimmed@part@push@up}{#4}} +\def\bookcover@bgtikz@trimmed@part@param#1#2{ + \bookcover@tikz@trimmed@part@param{#1}{2\bleedwidth}{#2}{\bleedwidth}}% for old method +\let\setpartposx\bookcover@xpos +\let\setpartposy\bookcover@ypos +\let\setpartwidth\bookcover@partwidth +\let\setpartheight\bookcover@partheight +\let\settrimmedpart\bookcover@tikz@trimmed@part@param -%% MACROS FOR OUTPUTS OF PARTS -%% bgcolor -\def\bookcover@bgcolor#1{ - \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) - \tikz\expandafter\fill#1 (0,0) rectangle (\bookcover@partwidth@,\bookcover@partheight@); - \end{textblock*}} -%% bgpic -\def\bookcover@bgpic#1{ - \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) - \includegraphics[width=\bookcover@partwidth@,height=\bookcover@partheight@]{#1} - \end{textblock*}} -%% bgtikz -\def\bookcover@bgtikz#1{ - \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) - \ifbookcover@bgtikzclip\bookcover@bgtikznodestrue\fi - \ifbookcover@bgtikznodes - \begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@] - \begin{scope}[transparent,line width=0pt] - \pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@} - \pgfnode{rectangle}{south west}{}{current part}{\pgfusepath{draw}} - \pgfset{minimum width=\bookcover@partwidth@-\bookcover@bgtikz@trimmed@part@width@minus, - minimum height=\bookcover@partheight@-2\bleedwidth} - \pgftransformshift{\pgfpoint{\bookcover@bgtikz@trimmed@part@push@right}{\bleedwidth}} - \pgfnode{rectangle}{south west}{}{current trimmed part}{\pgfusepath{draw}} - \end{scope} - \ifbookcover@bgtikzclip - \clip (current part.south west) rectangle (current part.north east);\fi - \else\begin{tikzpicture}\fi - #1 - \end{tikzpicture} - \end{textblock*}} -%% fg -\def\bookcover@fg#1{ - \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) - \parbox[t][\bookcover@partheight@][t]{\bookcover@partwidth@}{#1} - \end{textblock*}} -%% remark -\def\bookcover@remark#1{ - \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) - \parbox[t][\bookcover@partheight@][c]{\bookcover@partwidth@} - {\centering#1\par} - \end{textblock*}} +%% GRID +\ifESO@grid + \setlength{\markthick}{2pt} + \def\bookcover@markcolor{red}\fi -%% MACROS FOR MARKS -%% vertical mark +%% MARKS \def\bookcover@vmark{ \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) {\color{\bookcover@markcolor}\rule[0pt]{\markthick}{\marklength}} \end{textblock*}} -%% horizontal mark + \def\bookcover@hmark{ \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) {\color{\bookcover@markcolor}\rule[0pt]{\marklength}{\markthick}} \end{textblock*}} -%% MACRO FOR TRIMMING +\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} + +%% TRIMMING \def\bookcover@trimming{ \begin{textblock*}{\paperwidth}(0mm,0mm) \begin{tikzpicture} @@ -198,6 +219,533 @@ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick} \bookcover@vmark} +%% 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#3\@empty\else + \csname bookcover@part@param@#2\endcsname + \ifdim\bookcover@partwidth@>0mm + \ifdim\bookcover@partheight@>0mm + \csname bookcover@componenttype@#1\endcsname{#3}\fi\fi\fi}}} + +%% BOOKCOVER ENVIRONMENT +\def\bookcover{\@inbookcoverenvtrue} +\def\endbookcover{ + \bookcover@marks + \ifbookcover@trimmed\bookcover@trimming\fi + \mbox{}\newpage\@inbookcoverenvfalse} + +%% NEW BOOKCOVER PART +\def\newbookcoverpart#1#2{ + \@ifundefined{bookcover@part@param@#1}{ + \expandafter\def\csname bookcover@part@param@#1\endcsname{#2}} + {\@latexerr{Part '#1' already defined.}{}}} + +%% RENEW BOOKCOVER PART +\def\renewbookcoverpart#1#2{ + \@ifundefined{bookcover@part@param@#1}{\@latexerr{Part '#1' 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.}{}}{ + \expandafter\def\csname bookcover@part@param@#1\endcsname{% + \csname bookcover@part@param@#2\endcsname}}} + {\@latexerr{Part '#1' already defined.}{}}} + +%% NEW BOOKCOVER COMPONENT TYPE +\def\newbookcovercomponenttype#1#2{ + \@ifundefined{bookcover@componenttype@#1}{ + \long\expandafter\def\csname bookcover@componenttype@#1\endcsname##1{ + \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) + #2 + \end{textblock*}}} + {\@latexerr{Component type '#1' already defined.}{}}} + +%% RENEW BOOKCOVER COMPONENT TYPE +\def\renewbookcovercomponenttype#1#2{ + \@ifundefined{bookcover@componenttype@#1}{\@latex@error{Component type '#1' undefined.}{}}{ + \long\expandafter\def\csname bookcover@componenttype@#1\endcsname##1{ + \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) + #2 + \end{textblock*}}}} + +%% NEW NAME BOOKCOVER COMPONENT TYPE +\def\newnamebookcovercomponenttype#1#2{ + \@ifundefined{bookcover@componenttype@#1}{ + \@ifundefined{bookcover@componenttype@#2}{\@latexerr{Component type '#2' undefined.}{}}{ + \expandafter\def\csname bookcover@componenttype@#1\endcsname{% + \csname bookcover@componenttype@#2\endcsname}}} + {\@latexerr{Component type '#1' already defined.}{}}} + +%% COMPONENT TYPES +\newbookcovercomponenttype{color}{ + \tikz\fill[#1] (0,0) rectangle (\bookcover@partwidth@,\bookcover@partheight@);} + +\newbookcovercomponenttype{picture}{ + \includegraphics[width=\bookcover@partwidth@,height=\bookcover@partheight@]{#1}} + +\newbookcovercomponenttype{tikz}{ + \begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@] + \begin{scope}[transparent,line width=0pt] + \pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@} + \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}} + \pgfset{minimum width=\bookcover@partwidth@-\bookcover@tikz@trimmed@part@width@minus, + minimum height=\bookcover@partheight@-\bookcover@tikz@trimmed@part@height@minus} + \pgftransformshift{\pgfpoint{\bookcover@tikz@trimmed@part@push@right} + {\bookcover@tikz@trimmed@part@push@up}} + \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}} + \end{scope} + #1 + \end{tikzpicture}} + +\newbookcovercomponenttype{tikz clip}{ + \begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@] + \begin{scope}[transparent,line width=0pt] + \pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@} + \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}} + \pgfset{minimum width=\bookcover@partwidth@-\bookcover@tikz@trimmed@part@width@minus, + minimum height=\bookcover@partheight@-\bookcover@tikz@trimmed@part@height@minus} + \pgftransformshift{\pgfpoint{\bookcover@tikz@trimmed@part@push@right} + {\bookcover@tikz@trimmed@part@push@up}} + \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}} + \end{scope} + \clip (part.south west) rectangle (part.north east); + #1 + \end{tikzpicture}} + +\newbookcovercomponenttype{normal}{ + \parbox[t][\bookcover@partheight@][t]{\bookcover@partwidth@}{#1}} + +\newbookcovercomponenttype{center}{ + \parbox[t][\bookcover@partheight@][c]{\bookcover@partwidth@}{\begin{center}#1\end{center}}} + +\newbookcovercomponenttype{ruler}{ + \begin{tikzpicture}[overlay,x=1mm,y=1mm,inner sep=0pt,outer sep=3pt,yshift=-\bookcover@partheight@] + #1 + \pgfmathsetmacro\xmax{round(.351459804*(\bookcover@partwidth@-\bookcover@ruler@xshift))} + \pgfmathsetmacro\xnummax{round(.0351459804*(\bookcover@partwidth@-\bookcover@ruler@xshift))} + \pgfmathsetmacro\ymax{round(.351459804*(\bookcover@partheight@-\bookcover@ruler@yshift))} + \pgfmathsetmacro\ynummax{round(.0351459804*(\bookcover@partheight@-\bookcover@ruler@yshift))} + \ifthenelse{\equal{\bookcover@ruler@coordsys}{lower left}}{ + \begin{scope}[xshift=\bookcover@ruler@xshift,yshift=\bookcover@ruler@yshift] + \foreach \num in {0,1,...,\xmax} + \draw (\num,0)--++(0,1); + \foreach \num in {0,5,...,\xmax} + \draw (\num,0)--++(0,1.5); + \foreach \num in {0,10,...,\xmax} + \draw (\num,0)--++(0,2); + \foreach \num in {1,2,...,\xnummax} + \node[anchor=south] at (10*\num,2) + {\sffamily\scriptsize\num}; + \foreach \num in {0,1,...,\ymax} + \draw (0,\num)--++(1,0); + \foreach \num in {0,5,...,\ymax} + \draw (0,\num)--++(1.5,0); + \foreach \num in {0,10,...,\ymax} + \draw (0,\num)--++(2,0); + \foreach \num in {1,2,...,\ynummax} + \node[anchor=west] at (2,10*\num) + {\sffamily\scriptsize\num}; + \node[anchor=south] at (5,2) + {\sffamily\scriptsize cm}; + \end{scope}}{} + \ifthenelse{\equal{\bookcover@ruler@coordsys}{lower right}}{ + \begin{scope}[xshift=-\bookcover@ruler@xshift,yshift=\bookcover@ruler@yshift] + \foreach \num in {0,1,...,\xmax} + \draw (\bookcover@partwidth@-\num mm,0)--++(0,1); + \foreach \num in {0,5,...,\xmax} + \draw (\bookcover@partwidth@-\num mm,0)--++(0,1.5); + \foreach \num in {0,10,...,\xmax} + \draw (\bookcover@partwidth@-\num mm,0)--++(0,2); + \foreach \num in {1,2,...,\xnummax} + \node[anchor=south] at (\bookcover@partwidth@-10*\num mm,2) + {\sffamily\scriptsize\num}; + \foreach \num in {0,1,...,\ymax} + \draw (\bookcover@partwidth@,\num)--++(-1,0); + \foreach \num in {0,5,...,\ymax} + \draw (\bookcover@partwidth@,\num)--++(-1.5,0); + \foreach \num in {0,10,...,\ymax} + \draw (\bookcover@partwidth@,\num)--++(-2,0); + \foreach \num in {1,2,...,\ynummax} + \node[anchor=east] at (\bookcover@partwidth@-2mm,10*\num) + {\sffamily\scriptsize\num}; + \node[anchor=south] at (\bookcover@partwidth@-5mm,2) + {\sffamily\scriptsize cm}; + \end{scope}}{} + \ifthenelse{\equal{\bookcover@ruler@coordsys}{upper left}}{ + \begin{scope}[xshift=\bookcover@ruler@xshift,yshift=-\bookcover@ruler@yshift] + \foreach \num in {0,1,...,\xmax} + \draw (\num,\bookcover@partheight@)--++(0,-1); + \foreach \num in {0,5,...,\xmax} + \draw (\num,\bookcover@partheight@)--++(0,-1.5); + \foreach \num in {0,10,...,\xmax} + \draw (\num,\bookcover@partheight@)--++(0,-2); + \foreach \num in {1,2,...,\xnummax} + \node[anchor=north] at (10*\num,\bookcover@partheight@-2mm) + {\sffamily\scriptsize\num}; + \foreach \num in {0,1,...,\ymax} + \draw (0,\bookcover@partheight@-\num mm)--++(1,0); + \foreach \num in {0,5,...,\ymax} + \draw (0,\bookcover@partheight@-\num mm)--++(1.5,0); + \foreach \num in {0,10,...,\ymax} + \draw (0,\bookcover@partheight@-\num mm)--++(2,0); + \foreach \num in {1,2,...,\ynummax} + \node[anchor=west] at (2,\bookcover@partheight@-10*\num mm) + {\sffamily\scriptsize\num}; + \node[anchor=north] at (5,\bookcover@partheight@-2mm) + {\sffamily\scriptsize\vphantom{1}cm}; + \end{scope}}{} + \ifthenelse{\equal{\bookcover@ruler@coordsys}{upper right}}{ + \begin{scope}[xshift=-\bookcover@ruler@xshift,yshift=-\bookcover@ruler@yshift] + \foreach \num in {0,1,...,\xmax} + \draw (\bookcover@partwidth@-\num mm,\bookcover@partheight@)--++(0,-1); + \foreach \num in {0,5,...,\xmax} + \draw (\bookcover@partwidth@-\num mm,\bookcover@partheight@)--++(0,-1.5); + \foreach \num in {0,10,...,\xmax} + \draw (\bookcover@partwidth@-\num mm,\bookcover@partheight@)--++(0,-2); + \foreach \num in {1,2,...,\xnummax} + \node[anchor=north] at (\bookcover@partwidth@-10*\num mm,\bookcover@partheight@-2mm) + {\sffamily\scriptsize\num}; + \foreach \num in {0,1,...,\ymax} + \draw (\bookcover@partwidth@,\bookcover@partheight@-\num mm)--++(-1,0); + \foreach \num in {0,5,...,\ymax} + \draw (\bookcover@partwidth@,\bookcover@partheight@-\num mm)--++(-1.5,0); + \foreach \num in {0,10,...,\ymax} + \draw (\bookcover@partwidth@,\bookcover@partheight@-\num mm)--++(-2,0); + \foreach \num in {1,2,...,\ynummax} + \node[anchor=east] at (\bookcover@partwidth@-2mm,\bookcover@partheight@-10*\num mm) + {\sffamily\scriptsize\num}; + \node[anchor=north] at (\bookcover@partwidth@-5mm,\bookcover@partheight@-2mm) + {\sffamily\scriptsize\vphantom{1}cm}; + \end{scope}}{} + \end{tikzpicture}} +\def\setruler#1#2#3#4{ + \def\bookcover@ruler@coordsys{#1} + \setlength{\bookcover@ruler@xshift}{#2} + \setlength{\bookcover@ruler@yshift}{#3} + \color{#4}} + +%% BOOKCOVER PARTS +\newbookcoverpart{bg back flap}{ + \ifdim\flapwidth>0mm + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \bookcover@xpos{\marklength} + \bookcover@partwidth{\flapwidth+\bleedwidth} + \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi} + +\newbookcoverpart{bg back}{ + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \ifdim\flapwidth>0mm + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@partwidth{\coverwidth} + \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 spine}{ + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\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} + \ifdim\flapwidth>0mm + \bookcover@partwidth{\coverwidth} + \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}{ + \ifdim\flapwidth>0mm + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth} + \bookcover@partwidth{\flapwidth+\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+\coverwidth} + \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}} + +\newbookcoverpart{bg back and spine}{ + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \ifdim\flapwidth>0mm + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@partwidth{\coverwidth+\spinewidth} + \bookcover@tikz@trimmed@part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth} + \else + \bookcover@xpos{\marklength} + \bookcover@partwidth{\coverwidth+\bleedwidth+\spinewidth} + \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi} + +\newbookcoverpart{bg front and spine}{ + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth} + \ifdim\flapwidth>0mm + \bookcover@partwidth{\coverwidth+\spinewidth} + \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@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@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}} + +\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} + \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 flap and spine}{ + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth} + \bookcover@partwidth{\coverwidth+\flapwidth+\bleedwidth+\spinewidth} + \bookcover@tikz@trimmed@part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}} + +\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@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 back flap}{ + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \ifdim\flapwidth>0mm + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@partwidth{2\coverwidth+\flapwidth+\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}{ + \bookcover@ypos{\marklength} + \bookcover@partheight{\coverheight+2\bleedwidth} + \bookcover@xpos{\marklength} + \bookcover@partwidth{2\coverwidth+2\bleedwidth+2\flapwidth+\spinewidth} + \bookcover@tikz@trimmed@part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}} + +\newbookcoverpart{whole page}{ + \bookcover@partheight{\paperheight} + \bookcover@partwidth{\paperwidth}} + +\newbookcoverpart{back flap}{ + \ifdim\flapwidth>0mm + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth} + \bookcover@partwidth{\flapwidth}\fi} + +\newbookcoverpart{back}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@partwidth{\coverwidth}} + +\newbookcoverpart{spine}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth} + \bookcover@partwidth{\spinewidth}} + +\newbookcoverpart{front}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth} + \bookcover@partwidth{\coverwidth}} + +\newbookcoverpart{front flap}{ + \ifdim\flapwidth>0mm + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth} + \bookcover@partwidth{\flapwidth}\fi} + +\newbookcoverpart{above front}{ + \ifdim\marklength>0mm + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\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@ypos{\marklength+2\bleedwidth+\coverheight} + \bookcover@partwidth{\coverwidth} + \bookcover@partheight{\marklength}\fi} + +\newbookcoverpart{above back}{ + \ifdim\marklength>0mm + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@ypos{0mm} + \bookcover@partwidth{\coverwidth} + \bookcover@partheight{\marklength}\fi} + +\newbookcoverpart{below back}{ + \ifdim\marklength>0mm + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@ypos{\marklength+2\bleedwidth+\coverheight} + \bookcover@partwidth{\coverwidth} + \bookcover@partheight{\marklength}\fi} + +\newbookcoverpart{back and flap}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@xpos{\marklength+\bleedwidth} + \bookcover@partwidth{\flapwidth+\coverwidth} + \bookcover@partheight{\coverheight}} + +\newbookcoverpart{back and spine}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@partwidth{\coverwidth+\spinewidth}} + +\newbookcoverpart{front and spine}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth} + \bookcover@partwidth{\coverwidth+\spinewidth}} + +\newbookcoverpart{front and flap}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth} + \bookcover@partwidth{\coverwidth+\flapwidth}} + +\newbookcoverpart{back and flap and spine}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@xpos{\marklength+\bleedwidth} + \bookcover@partwidth{\flapwidth+\coverwidth+\spinewidth} + \bookcover@partheight{\coverheight}} + +\newbookcoverpart{whole without flaps}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@partwidth{2\coverwidth+\spinewidth}} + +\newbookcoverpart{front and flap and spine}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth} + \bookcover@partwidth{\coverwidth+\flapwidth+\spinewidth}} + +\newbookcoverpart{whole without front flap}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth} + \bookcover@partwidth{2\coverwidth+\flapwidth+\spinewidth}} + +\newbookcoverpart{whole without back flap}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth+\flapwidth} + \bookcover@partwidth{2\coverwidth+\flapwidth+\spinewidth}} + +\newbookcoverpart{whole}{ + \bookcover@ypos{\marklength+\bleedwidth} + \bookcover@partheight{\coverheight} + \bookcover@xpos{\marklength+\bleedwidth} + \bookcover@partwidth{2\coverwidth+2\flapwidth+\spinewidth}} + +%%%%%%%%%%%%%%%% +%% OLD METHOD %% +%%%%%%%%%%%%%%%% + +%% MAIN LAYERS +\def\bookcover@bgcolor#1{ + \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) + \tikz\fill\expandafter[#1] (0,0) rectangle (\bookcover@partwidth@,\bookcover@partheight@); + \end{textblock*}} + +\def\bookcover@bgpic#1{ + \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) + \includegraphics[width=\bookcover@partwidth@,height=\bookcover@partheight@]{#1} + \end{textblock*}} + +\def\bookcover@bgtikz#1{ + \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) + \ifbookcover@bgtikznodes + \begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@] + \begin{scope}[transparent,line width=0pt] + \pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@} + \pgfnode{rectangle}{south west}{}{current part}{\pgfusepath{draw}}% for v1.1.1 + \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}} + \pgfset{minimum width=\bookcover@partwidth@-\bookcover@tikz@trimmed@part@width@minus, + minimum height=\bookcover@partheight@-\bookcover@tikz@trimmed@part@height@minus} + \pgftransformshift{\pgfpoint{\bookcover@tikz@trimmed@part@push@right} + {\bookcover@tikz@trimmed@part@push@up}} + \pgfnode{rectangle}{south west}{}{current trimmed part}{\pgfusepath{draw}}% for v1.1.1 + \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}} + \end{scope} + \ifbookcover@bgtikzclip + \clip (part.south west) rectangle (part.north east);\fi + \else\begin{tikzpicture}\fi + #1 + \end{tikzpicture} + \end{textblock*}} + +\def\bookcover@fg#1{ + \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) + \parbox[t][\bookcover@partheight@][t]{\bookcover@partwidth@}{#1} + \end{textblock*}} + +\def\bookcover@remark#1{ + \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) + \parbox[t][\bookcover@partheight@][c]{\bookcover@partwidth@}{\begin{center}#1\end{center}} + \end{textblock*}} + %% RESET DATAS \def\bookcover@reset{ \def\bookcover@bgcolor@whole{} @@ -237,16 +785,16 @@ \def\bookcover@fgsecond@frontflap{}} \bookcover@reset -%% SETBOOKCOVER +%% SET BOOKCOVER \long\def\setbookcover#1#2#3{ \ifthenelse{\equal{#1}{bgcolor}}{ - \ifthenelse{\equal{#2}{whole}}{\def\bookcover@bgcolor@whole{[#3]}}{} - \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover@bgcolor@wholewf{[#3]}}{} - \ifthenelse{\equal{#2}{back}}{\def\bookcover@bgcolor@back{[#3]}}{} - \ifthenelse{\equal{#2}{front}}{\def\bookcover@bgcolor@front{[#3]}}{} - \ifthenelse{\equal{#2}{back flap}}{\def\bookcover@bgcolor@backflap{[#3]}}{} - \ifthenelse{\equal{#2}{front flap}}{\def\bookcover@bgcolor@frontflap{[#3]}}{} - \ifthenelse{\equal{#2}{spine}}{\def\bookcover@bgcolor@spine{[#3]}}{}}{} + \ifthenelse{\equal{#2}{whole}}{\def\bookcover@bgcolor@whole{#3}}{} + \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover@bgcolor@wholewf{#3}}{} + \ifthenelse{\equal{#2}{back}}{\def\bookcover@bgcolor@back{#3}}{} + \ifthenelse{\equal{#2}{front}}{\def\bookcover@bgcolor@front{#3}}{} + \ifthenelse{\equal{#2}{back flap}}{\def\bookcover@bgcolor@backflap{#3}}{} + \ifthenelse{\equal{#2}{front flap}}{\def\bookcover@bgcolor@frontflap{#3}}{} + \ifthenelse{\equal{#2}{spine}}{\def\bookcover@bgcolor@spine{#3}}{}}{} \ifthenelse{\equal{#1}{bgpic}}{ \ifthenelse{\equal{#2}{whole}}{\def\bookcover@bgpic@whole{#3}}{} \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover@bgpic@wholewf{#3}}{} @@ -269,7 +817,7 @@ \ifthenelse{\equal{#2}{spine}}{\def\bookcover@fgfirst@spine{#3}}{} \ifthenelse{\equal{#2}{back flap}}{\def\bookcover@fgfirst@backflap{#3}}{} \ifthenelse{\equal{#2}{front flap}}{\def\bookcover@fgfirst@frontflap{#3}}{} - \ifthenelse{\equal{#2}{remark}}{\def\bookcover@fgfirst@abovefront{#3}}{}% for version 1.0 + \ifthenelse{\equal{#2}{remark}}{\def\bookcover@fgfirst@abovefront{#3}}{}% for v1.0 \ifthenelse{\equal{#2}{above front}}{\def\bookcover@fgfirst@abovefront{#3}}{} \ifthenelse{\equal{#2}{below front}}{\def\bookcover@fgfirst@belowfront{#3}}{} \ifthenelse{\equal{#2}{above back}}{\def\bookcover@fgfirst@aboveback{#3}}{} @@ -281,7 +829,7 @@ \ifthenelse{\equal{#2}{back flap}}{\def\bookcover@fgsecond@backflap{#3}}{} \ifthenelse{\equal{#2}{front flap}}{\def\bookcover@fgsecond@frontflap{#3}}{}}{}} -%% MAKEBOOKCOVER +%% MAKE BOOKCOVER \def\makebookcover{ %% background parameters \bookcover@ypos{\marklength} @@ -490,7 +1038,7 @@ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth} \bookcover@partwidth{\flapwidth} \bookcover@fg{\bookcover@fgfirst@frontflap}\fi\fi -%% {fgfirst}{above front} = {fgfirst}{remark} in version 1.0 +%% {fgfirst}{above front} = {fgfirst}{remark} in v1.0 \ifx\bookcover@fgfirst@abovefront\@empty\else\ifdim\marklength>0mm \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth} \bookcover@ypos{0mm} @@ -518,77 +1066,12 @@ \bookcover@partwidth{\coverwidth} \bookcover@partheight{\marklength} \bookcover@remark{\bookcover@fgfirst@belowback}\fi\fi -%% mark top parameters -\bookcover@ypos{0mm} -\bookcover@partwidth{\markthick} -%% mark top 1 -\bookcover@xpos{\marklength+\bleedwidth-.5\markthick} -\bookcover@vmark -%% mark top 2 -\ifdim\flapwidth>0mm - \bookcover@xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick} - \bookcover@vmark\fi -%% mark top 3 -\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick} -\bookcover@vmark -%% mark top 4 -\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick} -\bookcover@vmark -%% mark top 5 -\ifdim\flapwidth>0mm - \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick} - \bookcover@vmark\fi -%% mark top 6 -\bookcover@xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick} -\bookcover@vmark -%% mark bottom parameters -\bookcover@ypos{\paperheight-\marklength} -\bookcover@partwidth{\markthick} -%% mark bottom 1 -\bookcover@xpos{\marklength+\bleedwidth-.5\markthick} -\bookcover@vmark -%% mark bottom 2 -\ifdim\flapwidth>0mm - \bookcover@xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick} - \bookcover@vmark\fi -%% mark bottom 3 -\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick} -\bookcover@vmark -%% mark bottom 4 -\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick} -\bookcover@vmark -%% mark bottom 5 -\ifdim\flapwidth>0mm - \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick} - \bookcover@vmark\fi -%% mark bottom 6 -\bookcover@xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick} -\bookcover@vmark -%% mark left parameters -\bookcover@xpos{0mm} -\bookcover@partwidth{\marklength} -%% mark left 1 -\bookcover@ypos{\marklength+\bleedwidth-.5\markthick} -\bookcover@hmark -%% mark left 2 -\bookcover@ypos{\marklength+\bleedwidth+\coverheight-.5\markthick} -\bookcover@hmark -%% mark right parameters -\bookcover@xpos{\paperwidth-\marklength} -\bookcover@partwidth{\marklength} -%% mark right 1 -\bookcover@ypos{\marklength+\bleedwidth-.5\markthick} -\bookcover@hmark -%% mark right 2 -\bookcover@ypos{\marklength+\bleedwidth+\coverheight-.5\markthick} -\bookcover@hmark +%% marks +\bookcover@marks %% trimming -\ifbookcover@trimmed - \bookcover@trimming\fi +\ifbookcover@trimmed\bookcover@trimming\fi %% new book cover -\mbox{} -\newpage -\bookcover@reset} +\mbox{}\newpage\bookcover@reset} \endinput %% %% End of file `bookcover.cls'. |