diff options
author | Karl Berry <karl@freefriends.org> | 2020-12-27 21:58:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-12-27 21:58:29 +0000 |
commit | 9c43d354b0b9f94078d890d8ac33a46e2fed9a4e (patch) | |
tree | 7bd7fb1271bcbff002c7f9aa68be9868bcba7c43 /Master/texmf-dist/tex/latex/bookcover | |
parent | eb4ae35281c4395b6f084138134421949b9d9183 (diff) |
bookcover (27dec20)
git-svn-id: svn://tug.org/texlive/trunk@57241 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 | 158 |
1 files changed, 153 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/bookcover/bookcover.cls b/Master/texmf-dist/tex/latex/bookcover/bookcover.cls index 225473ea2d0..86b6ff8b5bb 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/12/16 v3.1 class for book covers and dust jackets] +\ProvidesClass{bookcover}[2020/12/26 v3.2 class for book covers and dust jackets] %% OPTIONS @@ -41,6 +41,8 @@ \DeclareStringOption[white]{trimmingcolor} \DeclareBoolOption[false]{trimmed} \DeclareBoolOption[false]{foldingmargin} +\DeclareBoolOption[false]{bgtikznodes}% for old method +\DeclareBoolOption[false]{bgtikzclip}% for old method \ProcessKeyvalOptions{bookcover} %% CLASS AND PACKAGES @@ -123,9 +125,19 @@ %% SETBOOKCOVER -\def\setbookcover#1{% - \setkeys{bookcover}{#1}% - \setlength{\markthick}{\bookcover@markthick}} +\newif\if@oldsetbookcover% for old method + +\long\def\setbookcover#1{% + \@for\bookcover@firstparam:={bgcolor,bgpic,bgtikz,fgsecond}\do{% for old method + \ifdefstring{\bookcover@firstparam}{#1}{\global\@oldsetbookcovertrue}{}}% for old method + \if@oldsetbookcover% for old method + \gdef\bookcover@firstparam{#1}% for old method + \else% for old method + \gdef\oldsetbookcover@{}% for old method + \setkeys{bookcover}{#1}% + \setlength{\markthick}{\bookcover@markthick}% + \fi\oldsetbookcover@% for old method + } %% BOOKCOVERDESCGEOMETRY @@ -342,7 +354,7 @@ \newbookcovercomponenttype{picture}{% \includegraphics[width=\bookcover@partwidth@,height=\bookcover@partheight@]{#1}} -\long\def\bookcover@tikz@content#1{% +\def\bookcover@tikz@content#1{% \begin{tikzpicture}[overlay,yshift=-\bookcover@partheight@] \begin{scope}[transparent,line width=0pt] \pgfset{minimum width=\bookcover@partwidth@,minimum height=\bookcover@partheight@} @@ -352,6 +364,8 @@ \pgftransformshift{\pgfpoint{\bookcover@tikz@trimmed@part@push@right} {\bookcover@tikz@trimmed@part@push@up}} \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}} + \pgfnodealias{current trimmed part}{trimmed part}% for old method + \pgfnodealias{current part}{part}% for old method \end{scope} #1 \end{tikzpicture}} @@ -901,6 +915,140 @@ lF-rW=whole without front flap.,lW-rF=whole without back flap.,% lF-rF=whole.}% \do{\expandafter\bookcover@shortpartname@\bookcover@partname@} +%% OLD METHOD + +\def\bookcover@reset{ + \def\bookcover@bgcolor@whole{} + \def\bookcover@bgcolor@wholewf{} + \def\bookcover@bgcolor@back{} + \def\bookcover@bgcolor@front{} + \def\bookcover@bgcolor@backflap{} + \def\bookcover@bgcolor@frontflap{} + \def\bookcover@bgcolor@spine{} + \def\bookcover@bgpic@whole{} + \def\bookcover@bgpic@wholewf{} + \def\bookcover@bgpic@back{} + \def\bookcover@bgpic@front{} + \def\bookcover@bgpic@backflap{} + \def\bookcover@bgpic@frontflap{} + \def\bookcover@bgpic@spine{} + \def\bookcover@bgtikz@whole{} + \def\bookcover@bgtikz@wholewf{} + \def\bookcover@bgtikz@back{} + \def\bookcover@bgtikz@front{} + \def\bookcover@bgtikz@backflap{} + \def\bookcover@bgtikz@frontflap{} + \def\bookcover@bgtikz@spine{} + \def\bookcover@fgsecond@back{} + \def\bookcover@fgsecond@front{} + \def\bookcover@fgsecond@spine{} + \def\bookcover@fgsecond@backflap{} + \def\bookcover@fgsecond@frontflap{} + \def\bookcover@fgfirst@back{} + \def\bookcover@fgfirst@front{} + \def\bookcover@fgfirst@spine{} + \def\bookcover@fgfirst@backflap{} + \def\bookcover@fgfirst@frontflap{} + \def\bookcover@fgfirst@abovefront{} + \def\bookcover@fgfirst@belowfront{} + \def\bookcover@fgfirst@aboveback{} + \def\bookcover@fgfirst@belowback{}} + +\bookcover@reset + +\long\def\oldsetbookcover@#1#2{ + \ifdefstring{\bookcover@firstparam}{bgcolor}{ + \ifstrequal{#1}{whole}{\def\bookcover@bgcolor@whole{\bookcovercomponent{color}{bg #1}{#2}}}{} + \ifstrequal{#1}{whole without flaps}{\def\bookcover@bgcolor@wholewf{\bookcovercomponent{color}{bg #1}{#2}}}{} + \ifstrequal{#1}{back}{\def\bookcover@bgcolor@back{\bookcovercomponent{color}{bg #1}{#2}}}{} + \ifstrequal{#1}{front}{\def\bookcover@bgcolor@front{\bookcovercomponent{color}{bg #1}{#2}}}{} + \ifstrequal{#1}{back flap}{\def\bookcover@bgcolor@backflap{\bookcovercomponent{color}{bg #1}{#2}}}{} + \ifstrequal{#1}{front flap}{\def\bookcover@bgcolor@frontflap{\bookcovercomponent{color}{bg #1}{#2}}}{} + \ifstrequal{#1}{spine}{\def\bookcover@bgcolor@spine{\bookcovercomponent{color}{bg #1}{#2}}}{}}{} + \ifdefstring{\bookcover@firstparam}{bgpic}{ + \ifstrequal{#1}{whole}{\def\bookcover@bgpic@whole{\bookcovercomponent{picture}{bg #1}{#2}}}{} + \ifstrequal{#1}{whole without flaps}{\def\bookcover@bgpic@wholewf{\bookcovercomponent{picture}{bg #1}{#2}}}{} + \ifstrequal{#1}{back}{\def\bookcover@bgpic@back{\bookcovercomponent{picture}{bg #1}{#2}}}{} + \ifstrequal{#1}{front}{\def\bookcover@bgpic@front{\bookcovercomponent{picture}{bg #1}{#2}}}{} + \ifstrequal{#1}{back flap}{\def\bookcover@bgpic@backflap{\bookcovercomponent{picture}{bg #1}{#2}}}{} + \ifstrequal{#1}{front flap}{\def\bookcover@bgpic@frontflap{\bookcovercomponent{picture}{bg #1}{#2}}}{} + \ifstrequal{#1}{spine}{\def\bookcover@bgpic@spine{\bookcovercomponent{picture}{bg #1}{#2}}}{}}{} + \ifdefstring{\bookcover@firstparam}{bgtikz}{ + \ifbookcover@bgtikzclip + \ifstrequal{#1}{whole}{\def\bookcover@bgtikz@whole{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{} + \ifstrequal{#1}{whole without flaps}{\def\bookcover@bgtikz@wholewf{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{} + \ifstrequal{#1}{back}{\def\bookcover@bgtikz@back{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{} + \ifstrequal{#1}{front}{\def\bookcover@bgtikz@front{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{} + \ifstrequal{#1}{back flap}{\def\bookcover@bgtikz@backflap{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{} + \ifstrequal{#1}{front flap}{\def\bookcover@bgtikz@frontflap{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{} + \ifstrequal{#1}{spine}{\def\bookcover@bgtikz@spine{\bookcovercomponent{tikz clip}{bg #1}{#2}}}{} + \else + \ifstrequal{#1}{whole}{\def\bookcover@bgtikz@whole{\bookcovercomponent{tikz}{bg #1}{#2}}}{} + \ifstrequal{#1}{whole without flaps}{\def\bookcover@bgtikz@wholewf{\bookcovercomponent{tikz}{bg #1}{#2}}}{} + \ifstrequal{#1}{back}{\def\bookcover@bgtikz@back{\bookcovercomponent{tikz}{bg #1}{#2}}}{} + \ifstrequal{#1}{front}{\def\bookcover@bgtikz@front{\bookcovercomponent{tikz}{bg #1}{#2}}}{} + \ifstrequal{#1}{back flap}{\def\bookcover@bgtikz@backflap{\bookcovercomponent{tikz}{bg #1}{#2}}}{} + \ifstrequal{#1}{front flap}{\def\bookcover@bgtikz@frontflap{\bookcovercomponent{tikz}{bg #1}{#2}}}{} + \ifstrequal{#1}{spine}{\def\bookcover@bgtikz@spine{\bookcovercomponent{tikz}{bg #1}{#2}}}{} + \fi}{} + \ifdefstring{\bookcover@firstparam}{fgsecond}{ + \ifstrequal{#1}{back}{\def\bookcover@fgsecond@back{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{front}{\def\bookcover@fgsecond@front{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{spine}{\def\bookcover@fgsecond@spine{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{back flap}{\def\bookcover@fgsecond@backflap{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{front flap}{\def\bookcover@fgsecond@frontflap{\bookcovercomponent{normal}{#1}{#2}}}{}}{} + \ifdefstring{\bookcover@firstparam}{fgfirst}{ + \ifstrequal{#1}{back}{\def\bookcover@fgfirst@back{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{front}{\def\bookcover@fgfirst@front{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{spine}{\def\bookcover@fgfirst@spine{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{back flap}{\def\bookcover@fgfirst@backflap{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{front flap}{\def\bookcover@fgfirst@frontflap{\bookcovercomponent{normal}{#1}{#2}}}{} + \ifstrequal{#1}{remark}{\def\bookcover@fgfirst@abovefront{\bookcovercomponent{center}{#1}{#2}}}{} + \ifstrequal{#1}{above front}{\def\bookcover@fgfirst@abovefront{\bookcovercomponent{center}{#1}{#2}}}{} + \ifstrequal{#1}{below front}{\def\bookcover@fgfirst@belowfront{\bookcovercomponent{center}{#1}{#2}}}{} + \ifstrequal{#1}{above back}{\def\bookcover@fgfirst@aboveback{\bookcovercomponent{center}{#1}{#2}}}{} + \ifstrequal{#1}{below back}{\def\bookcover@fgfirst@belowback{\bookcovercomponent{center}{#1}{#2}}}{}}{}} + +\long\def\makebookcover{% + \begin{bookcover} + \bookcover@bgcolor@whole + \bookcover@bgcolor@wholewf + \bookcover@bgcolor@back + \bookcover@bgcolor@front + \bookcover@bgcolor@backflap + \bookcover@bgcolor@frontflap + \bookcover@bgcolor@spine + \bookcover@bgpic@whole + \bookcover@bgpic@wholewf + \bookcover@bgpic@back + \bookcover@bgpic@front + \bookcover@bgpic@backflap + \bookcover@bgpic@frontflap + \bookcover@bgpic@spine + \bookcover@bgtikz@whole + \bookcover@bgtikz@wholewf + \bookcover@bgtikz@back + \bookcover@bgtikz@front + \bookcover@bgtikz@backflap + \bookcover@bgtikz@frontflap + \bookcover@bgtikz@spine + \bookcover@fgsecond@back + \bookcover@fgsecond@front + \bookcover@fgsecond@spine + \bookcover@fgsecond@backflap + \bookcover@fgsecond@frontflap + \bookcover@fgfirst@back + \bookcover@fgfirst@front + \bookcover@fgfirst@spine + \bookcover@fgfirst@backflap + \bookcover@fgfirst@frontflap + \bookcover@fgfirst@abovefront + \bookcover@fgfirst@belowfront + \bookcover@fgfirst@aboveback + \bookcover@fgfirst@belowback + \end{bookcover} + \bookcover@reset} + \endinput %% %% End of file `bookcover.cls'. |