summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/bookcover
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-01-09 22:33:16 +0000
committerKarl Berry <karl@freefriends.org>2018-01-09 22:33:16 +0000
commit88c9b92f240d620d1e1ddda468a6f39e1db563a6 (patch)
tree5ae81b3e6b5fcb39b7014c48d5c35c870131a87a /Master/texmf-dist/source/latex/bookcover
parentca4fc9144d8162c60671c9d1c4e38ac5d90f78ca (diff)
bookcover (9jan18)
git-svn-id: svn://tug.org/texlive/trunk@46261 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/bookcover')
-rw-r--r--Master/texmf-dist/source/latex/bookcover/bookcover.dtx180
1 files changed, 39 insertions, 141 deletions
diff --git a/Master/texmf-dist/source/latex/bookcover/bookcover.dtx b/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
index bb80b817c1e..5750432322a 100644
--- a/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
+++ b/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015-2016 by Tibor Tomacs
+% Copyright (C) 2015- by Tibor Tomacs
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
@@ -17,11 +17,11 @@
% \iffalse
%<*driver>
\ProvidesFile{bookcover.dtx}
-\newcommand{\eifiledate}{2017/04/13}
-\newcommand{\eifilever}{v2.1}
+\newcommand{\eifiledate}{2018/01/09}
+\newcommand{\eifilever}{v2.2}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<class>\ProvidesClass{bookcover}[2017/04/13 v2.1 class for book covers and dust jackets]
+%<class>\ProvidesClass{bookcover}[2018/01/09 v2.2 class for book covers and dust jackets]
%
%<*driver>
\documentclass{ltxdoc}
@@ -157,7 +157,7 @@
%
% \subsection{Loading class}
% The class \texttt{bookcover} requires the services of the class \texttt{article} and the following packages:
-% \texttt{kvoptions}, \texttt{geometry}, \texttt{graphicx}, \texttt{calc}, \texttt{xcolor}, \texttt{ifthen}, \texttt{tikz}, \texttt{eso-pic}, \texttt{textpos}.
+% \texttt{kvoptions}, \texttt{ifxetex}, \texttt{textpos}, \texttt{geometry}, \texttt{graphicx}, \texttt{calc}, \texttt{ifthen}, \texttt{tikz}, \texttt{eso-pic}.
%
% \medskip\noindent
% Load the class as usual, with
@@ -523,28 +523,18 @@
% \lstinputlisting[style=examplefile]{example1.tex}
%
% \subsubsection{A two-sided book cover}
-% \begin{figure}[H]
-% \centering
-% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
-% \fcolorbox{black!50}{white}{\includegraphics[page=1,width=\textwidth-15mm]{example2}}
-% \caption{Outside}\label{fig:twosidedbookcover-outside}
-%
-% \end{figure}
-% \begin{figure}[H]
-% \centering
-% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
+% \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}}
-% \caption{Inside}\label{fig:twosidedbookcover-inside}
-% \end{figure}
+% \end{center}
% \lstinputlisting[style=examplefile]{example2.tex}
%
% \subsubsection{Drawing bar code by pst-barcode package}
-% \begin{figure}[H]
-% \centering
+% \begin{center}
% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-15mm]{figures/barcode}}
-% \caption{}\label{fig:barcode}
-% \end{figure}
+% \end{center}
%
% \begin{examplelst}
% \documentclass{bookcover}
@@ -554,7 +544,7 @@
% \bookcovercomponent{normal}{back}{
% \vfill
% \centering
-% \begin{pspicture}(1in,1.5in)
+% \begin{pspicture}(1.5in,1in)
% \psbarcode{1787-6117}{includetext height=1 width=1.5}{issn}
% \end{pspicture}
% \vspace{5mm}}
@@ -562,7 +552,7 @@
% \end{document}
% \end{examplelst}
%
-% \noindent We can compile this file by \texttt{latex.exe} only. If you want to use another compiler, then choose the following way:
+% \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:
%
% \begin{examplelst}
% \documentclass{bookcover}
@@ -573,7 +563,7 @@
% \usepackage{pst-barcode}
% \pagestyle{empty}
% \begin{document}
-% \begin{pspicture}(1in,1.5in)
+% \begin{pspicture}(1.5in,1in)
% \psbarcode{1787-6117}{includetext height=1 width=1.5}{issn}
% \end{pspicture}
% \end{document}
@@ -602,39 +592,19 @@
% \end{commandlinelst}
% or
% \begin{commandlinelst}
-% xelatex -shell-escape filename
-% \end{commandlinelst}
-% or
-% \begin{commandlinelst}
% lualatex -shell-escape filename
% \end{commandlinelst}
%
-% \noindent where the \texttt{filename} is not \texttt{bar.tex} or \texttt{barcode.tex}. The following code works by \texttt{xelatex.exe} without option \texttt{-shell-escape}:
-%
-% \begin{examplelst}
-% \documentclass{bookcover}
-% \usepackage{pst-barcode}
-% \begin{document}
-% \makeatletter\TP@absposfalse\makeatother
-% \newgeometry{left=0em,top=-1em}
-% \begin{bookcover}
-% \bookcovercomponent{normal}{back}{
-% \vfill
-% \centering
-% \begin{pspicture}(1in,1.5in)
-% \psbarcode{1787-6117}{includetext height=1 width=1.5}{issn}
-% \end{pspicture}
-% \vspace{5mm}}
-% \end{bookcover}
-% \end{document}
-% \end{examplelst}
+% \medskip\noindent where the \texttt{filename} is not \texttt{bar.tex} or \texttt{barcode.tex}.
%
% \section{Old method}
+%
% \begin{info}
-% \color{red}\large\faWarning\ \textbf{Attention!} 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!
+% \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}
+%
% \begin{commandlst}
% \setbookcover{!<main layer>!}{!<part>!}{!<content>!}
% \end{commandlst}
@@ -836,98 +806,9 @@
% \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 examples}
-% \subsubsection{A dust jacket}
+% \subsection{Full example}
% See Figure \ref{fig:dustjacket}.
-% \lstinputlisting[style=examplefile]{example1-oldmethod.tex}
-%
-% \subsubsection{A two-sided book cover}
-% See Figure \ref{fig:twosidedbookcover-outside} and \ref{fig:twosidedbookcover-inside}.
-% \lstinputlisting[style=examplefile]{example2-oldmethod.tex}
-%
-% \subsubsection{Drawing bar code by pst-barcode package}
-%
-% See Figure \ref{fig:barcode}.
-%
-% \begin{examplelst}
-% \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{examplelst}
-%
-% \noindent We can compile this file by \texttt{latex.exe} only. If you want to use another compiler, then choose the following way:
-%
-% \begin{examplelst}
-% \documentclass{bookcover}
-%
-% \usepackage{shellesc,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*}
-%
-% \ShellEscape{
-% 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{examplelst}
-%
-% \noindent The command to compile this file is the following:
-% \begin{commandlinelst}
-% pdflatex -shell-escape filename
-% \end{commandlinelst}
-% or
-% \begin{commandlinelst}
-% xelatex -shell-escape filename
-% \end{commandlinelst}
-% or
-% \begin{commandlinelst}
-% lualatex -shell-escape filename
-% \end{commandlinelst}
-%
-% \noindent where the \texttt{filename} is not \texttt{bar.tex} or \texttt{barcode.tex}. The following code works by \texttt{xelatex.exe} without option \texttt{-shell-escape}:
-%
-% \begin{examplelst}
-% \documentclass{bookcover}
-% \usepackage{pst-barcode}
-% \begin{document}
-% \makeatletter\TP@absposfalse\makeatother
-% \newgeometry{left=0em,top=-1em}
-% \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{examplelst}
+% \lstinputlisting[style=examplefile]{example-oldmethod.tex}
%
% \newpage
% \thispagestyle{empty}
@@ -970,8 +851,13 @@
%% CLASS AND PACKAGES
\LoadClass{article}
-\RequirePackage{geometry,graphicx,calc,xcolor,ifthen,tikz,eso-pic}
+\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}
%% PAGE STYLE
\pagestyle{empty}
@@ -1012,6 +898,18 @@
\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
+
+%% NO PARAGRAPH INDENTATION
\setlength{\parindent}{0pt}
%% INTERNAL LENGTHS SETTING
@@ -1157,7 +1055,7 @@
\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
+ \ifx\@empty#3\else
\csname bookcover@part@param@#2\endcsname
\ifdim\bookcover@partwidth@>0mm
\ifdim\bookcover@partheight@>0mm