diff options
author | Karl Berry <karl@freefriends.org> | 2018-01-22 22:48:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-01-22 22:48:08 +0000 |
commit | 362e328e33bb4ae48fbc7be834631952ed6028f8 (patch) | |
tree | 6acd934b85dc6c4e2ec1c7558050d7d6253d604a /Master/texmf-dist/source/latex | |
parent | 01961fc557f91eac6c8b730202c4999c837f2f87 (diff) |
bookcover (22jan18)
git-svn-id: svn://tug.org/texlive/trunk@46410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/bookcover/bookcover.dtx | 624 |
1 files changed, 168 insertions, 456 deletions
diff --git a/Master/texmf-dist/source/latex/bookcover/bookcover.dtx b/Master/texmf-dist/source/latex/bookcover/bookcover.dtx index 5750432322a..304ad059fe5 100644 --- a/Master/texmf-dist/source/latex/bookcover/bookcover.dtx +++ b/Master/texmf-dist/source/latex/bookcover/bookcover.dtx @@ -17,11 +17,11 @@ % \iffalse %<*driver> \ProvidesFile{bookcover.dtx} -\newcommand{\eifiledate}{2018/01/09} -\newcommand{\eifilever}{v2.2} +\newcommand{\eifiledate}{2018/01/21} +\newcommand{\eifilever}{v2.3} %</driver> %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01] -%<class>\ProvidesClass{bookcover}[2018/01/09 v2.2 class for book covers and dust jackets] +%<class>\ProvidesClass{bookcover}[2018/01/21 v2.3 class for book covers and dust jackets] % %<*driver> \documentclass{ltxdoc} @@ -29,9 +29,9 @@ \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \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=teal]{hyperref} +\usepackage[unicode,pdfstartview=FitH,bookmarksnumbered,colorlinks,allcolors=teal]{hyperref} \usepackage[english]{babel} -\usepackage{xcolor,graphicx,listings,calc,multirow,caption,float,array,pdfpages,fontawesome,tcolorbox,tikz} +\usepackage{xcolor,graphicx,listings,calc,multirow,array,pdfpages} \colorlet{command}{blue!80!black} \colorlet{example}{black} @@ -40,20 +40,12 @@ \lstnewenvironment{examplelst}{\lstset{ gobble=2, - belowskip=\bigskipamount, + belowskip=5mm, basicstyle=\color{example}\small\ttfamily, backgroundcolor=\color{black!10}, columns=fullflexible, keepspaces}}{} -\lstnewenvironment{commandlinelst}{\lstset{ - gobble=2, - basicstyle=\small\ttfamily, - belowskip=\medskipamount, - backgroundcolor=\color{white}, - columns=fullflexible, - keepspaces}}{} - \lstnewenvironment{commandlst}{\lstset{ literate={<}{{$\langle$}}1{>}{{$\rangle$}}1, delim=[is][\color{param}\normalfont\itshape\small]{!}{!}, @@ -65,7 +57,7 @@ \lstdefinestyle{examplefile}{ literate={ü}{{\"u}}1{ó}{{\'o}}1{é}{{\'e}}1{á}{{\'a}}1{Á}{{\'A}}1, - belowskip=\bigskipamount, + belowskip=5mm, basicstyle=\color{example}\small\ttfamily, backgroundcolor=\color{black!10}, columns=fullflexible, @@ -83,11 +75,7 @@ \def\meta#1{{\color{param}\normalfont\itshape\small$\langle$#1$\rangle$}} -\usetikzlibrary{shapes} -\def\example{\tikz\draw node[signal,signal from=west,signal to=east,inner sep=2.7pt,left color=command,right color=black,text=white]{\footnotesize\sffamily EXAMPLE};} - -\tcbuselibrary{skins} -\newtcolorbox{info}{enhanced jigsaw,frame style={left color=red,right color=black},colback=white,lifted shadow={1mm}{-2mm}{3mm}{0.1mm}{fill=black!50!white,opacity=0.5}} +\def\example{\colorbox{command}{\footnotesize\sffamily\bfseries\color{white}EXAMPLE}} \def\BookCover{{\def\sfdefault{ugq}\sffamily\bfseries \color{gray}\mbox{}\lower.15ex\hbox{[B}ook% @@ -118,22 +106,15 @@ % \GetFileInfo{bookcover.cls} % % \title{{\Huge\BookCover\\[5mm]} -% Class for book covers and dust jackets\\ +% Class for book covers and dust jackets\\[2mm] % \textsf{bookcover.cls}\\ % {\large\eifilever\ (\eifiledate)}} % \author{Tibor Tómács\\{\normalsize\href{mailto:tomacs.tibor@uni-eszterhazy.hu}{\texttt{tomacs.tibor@uni-eszterhazy.hu}}}} % \date{} % \maketitle % -% \begin{abstract} -% The \texttt{bookcover} document class is provided to assist generating book covers and dust jackets. Using this class, there are two ways you can create the output, namely the \emph{main} and the \emph{old method}. The goal of the \emph{old method} is to be compatible with the earlier versions of the \texttt{bookcover} document class. It is recommended to use the \emph{main method} in the future, because it is much more flexible than the old one. -% \end{abstract} -% -% \tableofcontents -% % \section{Introduction} -% \subsection{Book cover parts} -% In the following picture we can see a typical 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 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} @@ -143,21 +124,13 @@ % \includegraphics{figures/coverscheme} % \end{center} % We get the following result after trimming: -% \begin{figure}[H] -% \centering -% \includegraphics{figures/result} -% \caption{}\label{fig:trimmed} -% \end{figure} -% -% \subsection{Book cover sizes}\label{subsec:sizes} -% We have to give the following sizes to prepare a cover (see the next figure): \texttt{coverwidth}, \texttt{coverheight}, \texttt{spinewidth}, \texttt{flapwidth}, \texttt{marklength}, \texttt{bleedwidth}. % \begin{center} -% \includegraphics{figures/sizes} +% \includegraphics{figures/result} % \end{center} % -% \subsection{Loading class} +% \section{Loading class} % The class \texttt{bookcover} requires the services of the class \texttt{article} and the following packages: -% \texttt{kvoptions}, \texttt{ifxetex}, \texttt{textpos}, \texttt{geometry}, \texttt{graphicx}, \texttt{calc}, \texttt{ifthen}, \texttt{tikz}, \texttt{eso-pic}. +% \texttt{kvoptions}, \texttt{textpos}, \texttt{geometry}, \texttt{graphicx}, \texttt{calc}, \texttt{ifthen}, \texttt{tikz}, \texttt{fgruler}. % % \medskip\noindent % Load the class as usual, with @@ -166,34 +139,34 @@ % \end{commandlst} % % \begin{center} -% \begin{tabular}{@{}llr@{}} +% \begin{tabular}{@{}l@{}l@{\hspace{-13mm}}r@{}} % \textbf{option} & \textbf{description} & \textbf{default value}\\ % \hline -% \commandinline|coverwidth=!<length>!| & See Subsection \ref{subsec:sizes}. & \texttt{170mm}\\ -% \commandinline|coverheight=!<length>!| & See Subsection \ref{subsec:sizes}. & \texttt{240mm}\\ -% \commandinline|spinewidth=!<length>!| & See Subsection \ref{subsec:sizes}. & \texttt{5mm}\\ -% \commandinline|flapwidth=!<length>!| & See Subsection \ref{subsec:sizes}. & \texttt{0mm}\\ -% \commandinline|marklength=!<length>!| & See Subsection \ref{subsec:sizes}. & \texttt{10mm}\\ -% \commandinline|bleedwidth=!<length>!| & See Subsection \ref{subsec:sizes}. & \texttt{5mm}\\ -% \commandinline|markthick=!<length>!| & Thickness of marks. & \texttt{0.4pt}\\ -% \commandinline|markcolor=!<color>!| & Color of marks. & \texttt{red}\\ -% \commandinline|10pt| & Normal font size is 10\,pt (default option).&\\ -% \commandinline|11pt| & Normal font size is 11\,pt.&\\ -% \commandinline|12pt| & Normal font size is 12\,pt.&\\ -% \commandinline|grid| & Grid for checking sizes.&\\ -% \commandinline|trimmed| & It shows trimmed version (see Figure~\ref{fig:trimmed}).&\\ -% \commandinline|bgtikznodes| & For old method (see Subsubsection \ref{subsubsec:bgtikz}).&\\ -% \commandinline|bgtikzclip| & For old method (see Subsubsection \ref{subsubsec:bgtikz}).&\\ +% \commandinline|coverwidth=!<length>!| & \multirow{6}*{\hspace{-1mm}$\left.\hbox{\rule[-11mm]{0pt}{22mm}}\right\}$ See the next figure}& \texttt{170mm}\\ +% \commandinline|coverheight=!<length>!| & & \texttt{240mm}\\ +% \commandinline|spinewidth=!<length>!| & & \texttt{5mm}\\ +% \commandinline|flapwidth=!<length>!| & & \texttt{0mm}\\ +% \commandinline|marklength=!<length>!| & & \texttt{10mm}\\ +% \commandinline|bleedwidth=!<length>!| & & \texttt{5mm}\\ +% \commandinline|markthick=!<length>!| & Thickness of marks & \texttt{0.4pt}\\ +% \commandinline|markcolor=!<color>!| & Color of marks & \texttt{red}\\ +% \commandinline|10pt| & \multirow{3}*{\hspace{-1mm}$\left.\hbox{\rule[-4mm]{0pt}{8mm}}\right\}$ Normal font size (default: \texttt{10pt})}&\\ +% \commandinline|11pt| & &\\ +% \commandinline|12pt| & &\\ +% \commandinline|trimmed| & It shows trimmed version&\texttt{false}\\ % \hline % \end{tabular} % \end{center} +% \begin{center} +% \includegraphics{figures/sizes} +% \end{center} % -% \bigskip\noindent\example +% \noindent\example % \begin{examplelst} % \documentclass[flapwidth=50mm,spinewidth=15mm]{bookcover} % \end{examplelst} % -% \section{Main method}\label{sec:mainmethod} +% \section{Creating book cover}\label{sec:mainmethod} % \subsection{Commands} % Use \commandinline{bookcover} environment to make a new book cover. In this environment, you can create a component of the book cover by the following command: % \begin{commandlst} @@ -202,10 +175,10 @@ % \meta{component type} See Subsection \ref{subsec:componenttypes}. % % \medskip\noindent -% \meta{part} See Subsection \ref{subsec:parts-main-method} or \hyperref[appendix]{Appendix}. +% \meta{part} See Subsection \ref{subsec:parts-main-method} or Section~\ref{sec:illustration-parts}. % % \medskip\noindent -% \meta{content} It depends on the \meta{component type} (see Subsection \ref{subsec:componenttypes}). +% \meta{content} It depends on the \meta{component type}. See Subsection \ref{subsec:componenttypes}. % % \medskip\noindent % Every |\bookcovercomponent| generates a layer on the sheet. The first one generates the bottom layer and the last one generates the top layer. @@ -222,41 +195,38 @@ % \end{bookcover} % \end{examplelst} % -% \subsection{Parts in the main method}\label{subsec:parts-main-method} -% \subsubsection{Base background parts} +% \subsection{Parts}\label{subsec:parts-main-method} +% Important: The background parts are expanded onto the bleed, taking account of slight inaccuracy when trimming! +% \subsubsection{One-piece background parts} % \commandinline{bg back flap}, \commandinline{bg back}, \commandinline{bg spine}, \commandinline{bg front}, \commandinline{bg front flap} % -%\medskip\noindent -% {\color{red}\faWarning} \emph{The background parts include the bleed!} -% -% \paragraph{With flaps} % \begin{center} +% \textbf{With flaps}\\*[0pt] % \includegraphics{figures/bg1} % \end{center} -% \paragraph{Without flaps} % \begin{center} +% \textbf{Without flaps}\\*[0pt] % \includegraphics{figures/bg4} % \end{center} % -% \subsubsection{Base foreground parts} +% \subsubsection{One-piece foreground parts} % \commandinline{back flap}, \commandinline{back}, \commandinline{spine}, \commandinline{front}, \commandinline{front flap}, \commandinline{above back}, \commandinline{above front}, \commandinline{below back}, \commandinline{below front} % -%\medskip\noindent -% {\color{red}\faWarning} \emph{The foreground parts don't include the bleed!} -% -% \paragraph{With flaps} % \begin{center} +% \textbf{With flaps}\\*[0pt] % \includegraphics{figures/foreground1} % \end{center} -% \paragraph{Without flaps} % \begin{center} +% \textbf{Without flaps}\\*[0pt] % \includegraphics{figures/foreground2} % \end{center} % % \subsubsection{Combined parts} -% The following combined parts are defined. You can see them in figures in the \hyperref[appendix]{Appendix}. +% The following combined parts are defined. You can see illustrations in the Section~\ref{sec:illustration-parts}. % \begin{center} -% \begin{tabular}{>{\color{command}\ttfamily}l@{\hspace{20mm}}>{\color{command}\ttfamily}l} +% \begin{tabular}{@{}>{\color{command}\ttfamily}l@{\hspace{1cm}}>{\color{command}\ttfamily}l@{}} +% {\rmfamily\bfseries\textcolor{black}{background}}&{\rmfamily\bfseries\textcolor{black}{foreground}}\\ +% \hline % bg back and flap & back and flap\\ % bg back and spine & back and spine\\ % bg front and spine & front and spine\\ @@ -277,7 +247,10 @@ % \begin{commandlst} % \bookcovercomponent{color}{!<part>!}{!<colors>!} % \end{commandlst} -% \meta{colors} The options of the |\fill| in the \texttt{tikz} package:\\ +% It determines the color of the part. +% +% \medskip\noindent +% \meta{colors} The options of the |\fill| in the \texttt{tikz} package:\label{page:color}\\ % \indent\commandinline{color=!<color name>!} See \meta{color name} in the \texttt{xcolor} package.\\ % \indent\commandinline{top color=!<color name>!}\\ % \indent\commandinline{bottom color=!<color name>!}\\ @@ -287,7 +260,7 @@ % \indent\commandinline{ball color=!<color name>!}\\ % \indent\commandinline{shading angle=!<degree>!} It rotates the shading by the given angle. % -% \bigskip\noindent\example +% \pagebreak\bigskip\noindent\example % \begin{examplelst} % \begin{bookcover} % \bookcovercomponent{color}{bg whole without flaps}{ @@ -308,7 +281,7 @@ % \end{bookcover} % \end{examplelst} % -% \subsubsection[tikz]{Component type: \texttt{tikz}}\label{subsubsec:tikz} +% \subsubsection[tikz]{Component type: \texttt{tikz}} % \begin{commandlst} % \bookcovercomponent{tikz}{!<part>!}{!<tikz code>!} % \end{commandlst} @@ -325,14 +298,12 @@ % \fill[orange] (part.center) circle [radius=8mm];} % \end{bookcover} % \end{examplelst} -% \begin{figure}[H] -% \centering +% \begin{center} % \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt} % \fcolorbox{black!50}{white}{\includegraphics{figures/tikz}} -% \caption{}\label{fig:tikz} -% \end{figure} +% \end{center} % -% \subsubsection[tikz clip]{Component type: \texttt{tikz clip}}\label{subsubsec:tikz} +% \subsubsection[tikz clip]{Component type: \texttt{tikz clip}} % \begin{commandlst} % \bookcovercomponent{tikz clip}{!<part>!}{!<tikz code>!} % \end{commandlst} @@ -349,12 +320,10 @@ % \fill[orange] (part.center) circle [radius=8mm];} % \end{bookcover} % \end{examplelst} -% \begin{figure}[H] -% \centering +% \begin{center} % \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt} % \fcolorbox{black!50}{white}{\includegraphics{figures/tikzclip}} -% \caption{}\label{fig:tikzclip} -% \end{figure} +% \end{center} % % \subsubsection[normal]{Component type: \texttt{normal}} % \begin{commandlst} @@ -393,8 +362,13 @@ % \subsubsection[ruler]{Component type: \texttt{ruler}} % Use the \texttt{ruler} component type to check the sizes of the part. % \begin{commandlst} -% \bookcovercomponent{ruler}{!<part>!}{\setruler{!<coordsys>!}{!<shift x>!}{!<shift y>!}{!<color>!}} +% \bookcovercomponent{ruler}{!<part>!}{\setruler[!<unit>!]{!<coordsys>!}{!<shift x>!}{!<shift y>!}{!<color>!}} % \end{commandlst} +% \meta{unit} The ruler unit:\\ +% \indent\commandinline{cm} Metric ruler (centimeter). Default value.\\ +% \indent\commandinline{in} English ruler (inch). +% +% \medskip\noindent % \meta{coordsys} The type of the coordinate system:\\ % \indent\commandinline{upper left } The origin is the upper left corner of the part.\\ % \indent\commandinline{upper right} The origin is the upper right corner of the part.\\ @@ -407,7 +381,7 @@ % \medskip\noindent % \meta{color} The color of the ruler. % -% \bigskip\noindent\example +% \pagebreak\bigskip\noindent\example % \begin{examplelst} % \begin{bookcover} % \bookcovercomponent{ruler}{back}{\setruler{upper left}{0cm}{0cm}{blue}} @@ -416,23 +390,16 @@ % \bookcovercomponent{ruler}{front}{\setruler{lower right}{2cm}{1cm}{gray}} % \end{bookcover} % \end{examplelst} -% \begin{figure}[H] -% \centering +% \begin{center} % \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt} % \fcolorbox{black!50}{white}{\includegraphics{figures/ruler}} -% \end{figure} +% \end{center} % % \subsection{Defining component type} -% New component types are defined using the command: +% You can define a new component type, redefine or rename a defined component type with the following commands: % \begin{commandlst} % \newbookcovercomponenttype{!<new component type name>!}{!<formatting>!} -% \end{commandlst} -% Component types can be redefined using the command: -% \begin{commandlst} % \renewbookcovercomponenttype{!<defined component type name>!}{!<formatting>!} -% \end{commandlst} -% Component types can be renamed using the command: -% \begin{commandlst} % \newnamebookcovercomponenttype{!<new component type name>!}{!<defined component type name>!} % \end{commandlst} % You can use the following length commands in \meta{formatting}: @@ -460,16 +427,10 @@ % \end{examplelst} % % \subsection{Defining part} -% New parts are defined using the command: +% You can define a new part, redefine or rename a defined part with the following commands: % \begin{commandlst} % \newbookcoverpart{!<new part name>!}{!<setting>!} -% \end{commandlst} -% Parts can be redefined using the command: -% \begin{commandlst} % \renewbookcoverpart{!<defined part name>!}{!<setting>!} -% \end{commandlst} -% Parts can be renamed using the command: -% \begin{commandlst} % \newnamebookcoverpart{!<new part name>!}{!<defined part name>!} % \end{commandlst} % In \meta{setting} you have to set the new part sizes, the coordinates of its upper left corner (the origin is the upper left corner of the printed box), and the parameters of the \texttt{trimmed part} rectangle node in \texttt{tikz} and \texttt{tikz clip} component types. For this purpose, use the following commands: @@ -487,7 +448,7 @@ % % \noindent To give the previous lengths, you can use the following length commands: % -% \bigskip\noindent +% \medskip\noindent % \commandinline{\marklength \bleedwidth \flapwidth \coverwidth \spinewidth \coverheight} % % \bigskip\noindent\example @@ -512,30 +473,31 @@ % \end{document} % \end{examplelst} % -% \subsection{Full examples} -% \subsubsection{A dust jacket} -% \begin{figure}[H] -% \centering -% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt} -% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{example1}} -% \caption{}\label{fig:dustjacket} -% \end{figure} -% \lstinputlisting[style=examplefile]{example1.tex} -% -% \subsubsection{A two-sided book cover} +% \includepdfset{nup=2x5,delta=4mm 4mm,noautoscale,frame} +% \includepdf[pages=1-10,pagecommand={\section{Illustration of the predefined parts}\label{sec:illustration-parts}\subsection{Background parts (cover width flaps)}}]{figures/parts.pdf} +% \includepdf[pages=11-16,pagecommand={}]{figures/parts.pdf} +% \includepdf[pages=36-42,pagecommand={\subsection{Background parts (cover widthout flaps)}}]{figures/parts.pdf} +% \includepdf[pages=17-26,pagecommand={\subsection{Foreground parts (cover width flaps)}}]{figures/parts.pdf} +% \includepdf[pages=27-35,pagecommand={}]{figures/parts.pdf} +% \includepdf[pages=43-52,pagecommand={\subsection{Foreground parts (cover widthout flaps)}}]{figures/parts.pdf} +% +% \newpage\section{Full examples} +% \subsection{A dust jacket} +% \lstinputlisting[style=examplefile]{bookcover-example1.tex} % \begin{center} -% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}% -% \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-15mm]{example2}}\\[2mm] -% \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-15mm]{example2}} +% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt} +% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{bookcover-example1}}\label{page:example1} % \end{center} -% \lstinputlisting[style=examplefile]{example2.tex} % -% \subsubsection{Drawing bar code by pst-barcode package} +% \subsection{A two-sided book cover} +% \lstinputlisting[style=examplefile]{bookcover-example2.tex} % \begin{center} -% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt} -% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-15mm]{figures/barcode}} +% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}% +% \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-.8pt]{bookcover-example2}}\\[5mm] +% \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-.8pt]{bookcover-example2}} % \end{center} % +% \newpage\subsection{Barcode} % \begin{examplelst} % \documentclass{bookcover} % \usepackage{pst-barcode} @@ -552,233 +514,104 @@ % \end{document} % \end{examplelst} % -% \noindent We can compile this file with \texttt{latex.exe} or \texttt{xelatex.exe}. If you want to use another compiler, then choose the following way: -% +% \noindent You can compile this file with \texttt{latex.exe} or \texttt{xelatex.exe}. Using \texttt{pdflatex.exe} or \texttt{lualatex.exe}, write the following code into the preamble: % \begin{examplelst} -% \documentclass{bookcover} -% -% \usepackage{shellesc,filecontents} -% \begin{filecontents*}{bar.tex} -% \documentclass{article} -% \usepackage{pst-barcode} -% \pagestyle{empty} -% \begin{document} -% \begin{pspicture}(1.5in,1in) -% \psbarcode{1787-6117}{includetext height=1 width=1.5}{issn} -% \end{pspicture} -% \end{document} -% \end{filecontents*} -% -% \ShellEscape{ -% latex bar.tex && -% dvips bar.dvi && -% ps2pdf bar.ps && -% pdfcrop -hires bar.pdf barcode.pdf} -% -% \begin{document} -% \begin{bookcover} -% \bookcovercomponent{normal}{back}{ -% \vfill -% \centering -% \includegraphics{barcode} -% \vspace{5mm}} -% \end{bookcover} -% \end{document} +% \usepackage[pdfcrop={-hires}]{auto-pst-pdf} % \end{examplelst} +% In this case, the command to compile this file is the following: % -% \noindent The command to compile this file is the following: -% \begin{commandlinelst} -% pdflatex -shell-escape filename -% \end{commandlinelst} +% \medskip\texttt{pdflatex -shell-escape filename}\\ % or -% \begin{commandlinelst} -% lualatex -shell-escape filename -% \end{commandlinelst} -% -% \medskip\noindent where the \texttt{filename} is not \texttt{bar.tex} or \texttt{barcode.tex}. % -% \section{Old method} +% \texttt{lualatex -shell-escape filename} % -% \begin{info} -% \color{red}\large\faWarning\ The goal of the \emph{old method} is to be compatible with the earlier versions of the \texttt{bookcover} class. It is recommended to use the \hyperref[sec:mainmethod]{\em main method} in the future, because it is much more flexible than the old one! -% \end{info} -% -% \subsection{Commands} +% \bigskip +% \begin{center} +% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt} +% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{figures/barcode}} +% \end{center} % -% \begin{commandlst} -% \setbookcover{!<main layer>!}{!<part>!}{!<content>!} -% \end{commandlst} -% \meta{main layer} See the following subsubsections.\\ -% \indent\commandinline{bgcolor}, \commandinline{bgpic}, \commandinline{bgtikz}, \commandinline{fgfirst}, \commandinline{fgsecond} +% \newpage\section{Obsolete method} % -% \medskip\noindent The \meta{part} and the \meta{content} depend on the \meta{main layer} (see the following subsubsections). +% {\large\bfseries\color{red}The goal of the \emph{obsolete method} is to be compatible with the early versions of the \texttt{bookcover}. It is not recommended to use it in the future, because the method described in the Section~\begin{NoHyper}\ref{sec:mainmethod}\end{NoHyper} is much more flexible!\par} % -% \begin{commandlst} -% \makebookcover -% \end{commandlst} +% \subsection{Commands} % -% \subsubsection{Background colors} +% \textbf{Background colors} % \begin{commandlst} % \setbookcover{bgcolor}{!<background part>!}{!<colors>!} % \end{commandlst} -% \meta{background part} See Subsubsection \ref{subsubsec:background}:\\ -% \indent\commandinline{back}, \commandinline{front}, \commandinline{spine}, \commandinline{front flap}, \commandinline{back flap}, \commandinline{whole without flaps}, \commandinline{whole} -% -% \medskip\noindent -% \meta{colors} The options of the |\fill| in the \texttt{tikz} package:\\ -% \indent\commandinline{color=!<color name>!} See \meta{color name} in the \texttt{xcolor} package.\\ -% \indent\commandinline{top color=!<color name>!}\\ -% \indent\commandinline{bottom color=!<color name>!}\\ -% \indent\commandinline{middle color=!<color name>!}\\ -% \indent\commandinline{inner color=!<color name>!}\\ -% \indent\commandinline{outer color=!<color name>!}\\ -% \indent\commandinline{ball color=!<color name>!}\\ -% \indent\commandinline{shading angle=!<degree>!} It rotates the shading by the given angle. +% See the \meta{background part} in Subsubsection \ref{subsubsec:background} and the \meta{colors} in the page \pageref{page:color}. % -% \bigskip\noindent\example -% \begin{examplelst} -% \setbookcover{bgcolor}{whole without flaps}{ -% top color=white, bottom color=blue!50!black, shading angle=60} -% \end{examplelst} -% -% \subsubsection{Background pictures} +% \bigskip\noindent\textbf{Background pictures} % \begin{commandlst} % \setbookcover{bgpic}{!<background part>!}{!<picture file>!} % \end{commandlst} -% \meta{background part} See Subsubsection \ref{subsubsec:background}:\\ -% \indent\commandinline{back}, \commandinline{front}, \commandinline{spine}, \commandinline{front flap}, \commandinline{back flap}, \commandinline{whole without flaps}, \commandinline{whole} +% See the \meta{background part} in Subsubsection \ref{subsubsec:background}. The picture will be rescaled according to the sizes of the current background part. % -% \medskip\noindent The picture will be rescaled according to the sizes of the current background part. -% -% \bigskip\noindent\example -% \begin{examplelst} -% \setbookcover{bgpic}{front flap}{fig.png} -% \end{examplelst} -% -% \subsubsection{Background Ti\emph{k}Z figures}\label{subsubsec:bgtikz} +% \bigskip\noindent\textbf{Background Ti\emph{k}Z figures} % \begin{commandlst} % \setbookcover{bgtikz}{!<background part>!}{!<tikz code>!} % \end{commandlst} -% \meta{background part} See Subsubsection \ref{subsubsec:background}:\\ -% \indent\commandinline{back}, \commandinline{front}, \commandinline{spine}, \commandinline{front flap}, \commandinline{back flap}, \commandinline{whole without flaps}, \commandinline{whole} -% -% \medskip\noindent -% The Ti\emph{k}Z figure will be placed to the upper left corner of the current background part, without resizing. -% -% \bigskip\noindent\example -% \begin{examplelst} -% \setbookcover{bgtikz}{back}{ -% \fill[blue] (0mm,250mm)--(100mm,250mm)--(100mm,245mm)--(0mm,110mm)--cycle; -% \fill[yellow] (5mm,5mm)--(175mm,245mm)--(175mm,0mm)--(5mm,0mm)--cycle;} -% \end{examplelst} -% -% \medskip\noindent +% See the \meta{background part} in Subsubsection \ref{subsubsec:background}. The Ti\emph{k}Z figure will be placed to the upper left corner of the current background part, without resizing. % Using the option \texttt{bgtikznodes} of the document class: % -% \medskip\noindent % \begin{itemize} % \item the origin moves to the lower left corner of the current background part; % \item two rectangle nodes come into being: \commandinline{part} and \commandinline{trimmed part}. % \end{itemize} % -% \bigskip\noindent\example -% \begin{examplelst} -% \setbookcover{bgtikz}{whole}{ -% \fill[yellow] (part.south west) rectangle (part.north east); -% \fill[gray] (trimmed part.south east) rectangle (trimmed part.north west); -% \draw[green] (0,0) circle [radius=10mm];} -% \setbookcover{bgtikz}{spine}{ -% \fill[orange] (part.center) circle [radius=8mm];} -% \end{examplelst} -% \noindent See Figure~\ref{fig:tikz}. The option \texttt{bgtikzclip} of the document class works the same as \texttt{bgtikznodes}, but it clips the current part. For example, you can see the output of the previous code with option \texttt{bgtikzclip} in Figure~\ref{fig:tikzclip}. +% \noindent The option \texttt{bgtikzclip} of the document class works the same as \texttt{bgtikznodes}, but it clips the current part. % -% \subsubsection{First foreground} +% \bigskip\noindent\textbf{First foreground} % \begin{commandlst} % \setbookcover{fgfirst}{!<foreground part>!}{!<content>!} % \end{commandlst} -% \meta{foreground part} See Subsubsection \ref{subsubsec:foreground}:\\ -% \indent\commandinline{back}, \commandinline{front}, \commandinline{spine}, \commandinline{front flap}, \commandinline{back flap}, \commandinline{above front}, \commandinline{below front}, \commandinline{above back}, \commandinline{below back} -% -% \medskip\noindent The first foreground is the top layer of the book cover (see Subsection \ref{subsec:layers}). +% See the \meta{foreground part} in Subsubsection \ref{subsubsec:foreground}. The first foreground is the top layer of the book cover (see Subsection \ref{subsec:layers}). % -% \bigskip\noindent\example -% \begin{examplelst} -% \setbookcover{fgfirst}{spine}{ -% \vfill -% \begin{center} -% \rotatebox[origin=c]{90}{\bfseries Book title} -% \end{center} -% \vfill} -% \end{examplelst} -% -% \subsubsection{Second foreground} +% \bigskip\noindent\textbf{Second foreground} % \begin{commandlst} % \setbookcover{fgsecond}{!<foreground part>!}{!<content>!} % \end{commandlst} -% \meta{foreground part} See Subsubsection \ref{subsubsec:foreground}:\\ -% \indent\commandinline{back}, \commandinline{front}, \commandinline{spine}, \commandinline{front flap}, \commandinline{back flap} -% -% \medskip\noindent The second foreground is under the first foreground (see Subsection \ref{subsec:layers}). +% See the \meta{foreground part} in Subsubsection \ref{subsubsec:foreground}. The second foreground is under the first foreground (see Subsection \ref{subsec:layers}). % -% \bigskip\noindent\example -% \begin{examplelst} -% \setbookcover{fgsecond}{front}{ -% \vfill -% \begin{center} -% \includegraphics[width=80mm]{pic.png} -% \end{center} -% \vfill} -% \setbookcover{fgfirst}{front}{ -% \vfill -% \begin{center} -% TEXT -% \end{center} -% \vfill} -% \end{examplelst} -% -% \subsubsection{Making book cover} -% \commandinline{\makebookcover} -% -% \medskip\noindent +% \bigskip\noindent\textbf{Making book cover} +% \begin{commandlst} +% \makebookcover +% \end{commandlst} % This command makes the book cover by using the contents of the background and foreground. % -% \subsection{Parts in the old method} -% +% \subsection{Parts in the obsolete method} % \subsubsection{Background parts}\label{subsubsec:background} -% {\color{red}\faWarning} \emph{The background parts include the bleed!} -% -% \paragraph{With flaps} % \begin{center} -% \includegraphics{figures/background1}\\[4mm] -% \includegraphics{figures/background2}\\[4mm] +% \textbf{With flaps}\\*[0pt] +% \includegraphics{figures/background1}\\[2mm] +% \includegraphics{figures/background2}\\[2mm] % \includegraphics{figures/background3} % \end{center} -% \paragraph{Without flaps} % \begin{center} -% \includegraphics{figures/background4}\\[4mm] +% \textbf{Without flaps}\\*[0pt] +% \includegraphics{figures/background4}\\[2mm] % \includegraphics{figures/background5} % \end{center} % % \subsubsection{Foreground parts}\label{subsubsec:foreground} -% {\color{red}\faWarning} \emph{The foreground parts don't include the bleed!} -% -% \paragraph{With flaps} % \begin{center} +% \textbf{With flaps}\\*[0pt] % \includegraphics{figures/foreground1} % \end{center} -% \paragraph{Without flaps} % \begin{center} +% \textbf{Without flaps}\\*[0pt] % \includegraphics{figures/foreground2} % \end{center} +% The other name of \texttt{above front} is \texttt{remark}. % % \subsection{Layers}\label{subsec:layers} % In the following table we can see the hierarchy of the layers: -% -% \bigskip % \begin{center} % \begin{tabular}{@{}ll@{}c@{}} % \cline{1-2} -% \multirow{2}*{|fgfirst|} & |above front|, |below front|, |above back|, |below back|& \color{layer}\emph{top layer}\\ +% \multirow{2}*{|fgfirst|} & |above front|, |below front|, |above back|, |below back|& \color{layer}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$\\ @@ -793,36 +626,14 @@ % \cline{1-2} % & |back|, |front|, |spine|, |front flap|, |back flap| &\color{layer}$\uparrow$\\ % |bgcolor| & |whole without flaps| &\color{layer}$\uparrow$\\ -% & |whole| & \color{layer}\emph{bottom layer}\\ +% & |whole| & \color{layer}bottom layer\\ % \cline{1-2} % \end{tabular} % \end{center} -% \bigskip\noindent For example, in case -% \begin{examplelst} -% \setbookcover{bgpic}{whole}{fig1.jpg} -% \setbookcover{bgpic}{front}{fig2.jpg} -% \setbookcover{fgsecond}{front}{fig3.jpg} -% \setbookcover{fgfirst}{front}{TEXT} -% \end{examplelst} -% \noindent 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}. -% -% \subsection{Full example} -% See Figure \ref{fig:dustjacket}. -% \lstinputlisting[style=examplefile]{example-oldmethod.tex} -% -% \newpage -% \thispagestyle{empty} -% \vspace*{8cm} -% \section*{\centering\Huge Appendix}\label{appendix} -% \addcontentsline{toc}{section}{Appendix} % -% \includepdfset{nup=2x5,delta=4mm 4mm,noautoscale,frame} -% \includepdf[pages=1-10,pagecommand={\section*{\centering Background parts in the main method (width flaps)}\addcontentsline{toc}{subsection}{Background parts in the main method (width flaps)}}]{figures/parts.pdf} -% \includepdf[pages=11-16,pagecommand={\section*{\centering Background parts in the main method (width flaps)}}]{figures/parts.pdf} -% \includepdf[pages=17-26,pagecommand={\section*{\centering Foreground parts in the main method (width flaps)}}]{figures/parts.pdf} -% \includepdf[pages=27-35,pagecommand={\section*{\centering Foreground parts in the main method (width flaps)}}]{figures/parts.pdf} -% \includepdf[pages=36-42,pagecommand={\section*{\centering Background parts in the main method (widthout flaps)}\addcontentsline{toc}{subsection}{Background parts in the main method (widthout flaps)}}]{figures/parts.pdf} -% \includepdf[pages=43-52,pagecommand={\section*{\centering Foreground parts in the main method (widthout flaps)}}]{figures/parts.pdf} +% \subsection{Example} +% See the figure in the page \pageref{page:example1}. +% \lstinputlisting[style=examplefile]{bookcover-example-obsoletemethod.tex} % % \StopEventually{} % @@ -834,7 +645,6 @@ \DeclareVoidOption{10pt}{\PassOptionsToClass{10pt}{article}} \DeclareVoidOption{11pt}{\PassOptionsToClass{11pt}{article}} \DeclareVoidOption{12pt}{\PassOptionsToClass{12pt}{article}} -\DeclareVoidOption{grid}{\PassOptionsToPackage{grid}{eso-pic}} \DeclareStringOption[170mm]{coverwidth} \DeclareStringOption[240mm]{coverheight} \DeclareStringOption[5mm]{spinewidth} @@ -844,20 +654,20 @@ \DeclareStringOption[5mm]{bleedwidth} \DeclareStringOption[red]{markcolor} \DeclareBoolOption[false]{trimmed} -\DeclareBoolOption[false]{bgtikznodes}% for old method -\DeclareBoolOption[false]{bgtikzclip}% for old method +\DeclareBoolOption[false]{bgtikznodes}% for obsolete method +\DeclareBoolOption[false]{bgtikzclip}% for obsolete method \ProcessKeyvalOptions{bookcover} -\ifbookcover@bgtikzclip\bookcover@bgtikznodestrue\fi% for old method +\ifbookcover@bgtikzclip\bookcover@bgtikznodestrue\fi% for obsolete method %% CLASS AND PACKAGES +%% +%% Don't use 'absolute' option of 'textpos'! It causes problems in some cases: +%% xelatex.exe + pst-barcode +%% pdflatex.exe or lualatex.exe + pst-barcode + auto-pst-pdf +%% \LoadClass{article} -\RequirePackage{ifxetex} -\ifxetex -\RequirePackage{textpos} % 'absolute' option with xelatex.exe is not compatible with pst-barcode package (see an example in the document). -\else -\RequirePackage[absolute]{textpos} -\fi -\RequirePackage{geometry,graphicx,calc,ifthen,tikz,eso-pic} +\RequirePackage{textpos,geometry,graphicx,calc,ifthen,tikz} +\RequirePackage[nonefgrulers]{fgruler} %% PAGE STYLE \pagestyle{empty} @@ -883,8 +693,8 @@ \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} +\newlength{\bookcover@rulerwidth@} +\newlength{\bookcover@rulerheight@} \let\partheight\bookcover@partheight@ \let\partwidth\bookcover@partwidth@ @@ -896,18 +706,11 @@ \setlength{\marklength}{\bookcover@marklength} \setlength{\markthick}{\bookcover@markthick} \setlength{\bleedwidth}{\bookcover@bleedwidth} -\setlength{\paperwidth}{2\marklength+2\bleedwidth+2\coverwidth+2\flapwidth+\spinewidth} -\setlength{\paperheight}{2\marklength+2\bleedwidth+\coverheight} - -%% IN CASE XELATEX, MOVE THE POSITION TO THE UPPER LEFT CORNER OF THE PAGE (because of we don't use the 'absolute' option of textpos package) -\ifxetex -\setlength{\hoffset}{-1in} -\setlength{\voffset}{-1in-1em} -\setlength{\oddsidemargin}{0pt} -\setlength{\topmargin}{0pt} -\setlength{\headheight}{0pt} -\setlength{\headsep}{0pt} -\fi + +%% PAGE DIMENSIONS SETTING +\geometry{left=0pt,right=0pt,bottom=0pt,top=-1em, + paperwidth=2\marklength+2\bleedwidth+2\coverwidth+2\flapwidth+\spinewidth, + paperheight=2\marklength+2\bleedwidth+\coverheight} %% NO PARAGRAPH INDENTATION \setlength{\parindent}{0pt} @@ -923,18 +726,13 @@ \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 + \bookcover@tikz@trimmed@part@param{#1}{2\bleedwidth}{#2}{\bleedwidth}}% for obsolete method \let\setpartposx\bookcover@xpos \let\setpartposy\bookcover@ypos \let\setpartwidth\bookcover@partwidth \let\setpartheight\bookcover@partheight \let\settrimmedpart\bookcover@tikz@trimmed@part@param -%% GRID -\ifESO@grid - \setlength{\markthick}{2pt} - \def\bookcover@markcolor{red}\fi - %% MARKS \def\bookcover@vmark{ \begin{textblock*}{\bookcover@partwidth@}(\bookcover@xpos@,\bookcover@ypos@) @@ -1155,110 +953,24 @@ \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}} + \parbox[t][\bookcover@partheight@][t]{\bookcover@partwidth@}{#1}} +\newcommand{\setruler}[5][cm]{% + \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@}}{}} %% BOOKCOVER PARTS \newbookcoverpart{bg back flap}{ @@ -1524,9 +1236,9 @@ \bookcover@xpos{\marklength+\bleedwidth} \bookcover@partwidth{2\coverwidth+2\flapwidth+\spinewidth}} -%%%%%%%%%%%%%%%% -%% OLD METHOD %% -%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%% +%% OBSOLETE METHOD %% +%%%%%%%%%%%%%%%%%%%%% %% MAIN LAYERS \def\bookcover@bgcolor#1{ |