summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-02 01:30:50 +0000
committerKarl Berry <karl@freefriends.org>2016-05-02 01:30:50 +0000
commit222123b2bd4582710423d93e4308b081c3559ca5 (patch)
tree328333313a0dbc8304c9a3de2ef64a91d5aa2f28 /Master/texmf-dist/source
parent7ccea4b0af687f2124e13bca34803f61fd31c235 (diff)
bookcover (30apr16)
git-svn-id: svn://tug.org/texlive/trunk@40827 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/bookcover/bookcover.dtx396
1 files changed, 303 insertions, 93 deletions
diff --git a/Master/texmf-dist/source/latex/bookcover/bookcover.dtx b/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
index 2b0b4872935..4a6e041bb7b 100644
--- a/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
+++ b/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
@@ -17,20 +17,20 @@
% \iffalse
%<*driver>
\ProvidesFile{bookcover.dtx}
-\newcommand{\eifiledate}{2015/03/04}
-\newcommand{\eifilever}{v1.0}
+\newcommand{\eifiledate}{2016/05/01}
+\newcommand{\eifilever}{v1.1}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<class>\ProvidesClass{bookcover}[2015/03/04 v1.0 class for book covers and dust jackets]
+%<class>\ProvidesClass{bookcover}[2016/05/01 v1.1 class for book covers and dust jackets]
%
%<*driver>
-\documentclass[a4paper]{ltxdoc}
+\documentclass{ltxdoc}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
-\usepackage[paperwidth=210mm,paperheight=295mm,width=160mm,top=25mm,bottom=25mm,outer=25mm]{geometry}
-\usepackage[unicode,pdfstartview=FitH,bookmarksnumbered,pdfborder={0 0 0},colorlinks,linktocpage,pagecolor=blue,linkcolor=blue,urlcolor=blue,]{hyperref}
+\usepackage[paperwidth=210mm,paperheight=295mm,textwidth=160mm,top=25mm,bottom=25mm,outer=25mm]{geometry}
+\usepackage[unicode,pdfstartview=FitH,bookmarksnumbered,pdfborder={0 0 0},colorlinks,linktocpage,allcolors=blue]{hyperref}
\usepackage[english]{babel}
-\usepackage{xcolor,graphicx,listings}
+\usepackage{xcolor,graphicx,listings,calc,multirow}
\lstset{
literate={ü}{{\"u}}1{ó}{{\'o}}1{é}{{\'e}}1{á}{{\'a}}1{Á}{{\'A}}1,
basicstyle=\color{example}\small\ttfamily,
@@ -46,7 +46,7 @@ comment=[l][\ttfamily\color{black}]{\%}}
%</driver>
% \fi
%
-% \CheckSum{1182}
+% \CheckSum{1406}
%
% \CharacterTable
% {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
@@ -68,19 +68,18 @@ comment=[l][\ttfamily\color{black}]{\%}}
%
% \title{Class for book covers and dust jackets\\
% \textsf{bookcover.cls}\\
-% {\large\eifilever}}
-% \author{Tibor Tómács\\
-% {\color{blue}\normalsize\href{mailto:tomacs@ektf.hu}{\nolinkurl{tomacs@ektf.hu}}}}
-% \date{March 4, 2015}
+% {\large\eifilever\ (\eifiledate)}}
+% \author{Tibor Tómács\\{\normalsize\href{mailto:tomacs@ektf.hu}{\texttt{tomacs@ektf.hu}}}}
+% \date{}
% \maketitle
%
% \tableofcontents
%
% \section{Book cover parts and sizes}
-% In the following picture we can see a tipical dust jacket. Its main parts are back flap, back, spine, front and front flap.
+% In the following picture we can see a typical dust jacket. Its main parts are back flap, back, spine, front and front flap.
% Typographically, a book cover is a dust jacket without flaps, the only difference is that the book cover is a fixed part of the book, whereas the dust jacket is removable.
% \begin{center}
-% \includegraphics{figures/cover}
+% \includegraphics[height=40mm]{figures/cover}
% \end{center}
% When we prepare a cover for printing, some marks are needed to know where to trim or fold the paper. These marks determine a special area of the sheet, which is called ``bleed'' (see the next figure). The background will be expanded onto the bleed, taking account of slight inaccuracy when trimming.
% \begin{center}
@@ -153,13 +152,15 @@ comment=[l][\ttfamily\color{black}]{\%}}
% &\\
% \textbf{other options}&\\
% \hline
-% \texttt{markthick=}\meta{length} & thick of marks (default value: \texttt{0.4pt})\\
-% \texttt{markcolor=}\meta{color} & color of marks (default value: \texttt{red})\\
-% \texttt{10pt} & normal font size is 10\,pt (default)\\
-% \texttt{11pt} & normal font size is 11\,pt\\
-% \texttt{12pt} & normal font size is 12\,pt\\
-% \texttt{grid} & grid for checking sizes\\
-% \texttt{trimmed} & show trimmed version (see Subsection \ref{subsec:trimmed})
+% \texttt{markthick=}\meta{length} & Thickness of marks (default value: \texttt{0.4pt}).\\
+% \texttt{markcolor=}\meta{color} & Color of marks (default value: \texttt{red}).\\
+% \texttt{10pt} & Normal font size is 10\,pt (default).\\
+% \texttt{11pt} & Normal font size is 11\,pt.\\
+% \texttt{12pt} & Normal font size is 12\,pt.\\
+% \texttt{grid} & Grid for checking sizes.\\
+% \texttt{bgtikznodes} & See Subsubsection \ref{subsubsec:bgtikz}.\\
+% \texttt{bgtikzclip} & See Subsubsection \ref{subsubsec:bgtikz}.\\
+% \texttt{trimmed} & It shows trimmed version (see Subsection \ref{subsec:trimmed}).
% \end{tabular}
% \end{center}
% \bigskip\noindent\emph{Example:}
@@ -226,7 +227,7 @@ comment=[l][\ttfamily\color{black}]{\%}}
%\end{verbatim}
%\color{black}
%
-% \subsubsection{Background Ti\emph{k}Z figures}
+% \subsubsection{Background Ti\emph{k}Z figures}\label{subsubsec:bgtikz}
% {\color{newcommand}|\setbookcover{bgtikz}|\marg{background part}\marg{tikz code}}
%
% \medskip\noindent
@@ -240,17 +241,44 @@ comment=[l][\ttfamily\color{black}]{\%}}
%\color{example}
%\begin{verbatim}
%\setbookcover{bgtikz}{back}{
-% \fill[color=blue](0mm,250mm)--(100mm,250mm)--(100mm,245mm)--(0mm,110mm)--cycle;
-% \fill[color=yellow](5mm,5mm)--(175mm,245mm)--(175mm,0mm)--(5mm,0mm)--cycle;}
+% \fill[blue] (0mm,250mm)--(100mm,250mm)--(100mm,245mm)--(0mm,110mm)--cycle;
+% \fill[yellow] (5mm,5mm)--(175mm,245mm)--(175mm,0mm)--(5mm,0mm)--cycle;}
%\end{verbatim}
%\color{black}
%
+% \medskip\noindent
+% Using the option \texttt{bgtikznodes} of the document class:
+% \begin{itemize}
+% \item the origin moves to the lower left corner of the current background part;
+% \item two nodes come into being: \texttt{\color{newcommand}current part} and \texttt{\color{newcommand}current trimmed part}. (Thank Zunbeltz Izaola for the idea.)
+% \end{itemize}
+%
+% \bigskip\noindent\emph{Example:}
+%\color{example}
+%\begin{verbatim}
+%\setbookcover{bgtikz}{whole}{
+% \draw[blue] (current part.south west) rectangle (current part.north east);
+% \fill[gray](current trimmed part.south east) rectangle (current trimmed part.north west);
+% \fill[green] (0,0) circle [radius=2mm];}
+%\setbookcover{bgtikz}{spine}{
+% \fill[orange] (current part.center) circle [radius=8mm];}
+%\end{verbatim}
+%\color{black}
+% \begin{center}
+% \includegraphics{figures/bgtikznodes}
+% \end{center}
+% The option \texttt{bgtikzclip} of the document class works like \texttt{bgtikznodes}, but it clips the current part. For example, the result of the previous code with option \texttt{bgtikzclip}:
+% \begin{center}
+% \includegraphics{figures/bgtikzclip}
+% \end{center}
+%
% \subsubsection{First foreground}
% {\color{newcommand}|\setbookcover{fgfirst}|\marg{foreground part}\marg{content}}
%
% \medskip\noindent
% \meta{foreground part} (see Subsection \ref{subsec:foreground})\\
-% \hspace*{10mm}\texttt{back}, \texttt{front}, \texttt{spine}, \texttt{front flap}, \texttt{back flap}, \texttt{remark}
+% \hspace*{10mm}\texttt{back}, \texttt{front}, \texttt{spine}, \texttt{front flap}, \texttt{back flap},\\
+% \hspace*{10mm}\texttt{above front}, \texttt{below front}, \texttt{above back}, \texttt{below back}
%
% \medskip\noindent The first foreground is the top layer of the book cover (see Subsection \ref{subsec:layers}).
%
@@ -307,7 +335,8 @@ comment=[l][\ttfamily\color{black}]{\%}}
% \begin{center}
% \begin{tabular}{@{}ll@{}c@{}}
% \cline{1-2}
-% |fgfirst| & |back|, |front|, |spine|, |front flap|, |back flap|, |remark|& \color{layer}\emph{top layer}\\
+% \multirow{2}*{|fgfirst|} & |above front|, |below front|, |above back|, |below back|& \color{layer}\emph{top layer}\\
+% & |back|, |front|, |spine|, |front flap|, |back flap| &\color{layer}$\uparrow$\\
% \cline{1-2}
% |fgsecond| & |back|, |front|, |spine|, |front flap|, |back flap|&\color{layer}$\uparrow$\\
% \cline{1-2}
@@ -337,18 +366,96 @@ comment=[l][\ttfamily\color{black}]{\%}}
%the \texttt{TEXT} is above the \texttt{fig3.jpg}, the \texttt{fig3.jpg} is above the \texttt{fig2.jpg} and the \texttt{fig2.jpg} is above the \texttt{fig1.jpg}.
%
% \section{Examples}
-% The first example is a dust jacket.
+% \subsection{A dust jacket}
+% \lstinputlisting{example1.tex}
+% \subsection*{The result:}
% \begin{center}
-% \includegraphics[width=\textwidth]{example1}
+% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
+% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{example1}}
% \end{center}
-% \lstinputlisting{example1.tex}
%
-% \noindent The second example is a two-sided book cover. The outside and the inside are edited in the same document.
+% \subsection{A two-sided book cover}
+% The outside and the inside are edited in the same document.
+% \lstinputlisting{example2.tex}
+% \subsection*{The result:}
% \begin{center}
-% \includegraphics[page=1,width=\textwidth]{example2}\\[4mm]
-% \includegraphics[page=2,width=\textwidth]{example2}
+% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
+% \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-.8pt]{example2}}\\[4mm]
+% \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-.8pt]{example2}}
+% \end{center}
+%
+% \subsection{Drawing bar code by pst-barcode package}
+%
+%{\color{example}
+%\begin{verbatim}
+%\documentclass{bookcover}
+%\usepackage{pst-barcode}
+%\begin{document}
+% \setbookcover{fgfirst}{back}{
+% \vfill
+% \centering
+% \begin{pspicture}(1in,1.5in)
+% \psbarcode{1787-6117}{includetext height=1 width=1.5}{issn}
+% \end{pspicture}
+% \vspace{5mm}
+% }
+% \makebookcover
+%\end{document}
+%\end{verbatim}}
+%
+% \noindent We can compile this file by \texttt{latex.exe} only. If you want to use another compiler, then choose the following way:
+%
+%{\color{example}
+%\begin{verbatim}
+%\documentclass{bookcover}
+%
+%\usepackage{filecontents}
+%\begin{filecontents*}{bar.tex}
+% \documentclass{article}
+% \usepackage{pst-barcode}
+% \pagestyle{empty}
+% \begin{document}
+% \begin{pspicture}(1in,1.5in)
+% \psbarcode{1787-6117}{includetext height=1 width=1.5}{issn}
+% \end{pspicture}
+% \end{document}
+%\end{filecontents*}
+%
+%\immediate\write18{
+% latex bar.tex &&
+% dvips bar.dvi &&
+% ps2pdf bar.ps &&
+% pdfcrop -hires bar.pdf barcode.pdf}
+%
+%\begin{document}
+% \setbookcover{fgfirst}{back}{
+% \vfill
+% \centering
+% \includegraphics{barcode}
+% \vspace{5mm}
+% }
+% \makebookcover
+%\end{document}
+%\end{verbatim}}
+%
+% \noindent The command to compile this file is the following:
+%\begin{verbatim}
+%pdflatex -shell-escape filename
+%\end{verbatim}
+% or
+%\begin{verbatim}
+%xelatex -shell-escape filename
+%\end{verbatim}
+% or
+%\begin{verbatim}
+%lualatex -shell-escape filename
+%\end{verbatim}
+%
+% \subsection*{The result:}
+% \begin{center}
+% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
+% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{figures/example-barcode}}
% \end{center}
-% \lstinputlisting{example2.tex}
%
% \StopEventually{}
%
@@ -356,7 +463,7 @@ comment=[l][\ttfamily\color{black}]{\%}}
%
% \begin{macrocode}
%%
-%% Options
+%% OPTIONS
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=bookcover,prefix=bookcover@}
\DeclareVoidOption{10pt}{\PassOptionsToClass{10pt}{article}}
@@ -372,17 +479,21 @@ comment=[l][\ttfamily\color{black}]{\%}}
\DeclareStringOption[5mm]{bleedwidth}
\DeclareStringOption[red]{markcolor}
\DeclareBoolOption[false]{trimmed}
+\DeclareBoolOption[false]{bgtikznodes}
+\DeclareBoolOption[false]{bgtikzclip}
\ProcessKeyvalOptions{bookcover}
-%% Loading class and packages
+%% LOADING CLASS
\LoadClass{article}
+
+%% LOADING PACKAGES
\RequirePackage{geometry,graphicx,calc,xcolor,ifthen,tikz,eso-pic}
\RequirePackage[absolute]{textpos}
-%% Page style is empty
+%% PAGE STYLE
\pagestyle{empty}
-%% New length commands
+%% USER LENGTHS
\newlength{\coverwidth}
\newlength{\coverheight}
\newlength{\spinewidth}
@@ -390,12 +501,16 @@ comment=[l][\ttfamily\color{black}]{\%}}
\newlength{\marklength}
\newlength{\markthick}
\newlength{\bleedwidth}
+
+%% INTERNAL LENGTHS
\newlength{\bookcover@xpos@}
\newlength{\bookcover@ypos@}
\newlength{\bookcover@partwidth@}
\newlength{\bookcover@partheight@}
+\newlength{\bookcover@bgtikz@trimmed@part@width@minus}
+\newlength{\bookcover@bgtikz@trimmed@part@push@right}
-%% Set length commands
+%% USER LENGTHS SETTING
\setlength{\coverwidth}{\bookcover@coverwidth}
\setlength{\coverheight}{\bookcover@coverheight}
\setlength{\spinewidth}{\bookcover@spinewidth}
@@ -407,40 +522,128 @@ comment=[l][\ttfamily\color{black}]{\%}}
\setlength{\paperheight}{2\marklength+2\bleedwidth+\coverheight}
\setlength{\parindent}{0pt}
-%% If grid is true, then mark thick is 2pt and mark color is red
-\ifESO@grid\setlength{\markthick}{2pt}\def\bookcover@markcolor{red}\fi
+%% IF GRID
+\ifESO@grid
+ \setlength{\markthick}{2pt}
+ \def\bookcover@markcolor{red}\fi
-%% Internal macros
+%% COMMANDS FOR 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}}
+
+%% MACROS FOR OUTPUTS OF PARTS
+%% bgcolor
\def\bookcover@bgcolor#1{
\begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@)
- \tikz\expandafter\fill#1 (0mm,0mm) rectangle (\bookcover@partwidth@,\bookcover@partheight@);
+ \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@)
- \begin{tikzpicture}
+ \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*}}
+
+%% MACROS FOR MARKS
+%% vertical mark
\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@trimming{
+ \begin{textblock*}{\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}
+ \end{textblock*}
+ \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}
+
+%% RESET DATAS
\def\bookcover@reset{
\def\bookcover@bgcolor@whole{}
\def\bookcover@bgcolor@wholewf{}
@@ -468,17 +671,18 @@ comment=[l][\ttfamily\color{black}]{\%}}
\def\bookcover@fgfirst@spine{}
\def\bookcover@fgfirst@backflap{}
\def\bookcover@fgfirst@frontflap{}
- \def\bookcover@fgfirst@remark{}
+ \def\bookcover@fgfirst@abovefront{}
+ \def\bookcover@fgfirst@belowfront{}
+ \def\bookcover@fgfirst@aboveback{}
+ \def\bookcover@fgfirst@belowback{}
\def\bookcover@fgsecond@back{}
\def\bookcover@fgsecond@front{}
\def\bookcover@fgsecond@spine{}
\def\bookcover@fgsecond@backflap{}
\def\bookcover@fgsecond@frontflap{}}
-
-%% Reset datas
\bookcover@reset
-%% Definition of command \setbookcover
+%% SETBOOKCOVER
\long\def\setbookcover#1#2#3{
\ifthenelse{\equal{#1}{bgcolor}}{
\ifthenelse{\equal{#2}{whole}}{\def\bookcover@bgcolor@whole{[#3]}}{}
@@ -510,7 +714,11 @@ comment=[l][\ttfamily\color{black}]{\%}}
\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@remark{#3}}{}}{}
+ \ifthenelse{\equal{#2}{remark}}{\def\bookcover@fgfirst@abovefront{#3}}{}% for version 1.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}}{}
+ \ifthenelse{\equal{#2}{below back}}{\def\bookcover@fgfirst@belowback{#3}}{}}{}
\ifthenelse{\equal{#1}{fgsecond}}{
\ifthenelse{\equal{#2}{back}}{\def\bookcover@fgsecond@back{#3}}{}
\ifthenelse{\equal{#2}{front}}{\def\bookcover@fgsecond@front{#3}}{}
@@ -518,9 +726,9 @@ comment=[l][\ttfamily\color{black}]{\%}}
\ifthenelse{\equal{#2}{back flap}}{\def\bookcover@fgsecond@backflap{#3}}{}
\ifthenelse{\equal{#2}{front flap}}{\def\bookcover@fgsecond@frontflap{#3}}{}}{}}
-%% Definition of command \makebookcover
+%% MAKEBOOKCOVER
\def\makebookcover{
-%% Background
+%% background parameters
\bookcover@ypos{\marklength}
\bookcover@partheight{\coverheight+2\bleedwidth}
%% {bgcolor}{whole}
@@ -621,50 +829,60 @@ comment=[l][\ttfamily\color{black}]{\%}}
\ifx\bookcover@bgtikz@whole\@empty\else
\bookcover@xpos{\marklength}
\bookcover@partwidth{2\coverwidth+2\bleedwidth+2\flapwidth+\spinewidth}
+ \bookcover@bgtikz@trimmed@part@param{2\bleedwidth}{\bleedwidth}
\bookcover@bgtikz{\bookcover@bgtikz@whole}\fi
%% {bgtikz}{whole without flaps}
\ifx\bookcover@bgtikz@wholewf\@empty\else
\ifdim\flapwidth>0mm
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
\bookcover@partwidth{2\coverwidth+\spinewidth}
+ \bookcover@bgtikz@trimmed@part@param{0pt}{0pt}
\else
\bookcover@xpos{\marklength}
- \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}\fi
+ \bookcover@partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+ \bookcover@bgtikz@trimmed@part@param{2\bleedwidth}{\bleedwidth}\fi
\bookcover@bgtikz{\bookcover@bgtikz@wholewf}\fi
%% {bgtikz}{back flap}
\ifx\bookcover@bgtikz@backflap\@empty\else\ifdim\flapwidth>0mm
\bookcover@xpos{\marklength}
\bookcover@partwidth{\flapwidth+\bleedwidth}
+ \bookcover@bgtikz@trimmed@part@param{\bleedwidth}{\bleedwidth}
\bookcover@bgtikz{\bookcover@bgtikz@backflap}\fi\fi
%% {bgtikz}{back}
\ifx\bookcover@bgtikz@back\@empty\else
\ifdim\flapwidth>0mm
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
\bookcover@partwidth{\coverwidth}
+ \bookcover@bgtikz@trimmed@part@param{0pt}{0pt}
\else
\bookcover@xpos{\marklength}
- \bookcover@partwidth{\coverwidth+\bleedwidth}\fi
+ \bookcover@partwidth{\coverwidth+\bleedwidth}
+ \bookcover@bgtikz@trimmed@part@param{\bleedwidth}{\bleedwidth}\fi
\bookcover@bgtikz{\bookcover@bgtikz@back}\fi
%% {bgtikz}{spine}
\ifx\bookcover@bgtikz@spine\@empty\else
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
\bookcover@partwidth{\spinewidth}
+ \bookcover@bgtikz@trimmed@part@param{0pt}{0pt}
\bookcover@bgtikz{\bookcover@bgtikz@spine}\fi
%% {bgtikz}{front}
\ifx\bookcover@bgtikz@front\@empty\else
\ifdim\flapwidth>0mm
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
\bookcover@partwidth{\coverwidth}
+ \bookcover@bgtikz@trimmed@part@param{0pt}{0pt}
\else
\bookcover@xpos{\marklength+\bleedwidth+\coverwidth+\spinewidth}
- \bookcover@partwidth{\coverwidth+\bleedwidth}\fi
+ \bookcover@partwidth{\coverwidth+\bleedwidth}
+ \bookcover@bgtikz@trimmed@part@param{\bleedwidth}{0pt}\fi
\bookcover@bgtikz{\bookcover@bgtikz@front}\fi
%% {bgtikz}{front flap}
\ifx\bookcover@bgtikz@frontflap\@empty\else\ifdim\flapwidth>0mm
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
\bookcover@partwidth{\flapwidth+\bleedwidth}
+ \bookcover@bgtikz@trimmed@part@param{\bleedwidth}{0pt}
\bookcover@bgtikz{\bookcover@bgtikz@frontflap}\fi\fi
-%% Foreground
+%% foreground parameters
\bookcover@ypos{\marklength+\bleedwidth}
\bookcover@partheight{\coverheight}
%% {fgsecond}{back flap}
@@ -717,18 +935,35 @@ comment=[l][\ttfamily\color{black}]{\%}}
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
\bookcover@partwidth{\flapwidth}
\bookcover@fg{\bookcover@fgfirst@frontflap}\fi\fi
-%% {fgfirst}{remark}
-\ifx\bookcover@fgfirst@remark\@empty\else\ifdim\marklength>0mm
+%% {fgfirst}{above front} = {fgfirst}{remark} in version 1.0
+\ifx\bookcover@fgfirst@abovefront\@empty\else\ifdim\marklength>0mm
\bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
\bookcover@ypos{0mm}
\bookcover@partwidth{\coverwidth}
\bookcover@partheight{\marklength}
- \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@)
- \parbox[t][\bookcover@partheight@][c]{\bookcover@partwidth@}
- {\centering\bookcover@fgfirst@remark\par}
- \end{textblock*}\fi\fi
-%% Marks
-%% mark top
+ \bookcover@remark{\bookcover@fgfirst@abovefront}\fi\fi
+%% {fgfirst}{below front}
+\ifx\bookcover@fgfirst@belowfront\@empty\else\ifdim\marklength>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+ \bookcover@ypos{\marklength+2\bleedwidth+\coverheight}
+ \bookcover@partwidth{\coverwidth}
+ \bookcover@partheight{\marklength}
+ \bookcover@remark{\bookcover@fgfirst@belowfront}\fi\fi
+%% {fgfirst}{above back}
+\ifx\bookcover@fgfirst@aboveback\@empty\else\ifdim\marklength>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@ypos{0mm}
+ \bookcover@partwidth{\coverwidth}
+ \bookcover@partheight{\marklength}
+ \bookcover@remark{\bookcover@fgfirst@aboveback}\fi\fi
+%% {fgfirst}{below back}
+\ifx\bookcover@fgfirst@belowback\@empty\else\ifdim\marklength>0mm
+ \bookcover@xpos{\marklength+\bleedwidth+\flapwidth}
+ \bookcover@ypos{\marklength+2\bleedwidth+\coverheight}
+ \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
@@ -751,7 +986,7 @@ comment=[l][\ttfamily\color{black}]{\%}}
%% mark top 6
\bookcover@xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
\bookcover@vmark
-%% mark bottom
+%% mark bottom parameters
\bookcover@ypos{\paperheight-\marklength}
\bookcover@partwidth{\markthick}
%% mark bottom 1
@@ -774,7 +1009,7 @@ comment=[l][\ttfamily\color{black}]{\%}}
%% mark bottom 6
\bookcover@xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
\bookcover@vmark
-%% mark left
+%% mark left parameters
\bookcover@xpos{0mm}
\bookcover@partwidth{\marklength}
%% mark left 1
@@ -783,7 +1018,7 @@ comment=[l][\ttfamily\color{black}]{\%}}
%% mark left 2
\bookcover@ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
\bookcover@hmark
-%% mark right
+%% mark right parameters
\bookcover@xpos{\paperwidth-\marklength}
\bookcover@partwidth{\marklength}
%% mark right 1
@@ -792,35 +1027,10 @@ comment=[l][\ttfamily\color{black}]{\%}}
%% mark right 2
\bookcover@ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
\bookcover@hmark
-%% Trim
+%% trimming
\ifbookcover@trimmed
- \begin{textblock*}{\paperwidth}(0mm,0mm)
- \begin{tikzpicture}
- \begin{scope}[color=white]
- \fill(0mm,\marklength-2pt)--
- (\paperwidth,\marklength-2pt)--
- (\paperwidth,\marklength+\bleedwidth)--
- (0mm,\marklength+\bleedwidth)--cycle;
- \fill(0mm,\paperheight-\marklength+2pt)--
- (\paperwidth,\paperheight-\marklength+2pt)--
- (\paperwidth,\paperheight-\marklength-\bleedwidth)--
- (0mm,\paperheight-\marklength-\bleedwidth)--cycle;
- \fill(0mm,0mm)--
- (\marklength+\bleedwidth,0mm)--
- (\marklength+\bleedwidth,\paperheight)--
- (0mm,\paperheight)--cycle;
- \fill(\paperwidth-\marklength-\bleedwidth,0mm)--
- (\paperwidth,0mm)--
- (\paperwidth,\paperheight)--
- (\paperwidth-\marklength-\bleedwidth,\paperheight)--cycle;
- \end{scope}
- \draw(\marklength+\bleedwidth,\marklength+\bleedwidth)--
- (\paperwidth-\marklength-\bleedwidth,\marklength+\bleedwidth)--
- (\paperwidth-\marklength-\bleedwidth,\paperheight-\marklength-\bleedwidth)--
- (\marklength+\bleedwidth,\paperheight-\marklength-\bleedwidth)--cycle;
- \end{tikzpicture}
- \end{textblock*}\fi
-%% New book cover
+ \bookcover@trimming\fi
+%% new book cover
\mbox{}
\newpage
\bookcover@reset}