summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-11-16 22:13:59 +0000
committerKarl Berry <karl@freefriends.org>2020-11-16 22:13:59 +0000
commit95813d4e6ef2d9f8eb6f26893f2dab04ba89c5a1 (patch)
tree67a9168367fdd4a964a75e202c6d2675cc6e5a46 /Master/texmf-dist/tex
parent0fbc8b32f22c55110abdf479a4995336581bc43a (diff)
bookcover (16nov20)
git-svn-id: svn://tug.org/texlive/trunk@56947 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/bookcover/bookcover.cls30
1 files changed, 22 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/bookcover/bookcover.cls b/Master/texmf-dist/tex/latex/bookcover/bookcover.cls
index a152ad1b50e..855ca6fb87f 100644
--- a/Master/texmf-dist/tex/latex/bookcover/bookcover.cls
+++ b/Master/texmf-dist/tex/latex/bookcover/bookcover.cls
@@ -18,8 +18,8 @@
%% LaTeX version 1999/12/01 or later.
%%
-\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesClass{bookcover}[2020/11/12 v2.4 class for book covers and dust jackets]
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesClass{bookcover}[2020/11/16 v2.5 class for book covers and dust jackets]
%% OPTIONS
@@ -42,12 +42,13 @@
%% CLASS AND PACKAGES
\LoadClass{article}
-\RequirePackage{geometry,graphicx,calc,ifthen,tikz}
+\RequirePackage{geometry,graphicx,calc,ifthen,tikz,environ}
\RequirePackage[nonefgrulers]{fgruler}
%% PAGE STYLE
\pagestyle{empty}
+\def\ps@plain{}
%% NEW IF
@@ -96,10 +97,6 @@
paperwidth=2\marklength+2\bleedwidth+2\coverwidth+2\flapwidth+\spinewidth,
paperheight=2\marklength+2\bleedwidth+\coverheight}
-%% NO PARAGRAPH INDENTATION
-
-\setlength{\parindent}{0pt}
-
%% INTERNAL LENGTHS SETTING
\def\bookcover@xpos#1{\setlength{\bookcover@xpos@}{#1}}
@@ -117,6 +114,18 @@
\let\setpartheight\bookcover@partheight
\let\settrimmedpart\bookcover@tikz@trimmed@part@param
+%% BOOKCOVERDESCGEOMETRY
+
+\def\bookcoverdescgeometry#1{\def\bookcover@descgeometry{#1}}
+\def\bookcover@descgeometry{margin=1in}
+
+%% BOOKCOVERDESCRIPTION
+
+\newenvironment{bookcoverdescription}{%
+ \if@inbookcoverenv\@latexerr{Don't use 'bookcoverdescription' in 'bookcover' environment!}{}\fi}{}
+\AddToHook{env/bookcoverdescription/before}{\expandafter\newgeometry\expandafter{\bookcover@descgeometry}}
+\AddToHook{env/bookcoverdescription/after}{\restoregeometry}
+
%% POSBOX
\newcommand{\bookcover@posbox}[4]{%
@@ -236,6 +245,7 @@
\def\bookcover{%
\@inbookcoverenvtrue%
\newpage%
+ \noindent%
\begin{picture}(\paperwidth,\paperheight)(0,-\paperheight)}
\def\endbookcover{%
@@ -262,6 +272,10 @@
\ifdim\bookcover@partheight@>0mm
\csname bookcover@componenttype@#1\endcsname{#3}\fi\fi\fi}}}
+%% BOOKCOVERELEMENT ENVIRONMENT
+
+\NewEnviron{bookcoverelement}[2]{\bookcovercomponent{#1}{#2}{\BODY}}
+
%% NEW BOOKCOVER PART
\def\newbookcoverpart#1#2{
@@ -311,7 +325,7 @@
%% COMPONENT TYPES
\newbookcovercomponenttype{color}{
- \tikz\fill[#1] (0,0) rectangle (\bookcover@partwidth@,\bookcover@partheight@);}
+ \tikz\fill\expandafter[#1] (0,0) rectangle (\bookcover@partwidth@,\bookcover@partheight@);}
\newbookcovercomponenttype{picture}{
\includegraphics[width=\bookcover@partwidth@,height=\bookcover@partheight@]{#1}}