texlive[42494] Master/texmf-dist: bookcover (12nov16)

commits+karl at tug.org commits+karl at tug.org
Sat Nov 12 23:03:47 CET 2016


Revision: 42494
          http://tug.org/svn/texlive?view=revision&revision=42494
Author:   karl
Date:     2016-11-12 23:03:46 +0100 (Sat, 12 Nov 2016)
Log Message:
-----------
bookcover (12nov16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bookcover/README
    trunk/Master/texmf-dist/doc/latex/bookcover/bookcover.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/example1.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/example1.tex
    trunk/Master/texmf-dist/doc/latex/bookcover/example2.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/example2.tex
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/background1.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/background5.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg.jpg
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/cover.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/coverscheme.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/foreground1.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/result.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/sizes.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/summa.pdf
    trunk/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
    trunk/Master/texmf-dist/source/latex/bookcover/bookcover.ins
    trunk/Master/texmf-dist/tex/latex/bookcover/bookcover.cls

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/bookcover/example1-oldmethod.tex
    trunk/Master/texmf-dist/doc/latex/bookcover/example2-oldmethod.tex
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/barcode.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg1.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg4.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/logo.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/newpart.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/parts.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/ruler.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikz.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikzclip.pdf

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/bgtikzclip.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/bgtikznodes.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/ekflogo.pdf
    trunk/Master/texmf-dist/doc/latex/bookcover/figures/example-barcode.pdf

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/README	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/README	2016-11-12 22:03:46 UTC (rev 42494)
@@ -1,4 +1,4 @@
-bookcover class, 2015 by Tibor Tomacs
+bookcover class, 2015-2016 by Tibor Tomacs
 
 Class for book covers and dust jackets
 
@@ -13,7 +13,9 @@
 LaTeX version 1999/12/01 or later.
 
 Install:
- - Run 'latex bookcover.ins' for the cls file.
- - Run twice 'pdflatex bookcover.dtx' to get the documentation.
+ - Run 'latex bookcover.ins' for the bookcover.cls file.
+ - Run 'pdflatex example1.tex' for the example1.pdf
+ - Run 'pdflatex example2.tex' for the example2.pdf
+ - Run three times 'pdflatex bookcover.dtx' to get the documentation (bookcover.pdf).
 
 

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/bookcover.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/bookcover/example1-oldmethod.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/example1-oldmethod.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/example1-oldmethod.tex	2016-11-12 22:03:46 UTC (rev 42494)
@@ -0,0 +1,80 @@
+\documentclass[12pt,spinewidth=25mm,coverwidth=15cm,coverheight=20cm,flapwidth=6cm]{bookcover}
+\usepackage{contour,lipsum}
+\contourlength{1pt}
+\definecolor{lightbrown}{RGB}{176,88,0}
+\colorlet{title}{yellow!60!black}
+\begin{document}
+
+% Black background color on the whole cover
+\setbookcover{bgcolor}{whole}{color=black}
+
+% Brown background picture on the whole cover, without the flaps
+\setbookcover{bgpic}{whole without flaps}{./figures/bg.jpg}
+
+% Vertical light brown transparent trails on the back cover by a tikz code
+\setbookcover{bgtikz}{back}{
+    \fill[opacity=0.3,color=lightbrown] 
+    (0mm,0mm) rectangle (20mm,210mm) (100mm,0mm) rectangle (150mm,210mm);}
+
+% Vertical light brown transparent trails on the front cover by a tikz code
+\setbookcover{bgtikz}{front}{
+    \fill[opacity=0.3,color=lightbrown] 
+    (0mm,0mm) rectangle (50mm,210mm) (130mm,0mm) rectangle (150mm,210mm);}
+
+% Remark
+\setbookcover{fgfirst}{above front}{
+    \color{blue}A DUST JACKET}
+
+% Text on the front cover
+\setbookcover{fgfirst}{front}{
+    \centering
+    \vspace{60mm}
+    \color{title}\sffamily\bfseries
+    \resizebox*{50mm}{8mm}{\contour[120]{black}{Rose Taylor}}
+    \par
+    \vspace{20mm}
+    \resizebox*{90mm}{40mm}{\parbox{35mm}{
+        \centering
+        \contour[120]{black}{PROBABILITY}\\
+        \contour[120]{black}{THEORY}\\}}}
+
+% Picture (cards.png) on the front, behind the title
+\setbookcover{fgsecond}{front}{
+    \vspace{70mm}
+    \centering
+    \includegraphics[width=8cm]{./figures/cards.png}}  
+
+% Text on the spine
+\setbookcover{fgfirst}{spine}{
+    \vfill
+    \centering
+    \rotatebox[origin=c]{90}{\contour[120]{black}{
+        \color{title}\huge\sffamily\bfseries 
+        Rose Taylor -- Probability Theory}}
+    \vfill}
+
+% Text on the back cover
+\setbookcover{fgfirst}{back}{
+    \centering
+    \vspace{20mm}
+    \parbox{110mm}{\color{white}\lipsum[1]}}
+
+% Text and picture (dice.png) on the front flap
+\setbookcover{fgfirst}{front flap}{
+    \centering
+    \vspace{20mm}
+    \parbox{40mm}{\color{white}\lipsum[2]}
+    \vfill
+    \includegraphics[width=30mm]{./figures/dice.png}
+    \vspace{10mm}}
+
+% Text on the back flap
+\setbookcover{fgfirst}{back flap}{
+    \centering
+    \vspace{20mm}
+    \parbox{40mm}{\color{white}\lipsum[2]}}
+
+% Making the dust jucket
+\makebookcover
+
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/example1-oldmethod.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/bookcover/example1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/example1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/example1.tex	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/example1.tex	2016-11-12 22:03:46 UTC (rev 42494)
@@ -1,4 +1,9 @@
-\documentclass[11pt,spinewidth=25mm,coverwidth=150mm,coverheight=200mm,flapwidth=60mm]{bookcover}
+\documentclass[12pt,spinewidth=25mm,coverwidth=15cm,coverheight=20cm,flapwidth=6cm]{bookcover}
+\newbookcovercomponenttype{center rotate}{
+    \parbox[t][\partheight][c]{\partwidth}{
+        \begin{center}
+             \rotatebox[origin=c]{90}{#1}
+        \end{center}}}
 \usepackage{contour,lipsum}
 \contourlength{1pt}
 \definecolor{lightbrown}{RGB}{176,88,0}
@@ -5,61 +10,60 @@
 \colorlet{title}{yellow!60!black}
 \begin{document}
 
+\begin{bookcover}
+
 % Black background color on the whole cover
-\setbookcover{bgcolor}{whole}{color=black}
+\bookcovercomponent{color}{bg whole}{color=black}
 
 % Brown background picture on the whole cover, without the flaps
-\setbookcover{bgpic}{whole without flaps}{./figures/bg.jpg}
+\bookcovercomponent{picture}{bg whole without flaps}{./figures/bg.jpg}
 
 % Vertical light brown transparent trails on the back cover by a tikz code
-\setbookcover{bgtikz}{back}{
+\bookcovercomponent{tikz}{bg back}{
     \fill[opacity=0.3,color=lightbrown] 
     (0mm,0mm) rectangle (20mm,210mm) (100mm,0mm) rectangle (150mm,210mm);}
-    
+
 % Vertical light brown transparent trails on the front cover by a tikz code
-\setbookcover{bgtikz}{front}{
+\bookcovercomponent{tikz}{bg front}{
     \fill[opacity=0.3,color=lightbrown] 
     (0mm,0mm) rectangle (50mm,210mm) (130mm,0mm) rectangle (150mm,210mm);}
-    
+
 % Remark 
-\setbookcover{fgfirst}{above front}{\bfseries\color{blue}SAMPLE DUST JACKET}
-    
+\bookcovercomponent{center}{above front}{
+    \color{blue}A DUST JACKET}
+
+% Picture (cards.png) on the front, behind the title
+\bookcovercomponent{normal}{front}{
+    \vspace{70mm}
+    \centering
+    \includegraphics[width=8cm]{./figures/cards.png}}  
+
 % Text on the front cover
-\setbookcover{fgfirst}{front}{
+\bookcovercomponent{normal}{front}{
     \centering
     \vspace{60mm}
     \color{title}\sffamily\bfseries
     \resizebox*{50mm}{8mm}{\contour[120]{black}{Rose Taylor}}
-    \par
-    \vspace{20mm}
+    \par\vspace{20mm}
     \resizebox*{90mm}{40mm}{\parbox{35mm}{
         \centering
         \contour[120]{black}{PROBABILITY}\\
         \contour[120]{black}{THEORY}\\}}}
-        
-% Picture (cards.png) on the front, behind the title
-\setbookcover{fgsecond}{front}{
-    \vspace{70mm}
-    \centering
-    \includegraphics[width=8cm]{./figures/cards.png}}  
 
 % Text on the spine
-\setbookcover{fgfirst}{spine}{
-    \vfill
-    \centering
-    \rotatebox[origin=c]{90}{\contour[120]{black}{
+\bookcovercomponent{center rotate}{spine}{
+    \contour[120]{black}{
         \color{title}\huge\sffamily\bfseries 
         Rose Taylor -- Probability Theory}}
-    \vfill}
-    
+
 % Text on the back cover
-\setbookcover{fgfirst}{back}{
+\bookcovercomponent{normal}{back}{
     \centering
     \vspace{20mm}
     \parbox{110mm}{\color{white}\lipsum[1]}}
-        
+
 % Text and picture (dice.png) on the front flap
-\setbookcover{fgfirst}{front flap}{
+\bookcovercomponent{normal}{front flap}{
     \centering
     \vspace{20mm}
     \parbox{40mm}{\color{white}\lipsum[2]}
@@ -66,14 +70,13 @@
     \vfill
     \includegraphics[width=30mm]{./figures/dice.png}
     \vspace{10mm}}
-    
+
 % Text on the back flap
-\setbookcover{fgfirst}{back flap}{
+\bookcovercomponent{normal}{back flap}{
     \centering
     \vspace{20mm}
     \parbox{40mm}{\color{white}\lipsum[2]}}
 
-% Making the dust jucket
-\makebookcover
+\end{bookcover}
 
 \end{document} 
\ No newline at end of file

Added: trunk/Master/texmf-dist/doc/latex/bookcover/example2-oldmethod.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/example2-oldmethod.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/example2-oldmethod.tex	2016-11-12 22:03:46 UTC (rev 42494)
@@ -0,0 +1,95 @@
+\documentclass[markcolor=black,spinewidth=15mm,bgtikznodes]{bookcover}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[english]{babel}
+\usepackage{url}
+\definecolor{amiyellow}{cmyk}{0,0,.5,0}
+\begin{document}
+
+% The outside of the book cover 
+
+% Yellow triangle on the back cover by tikz code
+\setbookcover{bgtikz}{back}{
+    \fill[color=amiyellow](.5,.5)--(17.5,24.5)--(17.5,0)--(.5,0)--cycle;}
+
+% Yellow triangle on the front cover by tikz code
+\setbookcover{bgtikz}{front}{
+    \fill[color=amiyellow](0,0)--(0,24.5)--(17,.5)--(17,0)--cycle;}
+
+% Yellow background color on the spine
+\setbookcover{bgcolor}{spine}{color=amiyellow}
+
+% Remark
+\setbookcover{fgfirst}{above front}{
+    \color{red}\textsc{Annales Mathematicae et Informaticae} book cover -- outside}
+
+% Text on the spine
+\setbookcover{fgfirst}{spine}{
+    \vfill
+    \centering
+    \rotatebox[origin=c]{90}{
+        \footnotesize\bfseries 
+        ANNALES MATHEMATICAE ET INFORMATICAE 43.\ (2014)}
+    \vfill}
+
+% Text and pictures (summa.pdf, ekflogo.pdf) on the front cover
+\setbookcover{fgfirst}{front}{
+    \vspace{30.5mm}
+    \centering
+    {\huge\bfseries ANNALES\\ MATHEMATICAE ET\\ INFORMATICAE\\[13mm]}
+    {\large\bfseries TOMUS 43.\ (2014)}\\[10mm]
+    \includegraphics{./figures/summa.pdf}\\[5mm]
+    {\large COMMISSIO REDACTORIUM}\\[3mm]
+    \parbox{123mm}{
+        \centering
+        Sándor Bácsó (Debrecen), Sonja Gorjanc (Zagreb), Tibor Gyimóthy (Szeged),\\
+        Miklós Hoffmann (Eger), József Holovács (Eger), László Kovács (Miskolc),\\
+        László Kozma (Budapest), Kálmán Liptai (Eger), Florian Luca (Mexico),\\
+        Giuseppe Mastroianni (Potenza), Ferenc Mátyás (Eger),\\
+        Ákos Pintér (Debrecen), Miklós Rontó (Miskolc), László Szalay (Sopron),\\
+        János Sztrik (Debrecen), Gary Walsh (Ottawa)\par}
+    \vfill
+    \includegraphics[height=20mm]{./figures/logo.pdf}
+    \vfill
+    {\large\bfseries HUNGARIA, EGER}
+    \vfill}
+
+% Making the outside book cover 
+\makebookcover
+
+% The inside of the book cover 
+
+% Remark
+\setbookcover{fgfirst}{above front}{
+    \color{red}\textsc{Annales Mathematicae et Informaticae} book cover -- inside}
+
+% Text on the front cover (it is back of the inside book cover!)
+\setbookcover{fgfirst}{front}{
+    \vspace{27mm}
+    \begin{center}
+        \bfseries
+        ANNALES MATHEMATICAE ET INFORMATICAE\\[3mm]
+        International journal for mathematics and computer science\\[3mm]
+        Referred by\\
+        Zentralblatt für Mathematik\\
+        and\\
+        Mathematical Reviews\\
+    \end{center}
+    \bigskip
+    \begin{center}
+        \parbox{126mm}{
+            The journal of the Institute of Mathematics and Informatics of 
+            Eszterházy Károly University is open for scientific publications 
+            in mathematics and computer science, where the field of number 
+            theory, group theory, constructive and computer aided geometry 
+            as well as theoretical and practical aspects of programming 
+            languages receive particular emphasis. Methodological papers 
+            are also welcome. Papers submitted to the journal should be 
+            written in English. Only new and unpublished material can be
+            accepted.}
+    \end{center}}
+
+% Making the inside book cover 
+\makebookcover
+
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/example2-oldmethod.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/bookcover/example2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/example2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/example2.tex	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/example2.tex	2016-11-12 22:03:46 UTC (rev 42494)
@@ -1,4 +1,4 @@
-\documentclass[markcolor=black,spinewidth=15mm,bgtikznodes]{bookcover}
+\documentclass[markcolor=black,spinewidth=15mm]{bookcover}
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
 \usepackage[english]{babel}
@@ -6,36 +6,31 @@
 \definecolor{amiyellow}{cmyk}{0,0,.5,0}
 \begin{document}
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % The outside of the book cover 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{bookcover}
 
 % Yellow triangle on the back cover by tikz code
-\setbookcover{bgtikz}{back}{
+\bookcovercomponent{tikz}{bg back}{
     \fill[color=amiyellow](.5,.5)--(17.5,24.5)--(17.5,0)--(.5,0)--cycle;}
-    
+
 % Yellow triangle on the front cover by tikz code
-\setbookcover{bgtikz}{front}{
+\bookcovercomponent{tikz}{bg front}{
     \fill[color=amiyellow](0,0)--(0,24.5)--(17,.5)--(17,0)--cycle;}
 
 % Yellow background color on the spine
-\setbookcover{bgcolor}{spine}{color=amiyellow}
+\bookcovercomponent{color}{bg spine}{color=amiyellow}
 
 % Remark
-\setbookcover{fgfirst}{above front}{
+\bookcovercomponent{center}{above front}{
     \color{red}\textsc{Annales Mathematicae et Informaticae} book cover -- outside}
 
 % Text on the spine
-\setbookcover{fgfirst}{spine}{
-    \vfill
-    \centering
-    \rotatebox[origin=c]{90}{
-        \footnotesize\bfseries 
-        ANNALES MATHEMATICAE ET INFORMATICAE 43.\ (2014)}
-    \vfill}
-    
+\bookcovercomponent{center}{spine}{
+    \rotatebox[origin=c]{90}{\footnotesize\bfseries 
+        ANNALES MATHEMATICAE ET INFORMATICAE 43.\ (2014)}}
+
 % Text and pictures (summa.pdf, ekflogo.pdf) on the front cover
-\setbookcover{fgfirst}{front}{
+\bookcovercomponent{normal}{front}{
     \vspace{30.5mm}
     \centering
     {\huge\bfseries ANNALES\\ MATHEMATICAE ET\\ INFORMATICAE\\[13mm]}
@@ -51,24 +46,22 @@
         Ákos Pintér (Debrecen), Miklós Rontó (Miskolc), László Szalay (Sopron),\\
         János Sztrik (Debrecen), Gary Walsh (Ottawa)\par}
     \vfill
-    \includegraphics[height=20mm]{./figures/ekflogo.pdf}
+    \includegraphics[height=20mm]{./figures/logo.pdf}
     \vfill
     {\large\bfseries HUNGARIA, EGER}
     \vfill}
-    
-% Making the outside book cover 
-\makebookcover
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end{bookcover}
+
 % The inside of the book cover 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{bookcover}
 
 % Remark
-\setbookcover{fgfirst}{above front}{
+\bookcovercomponent{center}{above front}{
     \color{red}\textsc{Annales Mathematicae et Informaticae} book cover -- inside}
 
 % Text on the front cover (it is back of the inside book cover!)
-\setbookcover{fgfirst}{front}{
+\bookcovercomponent{normal}{front}{
     \vspace{27mm}
     \begin{center}
         \bfseries
@@ -83,7 +76,7 @@
     \begin{center}
         \parbox{126mm}{
             The journal of the Institute of Mathematics and Informatics of 
-            Eszterházy Károly College is open for scientific publications 
+            Eszterházy Károly University is open for scientific publications 
             in mathematics and computer science, where the field of number 
             theory, group theory, constructive and computer aided geometry 
             as well as theoretical and practical aspects of programming 
@@ -93,7 +86,6 @@
             accepted.}
     \end{center}}
 
-% Making the inside book cover 
-\makebookcover
+\end{bookcover}
 
 \end{document} 
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/background1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/background5.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/barcode.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/barcode.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/barcode.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/barcode.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/barcode.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg.jpg
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg1.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg1.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg1.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg1.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg1.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg4.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg4.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg4.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg4.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bg4.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bgtikzclip.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/bookcover/figures/bgtikznodes.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/cover.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/coverscheme.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/bookcover/figures/ekflogo.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/bookcover/figures/example-barcode.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/foreground1.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/logo.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/logo.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/logo.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/logo.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/logo.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/newpart.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/newpart.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/newpart.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/newpart.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/newpart.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/parts.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/parts.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/parts.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/parts.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/parts.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/result.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/ruler.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/ruler.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/ruler.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/ruler.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/ruler.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/sizes.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bookcover/figures/summa.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikz.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikz.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikz.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikz.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikz.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikzclip.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikzclip.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikzclip.pdf	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikzclip.pdf	2016-11-12 22:03:46 UTC (rev 42494)

Property changes on: trunk/Master/texmf-dist/doc/latex/bookcover/figures/tikzclip.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/bookcover/bookcover.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bookcover/bookcover.dtx	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/source/latex/bookcover/bookcover.dtx	2016-11-12 22:03:46 UTC (rev 42494)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2015 by Tibor Tomacs
+% Copyright (C) 2015-2016 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}{2016/06/08}
-\newcommand{\eifilever}{v1.1.1}
+\newcommand{\eifiledate}{2016/11/12}
+\newcommand{\eifilever}{v2.0}
 %</driver>
 %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<class>\ProvidesClass{bookcover}[2016/06/08 v1.1.1 class for book covers and dust jackets]
+%<class>\ProvidesClass{bookcover}[2016/11/12 v2.0 class for book covers and dust jackets]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -28,18 +28,70 @@
 \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=blue]{hyperref}
+\usepackage[unicode,pdfstartview=FitH,bookmarksnumbered,pdfborder={0 0 0},colorlinks,linktocpage,allcolors=teal]{hyperref}
 \usepackage[english]{babel}
-\usepackage{xcolor,graphicx,listings,calc,multirow}
-\lstset{
-literate={ü}{{\"u}}1{ó}{{\'o}}1{é}{{\'e}}1{á}{{\'a}}1{Á}{{\'A}}1,
-basicstyle=\color{example}\small\ttfamily,
-columns=fullflexible,
-comment=[l][\ttfamily\color{black}]{\%}}
-\colorlet{newcommand}{red!50!black}
-\colorlet{example}{blue!50!black}
-\colorlet{layer}{green!50!black}
+\usepackage{xcolor,graphicx,listings,calc,multirow,caption,float,array,pdfpages,fontawesome,tcolorbox,tikz}
 
+\colorlet{command}{blue!80!black}
+\colorlet{example}{black}
+\colorlet{layer}{purple}
+\colorlet{param}{green!50!black}
+
+\lstnewenvironment{examplelst}{\lstset{
+    gobble=2,
+    belowskip=\bigskipamount,
+    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]{!}{!},
+    gobble=2,
+    basicstyle=\color{command}\ttfamily,
+    backgroundcolor=\color{white},
+    columns=fullflexible,
+    keepspaces}}{}
+
+\lstdefinestyle{examplefile}{
+    literate={ü}{{\"u}}1{ó}{{\'o}}1{é}{{\'e}}1{á}{{\'a}}1{Á}{{\'A}}1,
+    belowskip=\bigskipamount,
+    basicstyle=\color{example}\small\ttfamily,
+    backgroundcolor=\color{black!10},
+    columns=fullflexible,
+    keepspaces,
+    comment=[l][\ttfamily\color{black!50}]{\%}}
+
+\newcommand{\commandinline}{\lstinline[
+    literate={<}{{$\langle$}}1{>}{{$\rangle$}}1,
+    delim={[is][\color{param}\normalfont\itshape\small]{!}{!}},
+    basicstyle=\color{command}\ttfamily,
+    columns=fullflexible,
+    keepspaces]}
+
+\flushbottom
+
+\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\BookCover{{\def\sfdefault{ugq}\sffamily\bfseries
+    \color{gray}\mbox{}\lower.15ex\hbox{[B}ook%
+    \color{orange}\lower.15ex\hbox{C}over\lower.15ex\hbox{]}}}
+
 \begin{document}
     \DocInput{./bookcover.dtx}
 \end{document}
@@ -46,7 +98,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{1406}
+% \CheckSum{2556}
 %
 % \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
@@ -66,268 +118,690 @@
 %
 % \GetFileInfo{bookcover.cls}
 %
-% \title{Class for book covers and dust jackets\\
+% \title{{\Huge\BookCover\\[5mm]}
+%        Class for book covers and dust jackets\\
 %        \textsf{bookcover.cls}\\
 %        {\large\eifilever\ (\eifiledate)}}
-% \author{Tibor Tómács\\{\normalsize\href{mailto:tomacs at ektf.hu}{\texttt{tomacs at ektf.hu}}}}
+% \author{Tibor Tómács\\{\normalsize\href{mailto:tomacs.tibor at uni-eszterhazy.hu}{\texttt{tomacs.tibor at 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{Book cover parts and sizes}
+% \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. 
 % 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[height=40mm]{figures/cover}
+% \includegraphics{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.
+% 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 green area in the next figure). The background will be expanded onto the bleed, taking account of slight inaccuracy when trimming.
 % \begin{center}
 % \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{Sizes}\label{subsec:sizes}
-% We have to give the following sizes to prepare a cover: \texttt{coverwidth}, \texttt{coverheight}, \texttt{spinewidth}, \texttt{flapwidth}, \texttt{marklength}, \texttt{bleedwidth}.
+% \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}
 % \end{center}
 %
-% \subsection{Trimmed version}\label{subsec:trimmed}
-% After trimming we get the following result:
+% \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}.
+%
+% \medskip\noindent
+% Load the class as usual, with
+% \begin{commandlst}
+% \documentclass[!<options>!]{bookcover}
+% \end{commandlst}
+%
 % \begin{center}
-% \includegraphics{figures/result}
+% \begin{tabular}{@{}llr@{}}
+% \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}).&\\
+% \hline
+% \end{tabular}
 % \end{center}
 %
-% \subsection{Background parts}\label{subsec:background}
-% Important: The bleed is a part of the background!
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \documentclass[flapwidth=50mm,spinewidth=15mm]{bookcover}
+% \end{examplelst}
 %
+% \section{Main method}\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}
+% \bookcovercomponent{!<component type>!}{!<part>!}{!<content>!}
+% \end{commandlst}
+% \meta{component type} See Subsection \ref{subsec:componenttypes}.
+%
 % \medskip\noindent
-% In case |flapwidth>0mm| 
+% \meta{part} See Subsection \ref{subsec:parts-main-method} or \hyperref[appendix]{Appendix}.
+%
+% \medskip\noindent
+% \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.
+%
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \begin{bookcover}
+%     \bookcovercomponent{color}{bg whole}{color=blue}
+%     \bookcovercomponent{normal}{front}{
+%         \vspace{5cm}
+%         \begin{center}
+%             \bfseries\huge Book title
+%         \end{center}}
+% \end{bookcover}
+% \end{examplelst}
+%
+% \subsection{Parts in the main method}\label{subsec:parts-main-method}
+% \subsubsection{Base 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 contain the bleed!}
+%
+% \paragraph{With flaps}
 % \begin{center}
-% \includegraphics{figures/background1}\\[4mm]
-% \includegraphics{figures/background2}\\[4mm]
-% \includegraphics{figures/background3}
+% \includegraphics{figures/bg1}
 % \end{center}
-% In case |flapwidth=0mm| 
+% \paragraph{Without flaps}
 % \begin{center}
-% \includegraphics{figures/background4}\\[4mm]
-% \includegraphics{figures/background5}
+% \includegraphics{figures/bg4}
 % \end{center}
 %
-% \subsection{Foreground parts}\label{subsec:foreground}
-% Important: The bleed is not part of the foreground!
+% \subsubsection{Base 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
-% In case |flapwidth>0mm| 
+%\medskip\noindent
+% {\color{red}\faWarning} \emph{The foreground parts don't contain the bleed!}
+%
+% \paragraph{With flaps}
 % \begin{center}
 % \includegraphics{figures/foreground1}
 % \end{center}
-% In case |flapwidth=0mm| 
+% \paragraph{Without flaps}
 % \begin{center}
 % \includegraphics{figures/foreground2}
 % \end{center}
 %
-% \section{Description}
+% \subsubsection{Combined parts}
+% The following combined parts are defined. You can see them in figures in the \hyperref[appendix]{Appendix}.
+% \begin{center}
+% \begin{tabular}{>{\color{command}\ttfamily}l@{\hspace{20mm}}>{\color{command}\ttfamily}l}
+% bg back and flap            & back and flap\\
+% bg back and spine           & back and spine\\
+% bg front and spine          & front and spine\\
+% bg front and flap           & front and flap\\
+% bg back and flap and spine  & back and flap and spine\\
+% bg front and flap and spine & front and flap and spine\\
+% bg whole without front flap & whole without front flap\\
+% bg whole without back flap  & whole without back flap\\
+% bg whole without flaps      & whole without flaps\\
+% bg whole                    & whole\\
+% whole page                  &
+% \end{tabular}
+% \end{center}
 %
-% \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}.
+% \subsection{Component types}\label{subsec:componenttypes}
+% The following component types are defined: \commandinline{color}, \commandinline{picture}, \commandinline{tikz}, \commandinline{tikz clip}, \commandinline{normal}, \commandinline{center}, \commandinline{ruler}.
+% \subsubsection[color]{Component type: \texttt{color}}
+% \begin{commandlst}
+% \bookcovercomponent{color}{!<part>!}{!<colors>!}
+% \end{commandlst}
+% \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.
 %
-% \bigskip\noindent
-% Load the class as usual, with
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \begin{bookcover}
+%     \bookcovercomponent{color}{bg whole without flaps}{
+%         top color=white, bottom color=blue!50!black, shading angle=60}
+% \end{bookcover}
+% \end{examplelst}
 %
+% \subsubsection[picture]{Component type: \texttt{picture}}
+% \begin{commandlst}
+% \bookcovercomponent{picture}{!<part>!}{!<picture file>!}
+% \end{commandlst}
+% The picture will be rescaled according to the sizes of the \meta{part}.
+%
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \begin{bookcover}
+%     \bookcovercomponent{picture}{bg front flap}{fig.png}
+% \end{bookcover}
+% \end{examplelst}
+%
+% \subsubsection[tikz]{Component type: \texttt{tikz}}\label{subsubsec:tikz}
+% \begin{commandlst}
+% \bookcovercomponent{tikz}{!<part>!}{!<tikz code>!}
+% \end{commandlst}
+% The origin of the Ti\emph{k}Z figure is the lower left corner of the \meta{part}. Two rectangle nodes come into being: \commandinline{part} and \commandinline{trimmed part}. (Thank Zunbeltz Izaola for the idea.)
+%
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \begin{bookcover}
+% \bookcovercomponent{tikz}{bg 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];}
+% \bookcovercomponent{tikz}{bg spine}{
+%     \fill[orange] (part.center) circle [radius=8mm];}
+% \end{bookcover}
+% \end{examplelst}
+% \begin{figure}[H]
+% \centering
+% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
+% \fcolorbox{black!50}{white}{\includegraphics{figures/tikz}}
+% \caption{}\label{fig:tikz}
+% \end{figure}
+%
+% \subsubsection[tikz clip]{Component type: \texttt{tikz clip}}\label{subsubsec:tikz}
+% \begin{commandlst}
+% \bookcovercomponent{tikz clip}{!<part>!}{!<tikz code>!}
+% \end{commandlst}
+% It works the same as the \texttt{tikz} component type, but it clips the \meta{part}.
+%
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \begin{bookcover}
+% \bookcovercomponent{tikz clip}{bg 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];}
+% \bookcovercomponent{tikz clip}{bg spine}{
+%     \fill[orange] (part.center) circle [radius=8mm];}
+% \end{bookcover}
+% \end{examplelst}
+% \begin{figure}[H]
+% \centering
+% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
+% \fcolorbox{black!50}{white}{\includegraphics{figures/tikzclip}}
+% \caption{}\label{fig:tikzclip}
+% \end{figure}
+%
+% \subsubsection[normal]{Component type: \texttt{normal}}
+% \begin{commandlst}
+% \bookcovercomponent{normal}{!<part>!}{!<content>!}
+% \end{commandlst}
+% In this case, the \meta{content} is not specific. You can choose it as text or picture etc.
+%
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \begin{bookcover}
+%     \bookcovercomponent{normal}{front}{
+%         \vspace{5cm}
+%         \begin{center}
+%             {\bfseries\huge Book title}\\[5mm]
+%             \includegraphics[width=6cm]{fig.png}
+%         \end{center}}
+% \end{bookcover}
+% \end{examplelst}
+%
+% \subsubsection[center]{Component type: \texttt{center}}
+% \begin{commandlst}
+% \bookcovercomponent{center}{!<part>!}{!<content>!}
+% \end{commandlst}
+% It works the same as the \texttt{normal} component type, but the position of the content is the center of the part (horizontally and vertically).
+%
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \begin{bookcover}
+%     \bookcovercomponent{center}{above front}{
+%         \color{blue}Remark above front}
+%     \bookcovercomponent{center}{spine}{
+%         \rotatebox[origin=c]{90}{\bfseries\Large Book title}}
+% \end{bookcover}
+% \end{examplelst}
+%
+% \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>!}}
+% \end{commandlst}
+% \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.\\
+% \indent\commandinline{lower left } The origin is the lower left corner of the part.\\
+% \indent\commandinline{lower right} The origin is the lower right corner of the part.
+%
 % \medskip\noindent
-% {\color{newcommand}|\documentclass|\oarg{options}|{bookcover}|}
+% \meta{shift x},\meta{shift y} Moving the origin of the ruler to the vector (\meta{shift x},\meta{shift y}).
 %
-% \begin{center}
-% \begin{tabular}{@{}l@{\hspace*{-30mm}}r@{}} 
-% \textbf{book cover size options} (see Subsection \ref{subsec:sizes}) & \textbf{default values}\\ 
-% \hline  
-% \texttt{coverwidth=}\meta{length}  & \texttt{170mm}\\ 
-% \texttt{coverheight=}\meta{length} & \texttt{240mm}\\
-% \texttt{spinewidth=}\meta{length}  &   \texttt{5mm}\\
-% \texttt{flapwidth=}\meta{length}   &   \texttt{0mm}\\
-% \texttt{marklength=}\meta{length}  &  \texttt{10mm}\\
-% \texttt{bleedwidth=}\meta{length}  &   \texttt{5mm}\\
-% &\\
-% \textbf{other options}&\\ 
-% \hline  
-% \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:}
-%\color{example}
-%\begin{verbatim}
-%\documentclass[flapwidth=50mm,spinewidth=15mm]{bookcover}
-%\end{verbatim}
-%\color{black}
+% \medskip\noindent
+% \meta{color} The color of the ruler.
 %
-% \subsection{Commands}
-% This class defines two commands: 
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \begin{bookcover}
+%    \bookcovercomponent{ruler}{back}{\setruler{upper left}{0cm}{0cm}{blue}}
+%    \bookcovercomponent{ruler}{back}{\setruler{upper left}{2cm}{1cm}{black}}
+%    \bookcovercomponent{ruler}{front}{\setruler{lower right}{0cm}{0cm}{green}}
+%    \bookcovercomponent{ruler}{front}{\setruler{lower right}{2cm}{1cm}{gray}}
+% \end{bookcover}
+% \end{examplelst}
+% \begin{figure}[H]
+% \centering
+% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
+% \fcolorbox{black!50}{white}{\includegraphics{figures/ruler}}
+% \end{figure}
 %
+% \subsection{Defining component type}
+% New component types are defined using the command:
+% \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}:
+%
 % \medskip\noindent
-% {\color{newcommand}|\setbookcover|\marg{main layer}\marg{part}\marg{content}}
+% \commandinline{\partwidth  } Width of the part.\\
+% \commandinline{\partheight } Height of the part.
 %
-% \medskip\noindent 
-% \meta{main layer} (see the following subsubsections)\\ 
-% \hspace*{10mm}\texttt{bgcolor}, \texttt{bgpic}, \texttt{bgtikz}, \texttt{fgfirst}, \texttt{fgsecond}
+% \bigskip\noindent
+% You have to referrence the content as \verb|#1|. 
 %
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \documentclass[spinewidth=1cm]{bookcover}
+% \newbookcovercomponenttype{center rotate}{
+%     \parbox[t][\partheight][c]{\partwidth}{
+%         \begin{center}
+%             \rotatebox[origin=c]{90}{#1}
+%         \end{center}}}
+% \begin{document}
+% \begin{bookcover}
+%      \bookcovercomponent{center rotate}{spine}{Author -- Book title}
+% \end{bookcover}
+% \end{document}
+% \end{examplelst}
+%
+% \subsection{Defining part}
+% New parts are defined using the command:
+% \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:
+% \begin{commandlst}
+% \setpartposx{!<coord x>!}
+% \setpartposy{!<coord y>!}
+% \setpartwidth{!<width>!}
+% \setpartheight{!<height>!}
+% \settrimmedpart{!<width minus>!}{!<height minus>!}{!<shift x>!}{!<shift y>!}
+% \end{commandlst}
+%
+%\begin{center}
+%\includegraphics{./figures/newpart}
+%\end{center}
+%
+% \noindent To give the previous lengths, you can use the following length commands:
+%
+% \bigskip\noindent
+% \commandinline{\marklength \bleedwidth \flapwidth \coverwidth \spinewidth \coverheight}
+%
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \documentclass[flapwidth=3cm]{bookcover}
+% \newbookcoverpart{bg half front}{
+%     \setpartposx{\marklength+\bleedwidth+\flapwidth+\spinewidth+1.5\coverwidth}
+%     \setpartposy{\marklength}
+%     \setpartheight{\coverheight+2\bleedwidth}
+%     \ifdim\flapwidth>0mm
+%         \setpartwidth{.5\coverwidth}
+%         \settrimmedpart{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+%     \else
+%         \setpartwidth{.5\coverwidth+\bleedwidth}
+%         \settrimmedpart{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+% \begin{document}
+% \begin{bookcover}
+% \bookcovercomponent{tikz}{bg half front}{
+%     \fill[blue] (part.south west) rectangle (part.north east);
+%     \fill[green] (trimmed part.south west) rectangle (trimmed part.north east);}
+% \end{bookcover}
+% \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}
+% \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}
+% \fcolorbox{black!50}{white}{\includegraphics[page=2,width=\textwidth-15mm]{example2}}
+% \caption{Inside}\label{fig:twosidedbookcover-inside}
+% \end{figure}
+% \lstinputlisting[style=examplefile]{example2.tex}
+%
+% \subsubsection{Drawing bar code by pst-barcode package}
+% \begin{figure}[H]
+% \centering
+% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
+% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-15mm]{figures/barcode}}
+% \caption{}\label{fig:barcode}
+% \end{figure}
+%
+% \begin{examplelst}
+% \documentclass{bookcover}
+% \usepackage{pst-barcode}
+% \begin{document}
+% \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}
+%
+% \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}
+% \begin{bookcover}
+%     \bookcovercomponent{normal}{back}{
+%         \vfill
+%         \centering
+%         \includegraphics{barcode}
+%         \vspace{5mm}}
+% \end{bookcover}
+% \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 at 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}
+%
+% \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!
+% \end{info}
+%
+% \subsection{Commands}
+% \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}
+%
 % \medskip\noindent The \meta{part} and the \meta{content} depend on the \meta{main layer} (see the following subsubsections).
 %
-% \medskip\noindent 
-% {\color{newcommand}|\makebookcover|}
+% \begin{commandlst}
+% \makebookcover
+% \end{commandlst}
 %
 % \subsubsection{Background colors}
-% {\color{newcommand}|\setbookcover{bgcolor}|\marg{background part}\marg{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{background part} (see Subsection \ref{subsec:background})\\ 
-% \hspace*{10mm}\texttt{back}, \texttt{front}, \texttt{spine}, \texttt{front flap}, \texttt{back flap}, \texttt{whole without flaps}, \texttt{whole}
+% \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.
 %
-% \medskip\noindent 
-% \meta{colors} (options of command |\fill| of package \texttt{tikz})\\ 
-% \hspace*{10mm}|color=|\meta{color name} (See \meta{color name} in the package \texttt{xcolor}.)\\ 
-% \hspace*{10mm}|top color=|\meta{color name}\\ 
-% \hspace*{10mm}|bottom color=|\meta{color name}\\ 
-% \hspace*{10mm}|middle color=|\meta{color name}\\ 
-% \hspace*{10mm}|inner color=|\meta{color name}\\ 
-% \hspace*{10mm}|outer color=|\meta{color name}\\ 
-% \hspace*{10mm}|ball color=|\meta{color name}\\ 
-% \hspace*{10mm}|shading angle=|\meta{degrees} (This rotates the shading by the given angle.)
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \setbookcover{bgcolor}{whole without flaps}{
+%     top color=white, bottom color=blue!50!black, shading angle=60}
+% \end{examplelst}
 %
-% \bigskip\noindent\emph{Example:}
-%\color{example}
-%\begin{verbatim}
-%\setbookcover{bgcolor}{whole without flaps}{
-%    top color=white, bottom color=blue!50!black, shading angle=60}
-%\end{verbatim}
-%\color{black}
-%
 % \subsubsection{Background pictures}
-% {\color{newcommand}|\setbookcover{bgpic}|\marg{background part}\marg{picture file}}
+% \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}
 %
-% \medskip\noindent 
-% \meta{background part} (see Subsection \ref{subsec:background})\\ 
-% \hspace*{10mm}\texttt{back}, \texttt{front}, \texttt{spine}, \texttt{front flap}, \texttt{back flap}, \texttt{whole without flaps}, \texttt{whole}
-%
 % \medskip\noindent The picture will be rescaled according to the sizes of the current background part.
 %
-% \bigskip\noindent\emph{Example:}
-%\color{example}
-%\begin{verbatim}
-%\setbookcover{bgpic}{front flap}{fig.png}
-%\end{verbatim}
-%\color{black}
+% \bigskip\noindent\example
+% \begin{examplelst}
+% \setbookcover{bgpic}{front flap}{fig.png}
+% \end{examplelst}
 %
 % \subsubsection{Background Ti\emph{k}Z figures}\label{subsubsec:bgtikz}
-% {\color{newcommand}|\setbookcover{bgtikz}|\marg{background part}\marg{tikz code}}
+% \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 
-% \meta{background part} (see Subsection \ref{subsec:background})\\ 
-% \hspace*{10mm}\texttt{back}, \texttt{front}, \texttt{spine}, \texttt{front flap}, \texttt{back flap}, \texttt{whole without flaps}, \texttt{whole}
-%
 % \medskip\noindent
-% The Ti\emph{k}Z figure will be placed to the upper left corner of the current background part, without resizeing.
+% The Ti\emph{k}Z figure will be placed to the upper left corner of the current background part, without resizing.
 %
-% \bigskip\noindent\emph{Example:}
-%\color{example}
-%\begin{verbatim}
-%\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{verbatim}
-%\color{black}
+% \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
 % 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 nodes come into being: \texttt{\color{newcommand}current part} and \texttt{\color{newcommand}current trimmed part}. (Thank Zunbeltz Izaola for the idea.)
+% \item two rectangle nodes come into being: \commandinline{part} and \commandinline{trimmed part}.
 % \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 output of the previous code with option \texttt{bgtikzclip}:
-% \begin{center}
-% \includegraphics{figures/bgtikzclip}
-% \end{center}
+% \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}.
 %
 % \subsubsection{First foreground}
-% {\color{newcommand}|\setbookcover{fgfirst}|\marg{foreground part}\marg{content}}
+% \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 
-% \meta{foreground part} (see Subsection \ref{subsec:foreground})\\ 
-% \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}).
 %
-% \bigskip\noindent\emph{Example:}
-%\color{example}
-%\begin{verbatim}
-%\setbookcover{fgfirst}{spine}{
-%    \vfill
-%    \begin{center}
-%        \rotatebox[origin=c]{90}{\bfseries Annales Mathematicae et Informaticae}
-%    \end{center}
-%    \vfill}
-%\end{verbatim}
-%\color{black}
+% \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}
-% {\color{newcommand}|\setbookcover{fgsecond}|\marg{foreground part}\marg{content}}
+% \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 
-% \meta{foreground part} (see Subsection \ref{subsec:foreground})\\ 
-% \hspace*{10mm}\texttt{back}, \texttt{front}, \texttt{spine}, \texttt{front flap}, \texttt{back flap}
-%
 % \medskip\noindent The second foreground is under the first foreground (see Subsection \ref{subsec:layers}).
 %
-% \bigskip\noindent\emph{Example:} 
-% The following code puts a picture behind the `TEXT' on the front cover:
-%\color{example}
-%\begin{verbatim}
-%\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{verbatim}
-%\color{black}
+% \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}
-% {\color{newcommand}|\makebookcover|}
+% \commandinline{\makebookcover} 
 %
-% \medskip\noindent 
-% This command makes the book cover by using contents of background and foreground. 
+% \medskip\noindent
+% This command makes the book cover by using the contents of the background and foreground. 
 %
+% \subsection{Parts in the old method}
+%
+% \subsubsection{Background parts}\label{subsubsec:background}
+% {\color{red}\faWarning} \emph{The background parts contain the bleed!}
+%
+% \paragraph{With flaps} 
+% \begin{center}
+% \includegraphics{figures/background1}\\[4mm]
+% \includegraphics{figures/background2}\\[4mm]
+% \includegraphics{figures/background3}
+% \end{center}
+% \paragraph{Without flaps} 
+% \begin{center}
+% \includegraphics{figures/background4}\\[4mm]
+% \includegraphics{figures/background5}
+% \end{center}
+%
+% \subsubsection{Foreground parts}\label{subsubsec:foreground}
+% {\color{red}\faWarning} \emph{The foreground parts don't contain the bleed!}
+%
+% \paragraph{With flaps} 
+% \begin{center}
+% \includegraphics{figures/foreground1}
+% \end{center}
+% \paragraph{Without flaps} 
+% \begin{center}
+% \includegraphics{figures/foreground2}
+% \end{center}
+%
 % \subsection{Layers}\label{subsec:layers}
 % In the following table we can see the hierarchy of the layers:
 %
@@ -355,132 +829,124 @@
 % \end{tabular} 
 % \end{center}
 % \bigskip\noindent For example, in case
-%\color{example}
-%\begin{verbatim}
-%\setbookcover{bgpic}{whole}{fig1.jpg}
-%\setbookcover{bgpic}{front}{fig2.jpg}
-%\setbookcover{fgsecond}{front}{fig3.jpg}
-%\setbookcover{fgfirst}{front}{TEXT}
-%\end{verbatim}
-%\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}.
+% \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}.
 %
-% \section{Examples}
-% \subsection{A dust jacket}
-% \lstinputlisting{example1.tex}
-% \subsection*{The output:}
-% \begin{center}
-% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
-% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{example1}}
-% \end{center}
+% \subsection{Full examples}
+% \subsubsection{A dust jacket}
+% See Figure \ref{fig:dustjacket}.
+% \lstinputlisting[style=examplefile]{example1-oldmethod.tex}
 %
-% \subsection{A two-sided book cover}
-% The outside and the inside are edited in the same document.
-% \lstinputlisting{example2.tex}
-% \subsection*{The output:}
-% \begin{center}
-% \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}
+% \subsubsection{A two-sided book cover}
+% See Figure \ref{fig:twosidedbookcover-outside} and \ref{fig:twosidedbookcover-inside}.
+% \lstinputlisting[style=examplefile]{example2-oldmethod.tex}
 %
-% \subsection{Drawing bar code by pst-barcode package}
+% \subsubsection{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}}
+% 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:
 %
-%{\color{example}
-%\begin{verbatim}
-%\documentclass{bookcover}
+% \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}
 %
-%\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}
+% \begin{commandlinelst}
+%      pdflatex -shell-escape filename
+% \end{commandlinelst}
 % or
-%\begin{verbatim}
-%     xelatex -shell-escape filename
-%\end{verbatim}
+% \begin{commandlinelst}
+%      xelatex -shell-escape filename
+% \end{commandlinelst}
 % or
-%\begin{verbatim}
-%     lualatex -shell-escape filename
-%\end{verbatim}
+% \begin{commandlinelst}
+%      lualatex -shell-escape filename
+% \end{commandlinelst}
 %
-% \noindent The following code works by \texttt{xelatex.exe} without option \texttt{-shell-escape}:
+% \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}:
 %
-%{\color{example}
-%\begin{verbatim}
-%\documentclass{bookcover}
-%\usepackage{pst-barcode}
-%\begin{document}
-%\makeatletter\TP at 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{verbatim}}
+% \begin{examplelst}
+% \documentclass{bookcover}
+% \usepackage{pst-barcode}
+% \begin{document}
+% \makeatletter\TP at 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}
 %
-% \subsection*{The output:}
-% \begin{center}
-% \setlength{\fboxsep}{0pt}\setlength{\fboxrule}{.4pt}
-% \fcolorbox{black!50}{white}{\includegraphics[width=\textwidth-.8pt]{figures/example-barcode}}
-% \end{center}
+% \newpage
+% \thispagestyle{empty}
+% \vspace*{8cm}
+% \section*{\centering\Huge 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)}\label{appendix}\addcontentsline{toc}{subsection}{Parts in the main method}}]{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)}}]{figures/parts.pdf}
+% \includepdf[pages=43-52,pagecommand={\section*{\centering Foreground parts in the main method (widthout flaps)}}]{figures/parts.pdf}
+%
 % \StopEventually{}
 %
-% \section{Implementation}
+% \section*{\centering Implementation}\addcontentsline{toc}{subsection}{Implementation}
 % 
 %    \begin{macrocode}
 %%
@@ -500,18 +966,22 @@
 \DeclareStringOption[5mm]{bleedwidth}
 \DeclareStringOption[red]{markcolor}
 \DeclareBoolOption[false]{trimmed}
-\DeclareBoolOption[false]{bgtikznodes}
-\DeclareBoolOption[false]{bgtikzclip}
+\DeclareBoolOption[false]{bgtikznodes}% for old method
+\DeclareBoolOption[false]{bgtikzclip}% for old method
 \ProcessKeyvalOptions{bookcover}
+\ifbookcover at bgtikzclip\bookcover at bgtikznodestrue\fi% for old method
 
-%% LOADING CLASS AND PACKAGES
+%% CLASS AND PACKAGES
 \LoadClass{article}
 \RequirePackage{geometry,graphicx,calc,xcolor,ifthen,tikz,eso-pic}
 \RequirePackage[absolute]{textpos}
 
-%% PAGE STYLE IS EMPTY
+%% PAGE STYLE
 \pagestyle{empty}
 
+%% NEW IF
+\newif\if at inbookcoverenv
+
 %% USER LENGTHS
 \newlength{\coverwidth}
 \newlength{\coverheight}
@@ -526,8 +996,14 @@
 \newlength{\bookcover at ypos@}
 \newlength{\bookcover at partwidth@}
 \newlength{\bookcover at partheight@}
-\newlength{\bookcover at bgtikz@trimmed at part@width at minus}
-\newlength{\bookcover at bgtikz@trimmed at part@push at right}
+\newlength{\bookcover at tikz@trimmed at part@width at minus}
+\newlength{\bookcover at tikz@trimmed at part@height at minus}
+\newlength{\bookcover at tikz@trimmed at part@push at right}
+\newlength{\bookcover at tikz@trimmed at part@push at up}
+\newlength{\bookcover at ruler@xshift}
+\newlength{\bookcover at ruler@yshift}
+\let\partheight\bookcover at partheight@
+\let\partwidth\bookcover at partwidth@
 
 %% USER LENGTHS SETTING
 \setlength{\coverwidth}{\bookcover at coverwidth}
@@ -541,76 +1017,87 @@
 \setlength{\paperheight}{2\marklength+2\bleedwidth+\coverheight}
 \setlength{\parindent}{0pt}
 
-%% GRID
-\ifESO at grid
-    \setlength{\markthick}{2pt}
-    \def\bookcover at markcolor{red}\fi
-
-%% COMMANDS FOR INTERNAL LENGTHS SETTING
+%% INTERNAL LENGTHS SETTING
 \def\bookcover at xpos#1{\setlength{\bookcover at xpos@}{#1}}
 \def\bookcover at ypos#1{\setlength{\bookcover at ypos@}{#1}}
 \def\bookcover at partwidth#1{\setlength{\bookcover at partwidth@}{#1}}
 \def\bookcover at partheight#1{\setlength{\bookcover at partheight@}{#1}}
-\def\bookcover at bgtikz@trimmed at part@param#1#2{%
-    \setlength{\bookcover at bgtikz@trimmed at part@width at minus}{#1}%
-    \setlength{\bookcover at bgtikz@trimmed at part@push at right}{#2}}
+\def\bookcover at tikz@trimmed at part@param#1#2#3#4{%
+    \setlength{\bookcover at tikz@trimmed at part@width at minus}{#1}%
+    \setlength{\bookcover at tikz@trimmed at part@height at minus}{#2}
+    \setlength{\bookcover at tikz@trimmed at part@push at right}{#3}
+    \setlength{\bookcover at tikz@trimmed at part@push at up}{#4}}
+\def\bookcover at bgtikz@trimmed at part@param#1#2{
+    \bookcover at tikz@trimmed at part@param{#1}{2\bleedwidth}{#2}{\bleedwidth}}% for old method
+\let\setpartposx\bookcover at xpos
+\let\setpartposy\bookcover at ypos
+\let\setpartwidth\bookcover at partwidth
+\let\setpartheight\bookcover at partheight
+\let\settrimmedpart\bookcover at tikz@trimmed at part@param
 
-%% MACROS FOR OUTPUTS OF PARTS
-%% bgcolor
-\def\bookcover at bgcolor#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \tikz\expandafter\fill#1 (0,0) rectangle (\bookcover at partwidth@,\bookcover at partheight@);
-    \end{textblock*}}
-%% bgpic
-\def\bookcover at bgpic#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \includegraphics[width=\bookcover at partwidth@,height=\bookcover at partheight@]{#1}
-    \end{textblock*}}
-%% bgtikz
-\def\bookcover at bgtikz#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \ifbookcover at bgtikzclip\bookcover at bgtikznodestrue\fi
-        \ifbookcover at bgtikznodes
-            \begin{tikzpicture}[overlay,yshift=-\bookcover at partheight@]
-            \begin{scope}[transparent,line width=0pt]
-                \pgfset{minimum width=\bookcover at partwidth@,minimum height=\bookcover at partheight@}
-                \pgfnode{rectangle}{south west}{}{current part}{\pgfusepath{draw}}
-                \pgfset{minimum width=\bookcover at partwidth@-\bookcover at bgtikz@trimmed at part@width at minus,
-                        minimum height=\bookcover at partheight@-2\bleedwidth}
-                \pgftransformshift{\pgfpoint{\bookcover at bgtikz@trimmed at part@push at right}{\bleedwidth}}
-                \pgfnode{rectangle}{south west}{}{current trimmed part}{\pgfusepath{draw}}
-            \end{scope}
-            \ifbookcover at bgtikzclip
-                \clip (current part.south west) rectangle (current part.north east);\fi
-        \else\begin{tikzpicture}\fi
-            #1
-        \end{tikzpicture}
-    \end{textblock*}}
-%% fg
-\def\bookcover at fg#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \parbox[t][\bookcover at partheight@][t]{\bookcover at partwidth@}{#1}
-    \end{textblock*}}
-%% remark
-\def\bookcover at remark#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \parbox[t][\bookcover at partheight@][c]{\bookcover at partwidth@}
-            {\centering#1\par}
-    \end{textblock*}}
+%% GRID
+\ifESO at grid
+    \setlength{\markthick}{2pt}
+    \def\bookcover at markcolor{red}\fi
 
-%% MACROS FOR MARKS
-%% vertical mark
+%% MARKS
 \def\bookcover at vmark{
     \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
         {\color{\bookcover at markcolor}\rule[0pt]{\markthick}{\marklength}}
     \end{textblock*}}
-%% horizontal mark
+
 \def\bookcover at hmark{
     \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
         {\color{\bookcover at markcolor}\rule[0pt]{\marklength}{\markthick}}
     \end{textblock*}}
 
-%% MACRO FOR TRIMMING
+\def\bookcover at marks{
+    \bookcover at ypos{0mm}
+    \bookcover at partwidth{\markthick}
+    \bookcover at xpos{\marklength+\bleedwidth-.5\markthick}
+    \bookcover at vmark
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
+        \bookcover at vmark\fi
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
+    \bookcover at vmark
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
+    \bookcover at vmark
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
+        \bookcover at vmark\fi
+    \bookcover at xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
+    \bookcover at vmark
+    \bookcover at ypos{\paperheight-\marklength}
+    \bookcover at partwidth{\markthick}
+    \bookcover at xpos{\marklength+\bleedwidth-.5\markthick}
+    \bookcover at vmark
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
+        \bookcover at vmark\fi
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
+    \bookcover at vmark
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
+    \bookcover at vmark
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
+        \bookcover at vmark\fi
+    \bookcover at xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
+    \bookcover at vmark
+    \bookcover at xpos{0mm}
+    \bookcover at partwidth{\marklength}
+    \bookcover at ypos{\marklength+\bleedwidth-.5\markthick}
+    \bookcover at hmark
+    \bookcover at ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
+    \bookcover at hmark
+    \bookcover at xpos{\paperwidth-\marklength}
+    \bookcover at partwidth{\marklength}
+    \bookcover at ypos{\marklength+\bleedwidth-.5\markthick}
+    \bookcover at hmark
+    \bookcover at ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
+    \bookcover at hmark}
+
+%% TRIMMING
 \def\bookcover at trimming{
     \begin{textblock*}{\paperwidth}(0mm,0mm)
         \begin{tikzpicture}
@@ -662,6 +1149,533 @@
     \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
     \bookcover at vmark}
 
+%% BOOKCOVER COMPONENT
+\long\def\bookcovercomponent#1#2#3{
+    \if at inbookcoverenv\else
+        \@latexerr{\string\bookcovercomponent\space is not in 'bookcover' environment.}{}\fi
+    \bookcover at xpos{0pt}
+    \bookcover at ypos{0pt}
+    \bookcover at partwidth{0pt}
+    \bookcover at partheight{0pt}
+    \bookcover at tikz@trimmed at part@param{0pt}{0pt}{0pt}{0pt}
+    \@ifundefined{bookcover at part@param@#2}{\@latexerr{Part '#2' undefined.}{}}{
+        \@ifundefined{bookcover at componenttype@#1}{\@latexerr{Component type '#1' undefined.}{}}{
+            \ifx#3\@empty\else
+                \csname bookcover at part@param@#2\endcsname
+                \ifdim\bookcover at partwidth@>0mm
+                    \ifdim\bookcover at partheight@>0mm
+                        \csname bookcover at componenttype@#1\endcsname{#3}\fi\fi\fi}}}
+
+%% BOOKCOVER ENVIRONMENT
+\def\bookcover{\@inbookcoverenvtrue}
+\def\endbookcover{
+    \bookcover at marks
+    \ifbookcover at trimmed\bookcover at trimming\fi
+    \mbox{}\newpage\@inbookcoverenvfalse}
+
+%% NEW BOOKCOVER PART
+\def\newbookcoverpart#1#2{
+    \@ifundefined{bookcover at part@param@#1}{
+        \expandafter\def\csname bookcover at part@param@#1\endcsname{#2}}
+    {\@latexerr{Part '#1' already defined.}{}}}
+
+%% RENEW BOOKCOVER PART
+\def\renewbookcoverpart#1#2{
+    \@ifundefined{bookcover at part@param@#1}{\@latexerr{Part '#1' undefined.}{}}{
+        \expandafter\def\csname bookcover at part@param@#1\endcsname{#2}}}
+
+%% NEW NAME BOOKCOVER PART
+\def\newnamebookcoverpart#1#2{
+    \@ifundefined{bookcover at part@param@#1}{
+        \@ifundefined{bookcover at part@param@#2}{\@latexerr{Part '#2' undefined.}{}}{
+            \expandafter\def\csname bookcover at part@param@#1\endcsname{%
+                \csname bookcover at part@param@#2\endcsname}}}
+    {\@latexerr{Part '#1' already defined.}{}}}
+
+%% NEW BOOKCOVER COMPONENT TYPE
+\def\newbookcovercomponenttype#1#2{
+    \@ifundefined{bookcover at componenttype@#1}{
+        \long\expandafter\def\csname bookcover at componenttype@#1\endcsname##1{
+        \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        #2
+        \end{textblock*}}}
+    {\@latexerr{Component type '#1' already defined.}{}}}
+
+%% RENEW BOOKCOVER COMPONENT TYPE
+\def\renewbookcovercomponenttype#1#2{
+    \@ifundefined{bookcover at componenttype@#1}{\@latex at error{Component type '#1' undefined.}{}}{
+        \long\expandafter\def\csname bookcover at componenttype@#1\endcsname##1{
+        \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        #2
+        \end{textblock*}}}}
+
+%% NEW NAME BOOKCOVER COMPONENT TYPE
+\def\newnamebookcovercomponenttype#1#2{
+    \@ifundefined{bookcover at componenttype@#1}{
+        \@ifundefined{bookcover at componenttype@#2}{\@latexerr{Component type '#2' undefined.}{}}{
+            \expandafter\def\csname bookcover at componenttype@#1\endcsname{%
+                \csname bookcover at componenttype@#2\endcsname}}}
+    {\@latexerr{Component type '#1' already defined.}{}}}
+
+%% COMPONENT TYPES
+\newbookcovercomponenttype{color}{
+    \tikz\fill[#1] (0,0) rectangle (\bookcover at partwidth@,\bookcover at partheight@);}
+
+\newbookcovercomponenttype{picture}{
+    \includegraphics[width=\bookcover at partwidth@,height=\bookcover at partheight@]{#1}}
+
+\newbookcovercomponenttype{tikz}{
+    \begin{tikzpicture}[overlay,yshift=-\bookcover at partheight@]
+    \begin{scope}[transparent,line width=0pt]
+        \pgfset{minimum width=\bookcover at partwidth@,minimum height=\bookcover at partheight@}
+        \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}}
+        \pgfset{minimum width=\bookcover at partwidth@-\bookcover at tikz@trimmed at part@width at minus,
+                minimum height=\bookcover at partheight@-\bookcover at tikz@trimmed at part@height at minus}
+        \pgftransformshift{\pgfpoint{\bookcover at tikz@trimmed at part@push at right}
+                                    {\bookcover at tikz@trimmed at part@push at up}}
+        \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}}
+    \end{scope}
+    #1
+    \end{tikzpicture}}
+
+\newbookcovercomponenttype{tikz clip}{
+    \begin{tikzpicture}[overlay,yshift=-\bookcover at partheight@]
+    \begin{scope}[transparent,line width=0pt]
+        \pgfset{minimum width=\bookcover at partwidth@,minimum height=\bookcover at partheight@}
+        \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}}
+        \pgfset{minimum width=\bookcover at partwidth@-\bookcover at tikz@trimmed at part@width at minus,
+                minimum height=\bookcover at partheight@-\bookcover at tikz@trimmed at part@height at minus}
+        \pgftransformshift{\pgfpoint{\bookcover at tikz@trimmed at part@push at right}
+                                    {\bookcover at tikz@trimmed at part@push at up}}
+        \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}}
+    \end{scope}
+    \clip (part.south west) rectangle (part.north east);
+    #1
+    \end{tikzpicture}}
+
+\newbookcovercomponenttype{normal}{
+    \parbox[t][\bookcover at partheight@][t]{\bookcover at partwidth@}{#1}}
+
+\newbookcovercomponenttype{center}{
+    \parbox[t][\bookcover at partheight@][c]{\bookcover at partwidth@}{\begin{center}#1\end{center}}}
+
+\newbookcovercomponenttype{ruler}{
+    \begin{tikzpicture}[overlay,x=1mm,y=1mm,inner sep=0pt,outer sep=3pt,yshift=-\bookcover at partheight@]
+    #1
+    \pgfmathsetmacro\xmax{round(.351459804*(\bookcover at partwidth@-\bookcover at ruler@xshift))}
+    \pgfmathsetmacro\xnummax{round(.0351459804*(\bookcover at partwidth@-\bookcover at ruler@xshift))}
+    \pgfmathsetmacro\ymax{round(.351459804*(\bookcover at partheight@-\bookcover at ruler@yshift))}
+    \pgfmathsetmacro\ynummax{round(.0351459804*(\bookcover at partheight@-\bookcover at ruler@yshift))}
+    \ifthenelse{\equal{\bookcover at ruler@coordsys}{lower left}}{
+        \begin{scope}[xshift=\bookcover at ruler@xshift,yshift=\bookcover at 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 at ruler@coordsys}{lower right}}{
+        \begin{scope}[xshift=-\bookcover at ruler@xshift,yshift=\bookcover at ruler@yshift]
+        \foreach \num in {0,1,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,0)--++(0,1);
+        \foreach \num in {0,5,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,0)--++(0,1.5);
+        \foreach \num in {0,10,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,0)--++(0,2);
+        \foreach \num in {1,2,...,\xnummax}
+        \node[anchor=south] at (\bookcover at partwidth@-10*\num mm,2)
+            {\sffamily\scriptsize\num};
+        \foreach \num in {0,1,...,\ymax}
+        \draw (\bookcover at partwidth@,\num)--++(-1,0);
+        \foreach \num in {0,5,...,\ymax}
+        \draw (\bookcover at partwidth@,\num)--++(-1.5,0);
+        \foreach \num in {0,10,...,\ymax}
+        \draw (\bookcover at partwidth@,\num)--++(-2,0);
+        \foreach \num in {1,2,...,\ynummax}
+        \node[anchor=east] at (\bookcover at partwidth@-2mm,10*\num)
+            {\sffamily\scriptsize\num};
+        \node[anchor=south] at (\bookcover at partwidth@-5mm,2)
+            {\sffamily\scriptsize cm};
+        \end{scope}}{}
+    \ifthenelse{\equal{\bookcover at ruler@coordsys}{upper left}}{
+        \begin{scope}[xshift=\bookcover at ruler@xshift,yshift=-\bookcover at ruler@yshift]
+        \foreach \num in {0,1,...,\xmax}
+        \draw (\num,\bookcover at partheight@)--++(0,-1);
+        \foreach \num in {0,5,...,\xmax}
+        \draw (\num,\bookcover at partheight@)--++(0,-1.5);
+        \foreach \num in {0,10,...,\xmax}
+        \draw (\num,\bookcover at partheight@)--++(0,-2);
+        \foreach \num in {1,2,...,\xnummax}
+        \node[anchor=north] at (10*\num,\bookcover at partheight@-2mm)
+            {\sffamily\scriptsize\num};
+        \foreach \num in {0,1,...,\ymax}
+        \draw (0,\bookcover at partheight@-\num mm)--++(1,0);
+        \foreach \num in {0,5,...,\ymax}
+        \draw (0,\bookcover at partheight@-\num mm)--++(1.5,0);
+        \foreach \num in {0,10,...,\ymax}
+        \draw (0,\bookcover at partheight@-\num mm)--++(2,0);
+        \foreach \num in {1,2,...,\ynummax}
+        \node[anchor=west] at (2,\bookcover at partheight@-10*\num mm)
+            {\sffamily\scriptsize\num};
+        \node[anchor=north] at (5,\bookcover at partheight@-2mm)
+            {\sffamily\scriptsize\vphantom{1}cm};
+        \end{scope}}{}
+    \ifthenelse{\equal{\bookcover at ruler@coordsys}{upper right}}{
+        \begin{scope}[xshift=-\bookcover at ruler@xshift,yshift=-\bookcover at ruler@yshift]
+        \foreach \num in {0,1,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,\bookcover at partheight@)--++(0,-1);
+        \foreach \num in {0,5,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,\bookcover at partheight@)--++(0,-1.5);
+        \foreach \num in {0,10,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,\bookcover at partheight@)--++(0,-2);
+        \foreach \num in {1,2,...,\xnummax}
+        \node[anchor=north] at (\bookcover at partwidth@-10*\num mm,\bookcover at partheight@-2mm)
+            {\sffamily\scriptsize\num};
+        \foreach \num in {0,1,...,\ymax}
+        \draw (\bookcover at partwidth@,\bookcover at partheight@-\num mm)--++(-1,0);
+        \foreach \num in {0,5,...,\ymax}
+        \draw (\bookcover at partwidth@,\bookcover at partheight@-\num mm)--++(-1.5,0);
+        \foreach \num in {0,10,...,\ymax}
+        \draw (\bookcover at partwidth@,\bookcover at partheight@-\num mm)--++(-2,0);
+        \foreach \num in {1,2,...,\ynummax}
+        \node[anchor=east] at (\bookcover at partwidth@-2mm,\bookcover at partheight@-10*\num mm)
+            {\sffamily\scriptsize\num};
+        \node[anchor=north] at (\bookcover at partwidth@-5mm,\bookcover at partheight@-2mm)
+            {\sffamily\scriptsize\vphantom{1}cm};
+        \end{scope}}{}
+    \end{tikzpicture}}
+\def\setruler#1#2#3#4{
+    \def\bookcover at ruler@coordsys{#1}
+    \setlength{\bookcover at ruler@xshift}{#2}
+    \setlength{\bookcover at ruler@yshift}{#3}
+    \color{#4}}
+
+%% BOOKCOVER PARTS
+\newbookcoverpart{bg back flap}{
+    \ifdim\flapwidth>0mm
+        \bookcover at ypos{\marklength}
+        \bookcover at partheight{\coverheight+2\bleedwidth}
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{\flapwidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg back}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{\coverwidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\spinewidth}
+    \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}}
+
+\newbookcoverpart{bg front}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at partwidth{\coverwidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front flap}{
+    \ifdim\flapwidth>0mm
+        \bookcover at ypos{\marklength}
+        \bookcover at partheight{\coverheight+2\bleedwidth}
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
+        \bookcover at partwidth{\flapwidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg back and flap}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength}
+    \bookcover at partwidth{\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
+
+\newbookcoverpart{bg back and spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at partwidth{\coverwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{\coverwidth+\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front and spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at partwidth{\coverwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at partwidth{\coverwidth+\spinewidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front and flap}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at partwidth{\coverwidth+\flapwidth+\bleedwidth}
+    \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}}
+
+\newbookcoverpart{bg back and flap and spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength}
+    \bookcover at partwidth{\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
+
+\newbookcoverpart{bg whole without flaps}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at partwidth{2\coverwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front and flap and spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+    \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}}
+
+\newbookcoverpart{bg whole without front flap}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength}
+    \ifdim\flapwidth>0mm
+        \bookcover at partwidth{2\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}
+    \else
+        \bookcover at partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg whole without back flap}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at partwidth{2\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0mm}{\bleedwidth}
+    \else
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg whole}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength}
+    \bookcover at partwidth{2\coverwidth+2\bleedwidth+2\flapwidth+\spinewidth}
+    \bookcover at tikz@trimmed at part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
+
+\newbookcoverpart{whole page}{
+    \bookcover at partheight{\paperheight}
+    \bookcover at partwidth{\paperwidth}}
+
+\newbookcoverpart{back flap}{
+    \ifdim\flapwidth>0mm
+        \bookcover at ypos{\marklength+\bleedwidth}
+        \bookcover at partheight{\coverheight}
+        \bookcover at xpos{\marklength+\bleedwidth}
+        \bookcover at partwidth{\flapwidth}\fi}
+
+\newbookcoverpart{back}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+    \bookcover at partwidth{\coverwidth}}
+
+\newbookcoverpart{spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\spinewidth}}
+
+\newbookcoverpart{front}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at partwidth{\coverwidth}}
+
+\newbookcoverpart{front flap}{
+    \ifdim\flapwidth>0mm
+        \bookcover at ypos{\marklength+\bleedwidth}
+        \bookcover at partheight{\coverheight}
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
+        \bookcover at partwidth{\flapwidth}\fi}
+
+\newbookcoverpart{above front}{
+    \ifdim\marklength>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+        \bookcover at ypos{0mm}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at partheight{\marklength}\fi}
+
+\newbookcoverpart{below front}{
+    \ifdim\marklength>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+        \bookcover at ypos{\marklength+2\bleedwidth+\coverheight}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at partheight{\marklength}\fi}
+
+\newbookcoverpart{above back}{
+    \ifdim\marklength>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at ypos{0mm}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at partheight{\marklength}\fi}
+
+\newbookcoverpart{below back}{
+    \ifdim\marklength>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at ypos{\marklength+2\bleedwidth+\coverheight}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at partheight{\marklength}\fi}
+
+\newbookcoverpart{back and flap}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth}
+    \bookcover at partwidth{\flapwidth+\coverwidth}
+    \bookcover at partheight{\coverheight}}
+
+\newbookcoverpart{back and spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+    \bookcover at partwidth{\coverwidth+\spinewidth}}
+
+\newbookcoverpart{front and spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\coverwidth+\spinewidth}}
+
+\newbookcoverpart{front and flap}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at partwidth{\coverwidth+\flapwidth}}
+
+\newbookcoverpart{back and flap and spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth}
+    \bookcover at partwidth{\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at partheight{\coverheight}}
+
+\newbookcoverpart{whole without flaps}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+    \bookcover at partwidth{2\coverwidth+\spinewidth}}
+
+\newbookcoverpart{front and flap and spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\coverwidth+\flapwidth+\spinewidth}}
+
+\newbookcoverpart{whole without front flap}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth}
+    \bookcover at partwidth{2\coverwidth+\flapwidth+\spinewidth}}
+
+\newbookcoverpart{whole without back flap}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+    \bookcover at partwidth{2\coverwidth+\flapwidth+\spinewidth}}
+
+\newbookcoverpart{whole}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth}
+    \bookcover at partwidth{2\coverwidth+2\flapwidth+\spinewidth}}
+
+%%%%%%%%%%%%%%%%
+%% OLD METHOD %%
+%%%%%%%%%%%%%%%%
+
+%% MAIN LAYERS
+\def\bookcover at bgcolor#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        \tikz\fill\expandafter[#1] (0,0) rectangle (\bookcover at partwidth@,\bookcover at partheight@);
+    \end{textblock*}}
+
+\def\bookcover at bgpic#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        \includegraphics[width=\bookcover at partwidth@,height=\bookcover at partheight@]{#1}
+    \end{textblock*}}
+
+\def\bookcover at bgtikz#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+     \ifbookcover at bgtikznodes
+        \begin{tikzpicture}[overlay,yshift=-\bookcover at partheight@]
+        \begin{scope}[transparent,line width=0pt]
+            \pgfset{minimum width=\bookcover at partwidth@,minimum height=\bookcover at partheight@}
+            \pgfnode{rectangle}{south west}{}{current part}{\pgfusepath{draw}}% for v1.1.1
+            \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}}
+            \pgfset{minimum width=\bookcover at partwidth@-\bookcover at tikz@trimmed at part@width at minus,
+                    minimum height=\bookcover at partheight@-\bookcover at tikz@trimmed at part@height at minus}
+            \pgftransformshift{\pgfpoint{\bookcover at tikz@trimmed at part@push at right}
+                                        {\bookcover at tikz@trimmed at part@push at up}}
+            \pgfnode{rectangle}{south west}{}{current trimmed part}{\pgfusepath{draw}}% for v1.1.1
+            \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}}
+        \end{scope}
+        \ifbookcover at bgtikzclip
+            \clip (part.south west) rectangle (part.north east);\fi
+    \else\begin{tikzpicture}\fi
+        #1
+        \end{tikzpicture}
+    \end{textblock*}}
+
+\def\bookcover at fg#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        \parbox[t][\bookcover at partheight@][t]{\bookcover at partwidth@}{#1}
+    \end{textblock*}}
+
+\def\bookcover at remark#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        \parbox[t][\bookcover at partheight@][c]{\bookcover at partwidth@}{\begin{center}#1\end{center}}
+    \end{textblock*}}
+
 %% RESET DATAS
 \def\bookcover at reset{
     \def\bookcover at bgcolor@whole{}
@@ -699,19 +1713,19 @@
     \def\bookcover at fgsecond@spine{}
     \def\bookcover at fgsecond@backflap{}
     \def\bookcover at fgsecond@frontflap{}}
-\bookcover at reset    
-    
-%% SETBOOKCOVER    
+\bookcover at reset
+
+%% SET BOOKCOVER
 \long\def\setbookcover#1#2#3{
     \ifthenelse{\equal{#1}{bgcolor}}{
-        \ifthenelse{\equal{#2}{whole}}{\def\bookcover at bgcolor@whole{[#3]}}{}
-        \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover at bgcolor@wholewf{[#3]}}{}
-        \ifthenelse{\equal{#2}{back}}{\def\bookcover at bgcolor@back{[#3]}}{}
-        \ifthenelse{\equal{#2}{front}}{\def\bookcover at bgcolor@front{[#3]}}{}
-        \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at bgcolor@backflap{[#3]}}{}
-        \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at bgcolor@frontflap{[#3]}}{}
-        \ifthenelse{\equal{#2}{spine}}{\def\bookcover at bgcolor@spine{[#3]}}{}}{}
-    \ifthenelse{\equal{#1}{bgpic}}{    
+        \ifthenelse{\equal{#2}{whole}}{\def\bookcover at bgcolor@whole{#3}}{}
+        \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover at bgcolor@wholewf{#3}}{}
+        \ifthenelse{\equal{#2}{back}}{\def\bookcover at bgcolor@back{#3}}{}
+        \ifthenelse{\equal{#2}{front}}{\def\bookcover at bgcolor@front{#3}}{}
+        \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at bgcolor@backflap{#3}}{}
+        \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at bgcolor@frontflap{#3}}{}
+        \ifthenelse{\equal{#2}{spine}}{\def\bookcover at bgcolor@spine{#3}}{}}{}
+    \ifthenelse{\equal{#1}{bgpic}}{
         \ifthenelse{\equal{#2}{whole}}{\def\bookcover at bgpic@whole{#3}}{}
         \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover at bgpic@wholewf{#3}}{}
         \ifthenelse{\equal{#2}{back}}{\def\bookcover at bgpic@back{#3}}{}
@@ -718,8 +1732,8 @@
         \ifthenelse{\equal{#2}{front}}{\def\bookcover at bgpic@front{#3}}{}
         \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at bgpic@backflap{#3}}{}
         \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at bgpic@frontflap{#3}}{}
-        \ifthenelse{\equal{#2}{spine}}{\def\bookcover at bgpic@spine{#3}}{}}{}    
-    \ifthenelse{\equal{#1}{bgtikz}}{    
+        \ifthenelse{\equal{#2}{spine}}{\def\bookcover at bgpic@spine{#3}}{}}{}
+    \ifthenelse{\equal{#1}{bgtikz}}{
         \ifthenelse{\equal{#2}{whole}}{\def\bookcover at bgtikz@whole{#3}}{}
         \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover at bgtikz@wholewf{#3}}{}
         \ifthenelse{\equal{#2}{back}}{\def\bookcover at bgtikz@back{#3}}{}
@@ -726,19 +1740,19 @@
         \ifthenelse{\equal{#2}{front}}{\def\bookcover at bgtikz@front{#3}}{}
         \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at bgtikz@backflap{#3}}{}
         \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at bgtikz@frontflap{#3}}{}
-        \ifthenelse{\equal{#2}{spine}}{\def\bookcover at bgtikz@spine{#3}}{}}{}     
-    \ifthenelse{\equal{#1}{fgfirst}}{    
+        \ifthenelse{\equal{#2}{spine}}{\def\bookcover at bgtikz@spine{#3}}{}}{}
+    \ifthenelse{\equal{#1}{fgfirst}}{
         \ifthenelse{\equal{#2}{back}}{\def\bookcover at fgfirst@back{#3}}{}
         \ifthenelse{\equal{#2}{front}}{\def\bookcover at fgfirst@front{#3}}{}
         \ifthenelse{\equal{#2}{spine}}{\def\bookcover at fgfirst@spine{#3}}{}
         \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at fgfirst@backflap{#3}}{}
         \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at fgfirst@frontflap{#3}}{}
-        \ifthenelse{\equal{#2}{remark}}{\def\bookcover at fgfirst@abovefront{#3}}{}% for version 1.0
+        \ifthenelse{\equal{#2}{remark}}{\def\bookcover at fgfirst@abovefront{#3}}{}% for v1.0
         \ifthenelse{\equal{#2}{above front}}{\def\bookcover at fgfirst@abovefront{#3}}{}
         \ifthenelse{\equal{#2}{below front}}{\def\bookcover at fgfirst@belowfront{#3}}{}
         \ifthenelse{\equal{#2}{above back}}{\def\bookcover at fgfirst@aboveback{#3}}{}
-        \ifthenelse{\equal{#2}{below back}}{\def\bookcover at fgfirst@belowback{#3}}{}}{}    
-    \ifthenelse{\equal{#1}{fgsecond}}{    
+        \ifthenelse{\equal{#2}{below back}}{\def\bookcover at fgfirst@belowback{#3}}{}}{}
+    \ifthenelse{\equal{#1}{fgsecond}}{
         \ifthenelse{\equal{#2}{back}}{\def\bookcover at fgsecond@back{#3}}{}
         \ifthenelse{\equal{#2}{front}}{\def\bookcover at fgsecond@front{#3}}{}
         \ifthenelse{\equal{#2}{spine}}{\def\bookcover at fgsecond@spine{#3}}{}
@@ -745,7 +1759,7 @@
         \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at fgsecond@backflap{#3}}{}
         \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at fgsecond@frontflap{#3}}{}}{}}
 
-%% MAKEBOOKCOVER  
+%% MAKE BOOKCOVER
 \def\makebookcover{
 %% background parameters
 \bookcover at ypos{\marklength}
@@ -954,7 +1968,7 @@
     \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
     \bookcover at partwidth{\flapwidth}
     \bookcover at fg{\bookcover at fgfirst@frontflap}\fi\fi
-%% {fgfirst}{above front} = {fgfirst}{remark} in version 1.0
+%% {fgfirst}{above front} = {fgfirst}{remark} in v1.0
 \ifx\bookcover at fgfirst@abovefront\@empty\else\ifdim\marklength>0mm
     \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
     \bookcover at ypos{0mm}
@@ -974,7 +1988,7 @@
     \bookcover at ypos{0mm}
     \bookcover at partwidth{\coverwidth}
     \bookcover at partheight{\marklength}
-    \bookcover at remark{\bookcover at fgfirst@aboveback}\fi\fi    
+    \bookcover at remark{\bookcover at fgfirst@aboveback}\fi\fi
 %% {fgfirst}{below back}
 \ifx\bookcover at fgfirst@belowback\@empty\else\ifdim\marklength>0mm
     \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
@@ -981,78 +1995,13 @@
     \bookcover at ypos{\marklength+2\bleedwidth+\coverheight}
     \bookcover at partwidth{\coverwidth}
     \bookcover at partheight{\marklength}
-    \bookcover at remark{\bookcover at fgfirst@belowback}\fi\fi  
-%% mark top parameters
-\bookcover at ypos{0mm}
-\bookcover at partwidth{\markthick}
-%% mark top 1
-\bookcover at xpos{\marklength+\bleedwidth-.5\markthick}
-\bookcover at vmark
-%% mark top 2
-\ifdim\flapwidth>0mm
-    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
-    \bookcover at vmark\fi
-%% mark top 3
-\bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
-\bookcover at vmark
-%% mark top 4
-\bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
-\bookcover at vmark
-%% mark top 5
-\ifdim\flapwidth>0mm
-    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
-    \bookcover at vmark\fi
-%% mark top 6
-\bookcover at xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
-\bookcover at vmark
-%% mark bottom parameters
-\bookcover at ypos{\paperheight-\marklength}
-\bookcover at partwidth{\markthick}
-%% mark bottom 1
-\bookcover at xpos{\marklength+\bleedwidth-.5\markthick}
-\bookcover at vmark
-%% mark bottom 2
-\ifdim\flapwidth>0mm
-    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
-    \bookcover at vmark\fi
-%% mark bottom 3
-\bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
-\bookcover at vmark
-%% mark bottom 4
-\bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
-\bookcover at vmark
-%% mark bottom 5
-\ifdim\flapwidth>0mm
-    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
-    \bookcover at vmark\fi
-%% mark bottom 6
-\bookcover at xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
-\bookcover at vmark
-%% mark left parameters
-\bookcover at xpos{0mm}
-\bookcover at partwidth{\marklength}
-%% mark left 1
-\bookcover at ypos{\marklength+\bleedwidth-.5\markthick}
-\bookcover at hmark
-%% mark left 2
-\bookcover at ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
-\bookcover at hmark
-%% mark right parameters
-\bookcover at xpos{\paperwidth-\marklength}
-\bookcover at partwidth{\marklength}
-%% mark right 1
-\bookcover at ypos{\marklength+\bleedwidth-.5\markthick}
-\bookcover at hmark
-%% mark right 2
-\bookcover at ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
-\bookcover at hmark
+    \bookcover at remark{\bookcover at fgfirst@belowback}\fi\fi
+%% marks
+\bookcover at marks
 %% trimming
-\ifbookcover at trimmed
-    \bookcover at trimming\fi
+\ifbookcover at trimmed\bookcover at trimming\fi
 %% new book cover
-\mbox{}
-\newpage
-\bookcover at reset}
+\mbox{}\newpage\bookcover at reset}
 %    \end{macrocode}
 % \Finale
-\endinput
+\endinput
\ No newline at end of file

Modified: trunk/Master/texmf-dist/source/latex/bookcover/bookcover.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/bookcover/bookcover.ins	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/source/latex/bookcover/bookcover.ins	2016-11-12 22:03:46 UTC (rev 42494)
@@ -1,5 +1,5 @@
 
-% Copyright (C) 2015 Tibor Tomacs
+% Copyright (C) 2015-2016 Tibor Tomacs
 % This file may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either
 % version 1.2 of this license or (at your option) any later
@@ -15,7 +15,7 @@
 \usedir{tex/latex/bookcover}
 \preamble
 This is a generated file.
-Copyright (C) 2015 Tibor Tomacs
+Copyright (C) 2015-2016 Tibor Tomacs
 This file may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either
 version 1.2 of this license or (at your option) any later

Modified: trunk/Master/texmf-dist/tex/latex/bookcover/bookcover.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bookcover/bookcover.cls	2016-11-12 15:30:18 UTC (rev 42493)
+++ trunk/Master/texmf-dist/tex/latex/bookcover/bookcover.cls	2016-11-12 22:03:46 UTC (rev 42494)
@@ -6,7 +6,7 @@
 %%
 %% ./bookcover.dtx  (with options: `class')
 %% This is a generated file.
-%% Copyright (C) 2015 Tibor Tomacs
+%% Copyright (C) 2015-2016 Tibor Tomacs
 %% This file may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either
 %% version 1.2 of this license or (at your option) any later
@@ -18,7 +18,7 @@
 %% LaTeX version 1999/12/01 or later.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesClass{bookcover}[2016/06/08 v1.1.1 class for book covers and dust jackets]
+\ProvidesClass{bookcover}[2016/11/12 v2.0 class for book covers and dust jackets]
 %%
 %% OPTIONS
 \RequirePackage{kvoptions}
@@ -36,18 +36,22 @@
 \DeclareStringOption[5mm]{bleedwidth}
 \DeclareStringOption[red]{markcolor}
 \DeclareBoolOption[false]{trimmed}
-\DeclareBoolOption[false]{bgtikznodes}
-\DeclareBoolOption[false]{bgtikzclip}
+\DeclareBoolOption[false]{bgtikznodes}% for old method
+\DeclareBoolOption[false]{bgtikzclip}% for old method
 \ProcessKeyvalOptions{bookcover}
+\ifbookcover at bgtikzclip\bookcover at bgtikznodestrue\fi% for old method
 
-%% LOADING CLASS AND PACKAGES
+%% CLASS AND PACKAGES
 \LoadClass{article}
 \RequirePackage{geometry,graphicx,calc,xcolor,ifthen,tikz,eso-pic}
 \RequirePackage[absolute]{textpos}
 
-%% PAGE STYLE IS EMPTY
+%% PAGE STYLE
 \pagestyle{empty}
 
+%% NEW IF
+\newif\if at inbookcoverenv
+
 %% USER LENGTHS
 \newlength{\coverwidth}
 \newlength{\coverheight}
@@ -62,8 +66,14 @@
 \newlength{\bookcover at ypos@}
 \newlength{\bookcover at partwidth@}
 \newlength{\bookcover at partheight@}
-\newlength{\bookcover at bgtikz@trimmed at part@width at minus}
-\newlength{\bookcover at bgtikz@trimmed at part@push at right}
+\newlength{\bookcover at tikz@trimmed at part@width at minus}
+\newlength{\bookcover at tikz@trimmed at part@height at minus}
+\newlength{\bookcover at tikz@trimmed at part@push at right}
+\newlength{\bookcover at tikz@trimmed at part@push at up}
+\newlength{\bookcover at ruler@xshift}
+\newlength{\bookcover at ruler@yshift}
+\let\partheight\bookcover at partheight@
+\let\partwidth\bookcover at partwidth@
 
 %% USER LENGTHS SETTING
 \setlength{\coverwidth}{\bookcover at coverwidth}
@@ -77,76 +87,87 @@
 \setlength{\paperheight}{2\marklength+2\bleedwidth+\coverheight}
 \setlength{\parindent}{0pt}
 
-%% GRID
-\ifESO at grid
-    \setlength{\markthick}{2pt}
-    \def\bookcover at markcolor{red}\fi
-
-%% COMMANDS FOR INTERNAL LENGTHS SETTING
+%% INTERNAL LENGTHS SETTING
 \def\bookcover at xpos#1{\setlength{\bookcover at xpos@}{#1}}
 \def\bookcover at ypos#1{\setlength{\bookcover at ypos@}{#1}}
 \def\bookcover at partwidth#1{\setlength{\bookcover at partwidth@}{#1}}
 \def\bookcover at partheight#1{\setlength{\bookcover at partheight@}{#1}}
-\def\bookcover at bgtikz@trimmed at part@param#1#2{%
-    \setlength{\bookcover at bgtikz@trimmed at part@width at minus}{#1}%
-    \setlength{\bookcover at bgtikz@trimmed at part@push at right}{#2}}
+\def\bookcover at tikz@trimmed at part@param#1#2#3#4{%
+    \setlength{\bookcover at tikz@trimmed at part@width at minus}{#1}%
+    \setlength{\bookcover at tikz@trimmed at part@height at minus}{#2}
+    \setlength{\bookcover at tikz@trimmed at part@push at right}{#3}
+    \setlength{\bookcover at tikz@trimmed at part@push at up}{#4}}
+\def\bookcover at bgtikz@trimmed at part@param#1#2{
+    \bookcover at tikz@trimmed at part@param{#1}{2\bleedwidth}{#2}{\bleedwidth}}% for old method
+\let\setpartposx\bookcover at xpos
+\let\setpartposy\bookcover at ypos
+\let\setpartwidth\bookcover at partwidth
+\let\setpartheight\bookcover at partheight
+\let\settrimmedpart\bookcover at tikz@trimmed at part@param
 
-%% MACROS FOR OUTPUTS OF PARTS
-%% bgcolor
-\def\bookcover at bgcolor#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \tikz\expandafter\fill#1 (0,0) rectangle (\bookcover at partwidth@,\bookcover at partheight@);
-    \end{textblock*}}
-%% bgpic
-\def\bookcover at bgpic#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \includegraphics[width=\bookcover at partwidth@,height=\bookcover at partheight@]{#1}
-    \end{textblock*}}
-%% bgtikz
-\def\bookcover at bgtikz#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \ifbookcover at bgtikzclip\bookcover at bgtikznodestrue\fi
-        \ifbookcover at bgtikznodes
-            \begin{tikzpicture}[overlay,yshift=-\bookcover at partheight@]
-            \begin{scope}[transparent,line width=0pt]
-                \pgfset{minimum width=\bookcover at partwidth@,minimum height=\bookcover at partheight@}
-                \pgfnode{rectangle}{south west}{}{current part}{\pgfusepath{draw}}
-                \pgfset{minimum width=\bookcover at partwidth@-\bookcover at bgtikz@trimmed at part@width at minus,
-                        minimum height=\bookcover at partheight@-2\bleedwidth}
-                \pgftransformshift{\pgfpoint{\bookcover at bgtikz@trimmed at part@push at right}{\bleedwidth}}
-                \pgfnode{rectangle}{south west}{}{current trimmed part}{\pgfusepath{draw}}
-            \end{scope}
-            \ifbookcover at bgtikzclip
-                \clip (current part.south west) rectangle (current part.north east);\fi
-        \else\begin{tikzpicture}\fi
-            #1
-        \end{tikzpicture}
-    \end{textblock*}}
-%% fg
-\def\bookcover at fg#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \parbox[t][\bookcover at partheight@][t]{\bookcover at partwidth@}{#1}
-    \end{textblock*}}
-%% remark
-\def\bookcover at remark#1{
-    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
-        \parbox[t][\bookcover at partheight@][c]{\bookcover at partwidth@}
-            {\centering#1\par}
-    \end{textblock*}}
+%% GRID
+\ifESO at grid
+    \setlength{\markthick}{2pt}
+    \def\bookcover at markcolor{red}\fi
 
-%% MACROS FOR MARKS
-%% vertical mark
+%% MARKS
 \def\bookcover at vmark{
     \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
         {\color{\bookcover at markcolor}\rule[0pt]{\markthick}{\marklength}}
     \end{textblock*}}
-%% horizontal mark
+
 \def\bookcover at hmark{
     \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
         {\color{\bookcover at markcolor}\rule[0pt]{\marklength}{\markthick}}
     \end{textblock*}}
 
-%% MACRO FOR TRIMMING
+\def\bookcover at marks{
+    \bookcover at ypos{0mm}
+    \bookcover at partwidth{\markthick}
+    \bookcover at xpos{\marklength+\bleedwidth-.5\markthick}
+    \bookcover at vmark
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
+        \bookcover at vmark\fi
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
+    \bookcover at vmark
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
+    \bookcover at vmark
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
+        \bookcover at vmark\fi
+    \bookcover at xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
+    \bookcover at vmark
+    \bookcover at ypos{\paperheight-\marklength}
+    \bookcover at partwidth{\markthick}
+    \bookcover at xpos{\marklength+\bleedwidth-.5\markthick}
+    \bookcover at vmark
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
+        \bookcover at vmark\fi
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
+    \bookcover at vmark
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
+    \bookcover at vmark
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
+        \bookcover at vmark\fi
+    \bookcover at xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
+    \bookcover at vmark
+    \bookcover at xpos{0mm}
+    \bookcover at partwidth{\marklength}
+    \bookcover at ypos{\marklength+\bleedwidth-.5\markthick}
+    \bookcover at hmark
+    \bookcover at ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
+    \bookcover at hmark
+    \bookcover at xpos{\paperwidth-\marklength}
+    \bookcover at partwidth{\marklength}
+    \bookcover at ypos{\marklength+\bleedwidth-.5\markthick}
+    \bookcover at hmark
+    \bookcover at ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
+    \bookcover at hmark}
+
+%% TRIMMING
 \def\bookcover at trimming{
     \begin{textblock*}{\paperwidth}(0mm,0mm)
         \begin{tikzpicture}
@@ -198,6 +219,533 @@
     \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
     \bookcover at vmark}
 
+%% BOOKCOVER COMPONENT
+\long\def\bookcovercomponent#1#2#3{
+    \if at inbookcoverenv\else
+        \@latexerr{\string\bookcovercomponent\space is not in 'bookcover' environment.}{}\fi
+    \bookcover at xpos{0pt}
+    \bookcover at ypos{0pt}
+    \bookcover at partwidth{0pt}
+    \bookcover at partheight{0pt}
+    \bookcover at tikz@trimmed at part@param{0pt}{0pt}{0pt}{0pt}
+    \@ifundefined{bookcover at part@param@#2}{\@latexerr{Part '#2' undefined.}{}}{
+        \@ifundefined{bookcover at componenttype@#1}{\@latexerr{Component type '#1' undefined.}{}}{
+            \ifx#3\@empty\else
+                \csname bookcover at part@param@#2\endcsname
+                \ifdim\bookcover at partwidth@>0mm
+                    \ifdim\bookcover at partheight@>0mm
+                        \csname bookcover at componenttype@#1\endcsname{#3}\fi\fi\fi}}}
+
+%% BOOKCOVER ENVIRONMENT
+\def\bookcover{\@inbookcoverenvtrue}
+\def\endbookcover{
+    \bookcover at marks
+    \ifbookcover at trimmed\bookcover at trimming\fi
+    \mbox{}\newpage\@inbookcoverenvfalse}
+
+%% NEW BOOKCOVER PART
+\def\newbookcoverpart#1#2{
+    \@ifundefined{bookcover at part@param@#1}{
+        \expandafter\def\csname bookcover at part@param@#1\endcsname{#2}}
+    {\@latexerr{Part '#1' already defined.}{}}}
+
+%% RENEW BOOKCOVER PART
+\def\renewbookcoverpart#1#2{
+    \@ifundefined{bookcover at part@param@#1}{\@latexerr{Part '#1' undefined.}{}}{
+        \expandafter\def\csname bookcover at part@param@#1\endcsname{#2}}}
+
+%% NEW NAME BOOKCOVER PART
+\def\newnamebookcoverpart#1#2{
+    \@ifundefined{bookcover at part@param@#1}{
+        \@ifundefined{bookcover at part@param@#2}{\@latexerr{Part '#2' undefined.}{}}{
+            \expandafter\def\csname bookcover at part@param@#1\endcsname{%
+                \csname bookcover at part@param@#2\endcsname}}}
+    {\@latexerr{Part '#1' already defined.}{}}}
+
+%% NEW BOOKCOVER COMPONENT TYPE
+\def\newbookcovercomponenttype#1#2{
+    \@ifundefined{bookcover at componenttype@#1}{
+        \long\expandafter\def\csname bookcover at componenttype@#1\endcsname##1{
+        \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        #2
+        \end{textblock*}}}
+    {\@latexerr{Component type '#1' already defined.}{}}}
+
+%% RENEW BOOKCOVER COMPONENT TYPE
+\def\renewbookcovercomponenttype#1#2{
+    \@ifundefined{bookcover at componenttype@#1}{\@latex at error{Component type '#1' undefined.}{}}{
+        \long\expandafter\def\csname bookcover at componenttype@#1\endcsname##1{
+        \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        #2
+        \end{textblock*}}}}
+
+%% NEW NAME BOOKCOVER COMPONENT TYPE
+\def\newnamebookcovercomponenttype#1#2{
+    \@ifundefined{bookcover at componenttype@#1}{
+        \@ifundefined{bookcover at componenttype@#2}{\@latexerr{Component type '#2' undefined.}{}}{
+            \expandafter\def\csname bookcover at componenttype@#1\endcsname{%
+                \csname bookcover at componenttype@#2\endcsname}}}
+    {\@latexerr{Component type '#1' already defined.}{}}}
+
+%% COMPONENT TYPES
+\newbookcovercomponenttype{color}{
+    \tikz\fill[#1] (0,0) rectangle (\bookcover at partwidth@,\bookcover at partheight@);}
+
+\newbookcovercomponenttype{picture}{
+    \includegraphics[width=\bookcover at partwidth@,height=\bookcover at partheight@]{#1}}
+
+\newbookcovercomponenttype{tikz}{
+    \begin{tikzpicture}[overlay,yshift=-\bookcover at partheight@]
+    \begin{scope}[transparent,line width=0pt]
+        \pgfset{minimum width=\bookcover at partwidth@,minimum height=\bookcover at partheight@}
+        \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}}
+        \pgfset{minimum width=\bookcover at partwidth@-\bookcover at tikz@trimmed at part@width at minus,
+                minimum height=\bookcover at partheight@-\bookcover at tikz@trimmed at part@height at minus}
+        \pgftransformshift{\pgfpoint{\bookcover at tikz@trimmed at part@push at right}
+                                    {\bookcover at tikz@trimmed at part@push at up}}
+        \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}}
+    \end{scope}
+    #1
+    \end{tikzpicture}}
+
+\newbookcovercomponenttype{tikz clip}{
+    \begin{tikzpicture}[overlay,yshift=-\bookcover at partheight@]
+    \begin{scope}[transparent,line width=0pt]
+        \pgfset{minimum width=\bookcover at partwidth@,minimum height=\bookcover at partheight@}
+        \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}}
+        \pgfset{minimum width=\bookcover at partwidth@-\bookcover at tikz@trimmed at part@width at minus,
+                minimum height=\bookcover at partheight@-\bookcover at tikz@trimmed at part@height at minus}
+        \pgftransformshift{\pgfpoint{\bookcover at tikz@trimmed at part@push at right}
+                                    {\bookcover at tikz@trimmed at part@push at up}}
+        \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}}
+    \end{scope}
+    \clip (part.south west) rectangle (part.north east);
+    #1
+    \end{tikzpicture}}
+
+\newbookcovercomponenttype{normal}{
+    \parbox[t][\bookcover at partheight@][t]{\bookcover at partwidth@}{#1}}
+
+\newbookcovercomponenttype{center}{
+    \parbox[t][\bookcover at partheight@][c]{\bookcover at partwidth@}{\begin{center}#1\end{center}}}
+
+\newbookcovercomponenttype{ruler}{
+    \begin{tikzpicture}[overlay,x=1mm,y=1mm,inner sep=0pt,outer sep=3pt,yshift=-\bookcover at partheight@]
+    #1
+    \pgfmathsetmacro\xmax{round(.351459804*(\bookcover at partwidth@-\bookcover at ruler@xshift))}
+    \pgfmathsetmacro\xnummax{round(.0351459804*(\bookcover at partwidth@-\bookcover at ruler@xshift))}
+    \pgfmathsetmacro\ymax{round(.351459804*(\bookcover at partheight@-\bookcover at ruler@yshift))}
+    \pgfmathsetmacro\ynummax{round(.0351459804*(\bookcover at partheight@-\bookcover at ruler@yshift))}
+    \ifthenelse{\equal{\bookcover at ruler@coordsys}{lower left}}{
+        \begin{scope}[xshift=\bookcover at ruler@xshift,yshift=\bookcover at 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 at ruler@coordsys}{lower right}}{
+        \begin{scope}[xshift=-\bookcover at ruler@xshift,yshift=\bookcover at ruler@yshift]
+        \foreach \num in {0,1,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,0)--++(0,1);
+        \foreach \num in {0,5,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,0)--++(0,1.5);
+        \foreach \num in {0,10,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,0)--++(0,2);
+        \foreach \num in {1,2,...,\xnummax}
+        \node[anchor=south] at (\bookcover at partwidth@-10*\num mm,2)
+            {\sffamily\scriptsize\num};
+        \foreach \num in {0,1,...,\ymax}
+        \draw (\bookcover at partwidth@,\num)--++(-1,0);
+        \foreach \num in {0,5,...,\ymax}
+        \draw (\bookcover at partwidth@,\num)--++(-1.5,0);
+        \foreach \num in {0,10,...,\ymax}
+        \draw (\bookcover at partwidth@,\num)--++(-2,0);
+        \foreach \num in {1,2,...,\ynummax}
+        \node[anchor=east] at (\bookcover at partwidth@-2mm,10*\num)
+            {\sffamily\scriptsize\num};
+        \node[anchor=south] at (\bookcover at partwidth@-5mm,2)
+            {\sffamily\scriptsize cm};
+        \end{scope}}{}
+    \ifthenelse{\equal{\bookcover at ruler@coordsys}{upper left}}{
+        \begin{scope}[xshift=\bookcover at ruler@xshift,yshift=-\bookcover at ruler@yshift]
+        \foreach \num in {0,1,...,\xmax}
+        \draw (\num,\bookcover at partheight@)--++(0,-1);
+        \foreach \num in {0,5,...,\xmax}
+        \draw (\num,\bookcover at partheight@)--++(0,-1.5);
+        \foreach \num in {0,10,...,\xmax}
+        \draw (\num,\bookcover at partheight@)--++(0,-2);
+        \foreach \num in {1,2,...,\xnummax}
+        \node[anchor=north] at (10*\num,\bookcover at partheight@-2mm)
+            {\sffamily\scriptsize\num};
+        \foreach \num in {0,1,...,\ymax}
+        \draw (0,\bookcover at partheight@-\num mm)--++(1,0);
+        \foreach \num in {0,5,...,\ymax}
+        \draw (0,\bookcover at partheight@-\num mm)--++(1.5,0);
+        \foreach \num in {0,10,...,\ymax}
+        \draw (0,\bookcover at partheight@-\num mm)--++(2,0);
+        \foreach \num in {1,2,...,\ynummax}
+        \node[anchor=west] at (2,\bookcover at partheight@-10*\num mm)
+            {\sffamily\scriptsize\num};
+        \node[anchor=north] at (5,\bookcover at partheight@-2mm)
+            {\sffamily\scriptsize\vphantom{1}cm};
+        \end{scope}}{}
+    \ifthenelse{\equal{\bookcover at ruler@coordsys}{upper right}}{
+        \begin{scope}[xshift=-\bookcover at ruler@xshift,yshift=-\bookcover at ruler@yshift]
+        \foreach \num in {0,1,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,\bookcover at partheight@)--++(0,-1);
+        \foreach \num in {0,5,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,\bookcover at partheight@)--++(0,-1.5);
+        \foreach \num in {0,10,...,\xmax}
+        \draw (\bookcover at partwidth@-\num mm,\bookcover at partheight@)--++(0,-2);
+        \foreach \num in {1,2,...,\xnummax}
+        \node[anchor=north] at (\bookcover at partwidth@-10*\num mm,\bookcover at partheight@-2mm)
+            {\sffamily\scriptsize\num};
+        \foreach \num in {0,1,...,\ymax}
+        \draw (\bookcover at partwidth@,\bookcover at partheight@-\num mm)--++(-1,0);
+        \foreach \num in {0,5,...,\ymax}
+        \draw (\bookcover at partwidth@,\bookcover at partheight@-\num mm)--++(-1.5,0);
+        \foreach \num in {0,10,...,\ymax}
+        \draw (\bookcover at partwidth@,\bookcover at partheight@-\num mm)--++(-2,0);
+        \foreach \num in {1,2,...,\ynummax}
+        \node[anchor=east] at (\bookcover at partwidth@-2mm,\bookcover at partheight@-10*\num mm)
+            {\sffamily\scriptsize\num};
+        \node[anchor=north] at (\bookcover at partwidth@-5mm,\bookcover at partheight@-2mm)
+            {\sffamily\scriptsize\vphantom{1}cm};
+        \end{scope}}{}
+    \end{tikzpicture}}
+\def\setruler#1#2#3#4{
+    \def\bookcover at ruler@coordsys{#1}
+    \setlength{\bookcover at ruler@xshift}{#2}
+    \setlength{\bookcover at ruler@yshift}{#3}
+    \color{#4}}
+
+%% BOOKCOVER PARTS
+\newbookcoverpart{bg back flap}{
+    \ifdim\flapwidth>0mm
+        \bookcover at ypos{\marklength}
+        \bookcover at partheight{\coverheight+2\bleedwidth}
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{\flapwidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg back}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{\coverwidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\spinewidth}
+    \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}}
+
+\newbookcoverpart{bg front}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at partwidth{\coverwidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front flap}{
+    \ifdim\flapwidth>0mm
+        \bookcover at ypos{\marklength}
+        \bookcover at partheight{\coverheight+2\bleedwidth}
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
+        \bookcover at partwidth{\flapwidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg back and flap}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength}
+    \bookcover at partwidth{\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
+
+\newbookcoverpart{bg back and spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at partwidth{\coverwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{\coverwidth+\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front and spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at partwidth{\coverwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at partwidth{\coverwidth+\spinewidth+\bleedwidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front and flap}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at partwidth{\coverwidth+\flapwidth+\bleedwidth}
+    \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}}
+
+\newbookcoverpart{bg back and flap and spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength}
+    \bookcover at partwidth{\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
+
+\newbookcoverpart{bg whole without flaps}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at partwidth{2\coverwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{0pt}{2\bleedwidth}{0pt}{\bleedwidth}
+    \else
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg front and flap and spine}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+    \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0pt}{\bleedwidth}}
+
+\newbookcoverpart{bg whole without front flap}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength}
+    \ifdim\flapwidth>0mm
+        \bookcover at partwidth{2\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}
+    \else
+        \bookcover at partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg whole without back flap}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \ifdim\flapwidth>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at partwidth{2\coverwidth+\flapwidth+\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{\bleedwidth}{2\bleedwidth}{0mm}{\bleedwidth}
+    \else
+        \bookcover at xpos{\marklength}
+        \bookcover at partwidth{2\coverwidth+2\bleedwidth+\spinewidth}
+        \bookcover at tikz@trimmed at part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}\fi}
+
+\newbookcoverpart{bg whole}{
+    \bookcover at ypos{\marklength}
+    \bookcover at partheight{\coverheight+2\bleedwidth}
+    \bookcover at xpos{\marklength}
+    \bookcover at partwidth{2\coverwidth+2\bleedwidth+2\flapwidth+\spinewidth}
+    \bookcover at tikz@trimmed at part@param{2\bleedwidth}{2\bleedwidth}{\bleedwidth}{\bleedwidth}}
+
+\newbookcoverpart{whole page}{
+    \bookcover at partheight{\paperheight}
+    \bookcover at partwidth{\paperwidth}}
+
+\newbookcoverpart{back flap}{
+    \ifdim\flapwidth>0mm
+        \bookcover at ypos{\marklength+\bleedwidth}
+        \bookcover at partheight{\coverheight}
+        \bookcover at xpos{\marklength+\bleedwidth}
+        \bookcover at partwidth{\flapwidth}\fi}
+
+\newbookcoverpart{back}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+    \bookcover at partwidth{\coverwidth}}
+
+\newbookcoverpart{spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\spinewidth}}
+
+\newbookcoverpart{front}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at partwidth{\coverwidth}}
+
+\newbookcoverpart{front flap}{
+    \ifdim\flapwidth>0mm
+        \bookcover at ypos{\marklength+\bleedwidth}
+        \bookcover at partheight{\coverheight}
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
+        \bookcover at partwidth{\flapwidth}\fi}
+
+\newbookcoverpart{above front}{
+    \ifdim\marklength>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+        \bookcover at ypos{0mm}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at partheight{\marklength}\fi}
+
+\newbookcoverpart{below front}{
+    \ifdim\marklength>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+        \bookcover at ypos{\marklength+2\bleedwidth+\coverheight}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at partheight{\marklength}\fi}
+
+\newbookcoverpart{above back}{
+    \ifdim\marklength>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at ypos{0mm}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at partheight{\marklength}\fi}
+
+\newbookcoverpart{below back}{
+    \ifdim\marklength>0mm
+        \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+        \bookcover at ypos{\marklength+2\bleedwidth+\coverheight}
+        \bookcover at partwidth{\coverwidth}
+        \bookcover at partheight{\marklength}\fi}
+
+\newbookcoverpart{back and flap}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth}
+    \bookcover at partwidth{\flapwidth+\coverwidth}
+    \bookcover at partheight{\coverheight}}
+
+\newbookcoverpart{back and spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+    \bookcover at partwidth{\coverwidth+\spinewidth}}
+
+\newbookcoverpart{front and spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\coverwidth+\spinewidth}}
+
+\newbookcoverpart{front and flap}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at partwidth{\coverwidth+\flapwidth}}
+
+\newbookcoverpart{back and flap and spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at xpos{\marklength+\bleedwidth}
+    \bookcover at partwidth{\flapwidth+\coverwidth+\spinewidth}
+    \bookcover at partheight{\coverheight}}
+
+\newbookcoverpart{whole without flaps}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+    \bookcover at partwidth{2\coverwidth+\spinewidth}}
+
+\newbookcoverpart{front and flap and spine}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth}
+    \bookcover at partwidth{\coverwidth+\flapwidth+\spinewidth}}
+
+\newbookcoverpart{whole without front flap}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth}
+    \bookcover at partwidth{2\coverwidth+\flapwidth+\spinewidth}}
+
+\newbookcoverpart{whole without back flap}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth}
+    \bookcover at partwidth{2\coverwidth+\flapwidth+\spinewidth}}
+
+\newbookcoverpart{whole}{
+    \bookcover at ypos{\marklength+\bleedwidth}
+    \bookcover at partheight{\coverheight}
+    \bookcover at xpos{\marklength+\bleedwidth}
+    \bookcover at partwidth{2\coverwidth+2\flapwidth+\spinewidth}}
+
+%%%%%%%%%%%%%%%%
+%% OLD METHOD %%
+%%%%%%%%%%%%%%%%
+
+%% MAIN LAYERS
+\def\bookcover at bgcolor#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        \tikz\fill\expandafter[#1] (0,0) rectangle (\bookcover at partwidth@,\bookcover at partheight@);
+    \end{textblock*}}
+
+\def\bookcover at bgpic#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        \includegraphics[width=\bookcover at partwidth@,height=\bookcover at partheight@]{#1}
+    \end{textblock*}}
+
+\def\bookcover at bgtikz#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+     \ifbookcover at bgtikznodes
+        \begin{tikzpicture}[overlay,yshift=-\bookcover at partheight@]
+        \begin{scope}[transparent,line width=0pt]
+            \pgfset{minimum width=\bookcover at partwidth@,minimum height=\bookcover at partheight@}
+            \pgfnode{rectangle}{south west}{}{current part}{\pgfusepath{draw}}% for v1.1.1
+            \pgfnode{rectangle}{south west}{}{part}{\pgfusepath{draw}}
+            \pgfset{minimum width=\bookcover at partwidth@-\bookcover at tikz@trimmed at part@width at minus,
+                    minimum height=\bookcover at partheight@-\bookcover at tikz@trimmed at part@height at minus}
+            \pgftransformshift{\pgfpoint{\bookcover at tikz@trimmed at part@push at right}
+                                        {\bookcover at tikz@trimmed at part@push at up}}
+            \pgfnode{rectangle}{south west}{}{current trimmed part}{\pgfusepath{draw}}% for v1.1.1
+            \pgfnode{rectangle}{south west}{}{trimmed part}{\pgfusepath{draw}}
+        \end{scope}
+        \ifbookcover at bgtikzclip
+            \clip (part.south west) rectangle (part.north east);\fi
+    \else\begin{tikzpicture}\fi
+        #1
+        \end{tikzpicture}
+    \end{textblock*}}
+
+\def\bookcover at fg#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        \parbox[t][\bookcover at partheight@][t]{\bookcover at partwidth@}{#1}
+    \end{textblock*}}
+
+\def\bookcover at remark#1{
+    \begin{textblock*}{\bookcover at partwidth@}(\bookcover at xpos@,\bookcover at ypos@)
+        \parbox[t][\bookcover at partheight@][c]{\bookcover at partwidth@}{\begin{center}#1\end{center}}
+    \end{textblock*}}
+
 %% RESET DATAS
 \def\bookcover at reset{
     \def\bookcover at bgcolor@whole{}
@@ -237,16 +785,16 @@
     \def\bookcover at fgsecond@frontflap{}}
 \bookcover at reset
 
-%% SETBOOKCOVER
+%% SET BOOKCOVER
 \long\def\setbookcover#1#2#3{
     \ifthenelse{\equal{#1}{bgcolor}}{
-        \ifthenelse{\equal{#2}{whole}}{\def\bookcover at bgcolor@whole{[#3]}}{}
-        \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover at bgcolor@wholewf{[#3]}}{}
-        \ifthenelse{\equal{#2}{back}}{\def\bookcover at bgcolor@back{[#3]}}{}
-        \ifthenelse{\equal{#2}{front}}{\def\bookcover at bgcolor@front{[#3]}}{}
-        \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at bgcolor@backflap{[#3]}}{}
-        \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at bgcolor@frontflap{[#3]}}{}
-        \ifthenelse{\equal{#2}{spine}}{\def\bookcover at bgcolor@spine{[#3]}}{}}{}
+        \ifthenelse{\equal{#2}{whole}}{\def\bookcover at bgcolor@whole{#3}}{}
+        \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover at bgcolor@wholewf{#3}}{}
+        \ifthenelse{\equal{#2}{back}}{\def\bookcover at bgcolor@back{#3}}{}
+        \ifthenelse{\equal{#2}{front}}{\def\bookcover at bgcolor@front{#3}}{}
+        \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at bgcolor@backflap{#3}}{}
+        \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at bgcolor@frontflap{#3}}{}
+        \ifthenelse{\equal{#2}{spine}}{\def\bookcover at bgcolor@spine{#3}}{}}{}
     \ifthenelse{\equal{#1}{bgpic}}{
         \ifthenelse{\equal{#2}{whole}}{\def\bookcover at bgpic@whole{#3}}{}
         \ifthenelse{\equal{#2}{whole without flaps}}{\def\bookcover at bgpic@wholewf{#3}}{}
@@ -269,7 +817,7 @@
         \ifthenelse{\equal{#2}{spine}}{\def\bookcover at fgfirst@spine{#3}}{}
         \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at fgfirst@backflap{#3}}{}
         \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at fgfirst@frontflap{#3}}{}
-        \ifthenelse{\equal{#2}{remark}}{\def\bookcover at fgfirst@abovefront{#3}}{}% for version 1.0
+        \ifthenelse{\equal{#2}{remark}}{\def\bookcover at fgfirst@abovefront{#3}}{}% for v1.0
         \ifthenelse{\equal{#2}{above front}}{\def\bookcover at fgfirst@abovefront{#3}}{}
         \ifthenelse{\equal{#2}{below front}}{\def\bookcover at fgfirst@belowfront{#3}}{}
         \ifthenelse{\equal{#2}{above back}}{\def\bookcover at fgfirst@aboveback{#3}}{}
@@ -281,7 +829,7 @@
         \ifthenelse{\equal{#2}{back flap}}{\def\bookcover at fgsecond@backflap{#3}}{}
         \ifthenelse{\equal{#2}{front flap}}{\def\bookcover at fgsecond@frontflap{#3}}{}}{}}
 
-%% MAKEBOOKCOVER
+%% MAKE BOOKCOVER
 \def\makebookcover{
 %% background parameters
 \bookcover at ypos{\marklength}
@@ -490,7 +1038,7 @@
     \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth}
     \bookcover at partwidth{\flapwidth}
     \bookcover at fg{\bookcover at fgfirst@frontflap}\fi\fi
-%% {fgfirst}{above front} = {fgfirst}{remark} in version 1.0
+%% {fgfirst}{above front} = {fgfirst}{remark} in v1.0
 \ifx\bookcover at fgfirst@abovefront\@empty\else\ifdim\marklength>0mm
     \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth}
     \bookcover at ypos{0mm}
@@ -518,77 +1066,12 @@
     \bookcover at partwidth{\coverwidth}
     \bookcover at partheight{\marklength}
     \bookcover at remark{\bookcover at fgfirst@belowback}\fi\fi
-%% mark top parameters
-\bookcover at ypos{0mm}
-\bookcover at partwidth{\markthick}
-%% mark top 1
-\bookcover at xpos{\marklength+\bleedwidth-.5\markthick}
-\bookcover at vmark
-%% mark top 2
-\ifdim\flapwidth>0mm
-    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
-    \bookcover at vmark\fi
-%% mark top 3
-\bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
-\bookcover at vmark
-%% mark top 4
-\bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
-\bookcover at vmark
-%% mark top 5
-\ifdim\flapwidth>0mm
-    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
-    \bookcover at vmark\fi
-%% mark top 6
-\bookcover at xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
-\bookcover at vmark
-%% mark bottom parameters
-\bookcover at ypos{\paperheight-\marklength}
-\bookcover at partwidth{\markthick}
-%% mark bottom 1
-\bookcover at xpos{\marklength+\bleedwidth-.5\markthick}
-\bookcover at vmark
-%% mark bottom 2
-\ifdim\flapwidth>0mm
-    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth-.5\markthick}
-    \bookcover at vmark\fi
-%% mark bottom 3
-\bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth-.5\markthick}
-\bookcover at vmark
-%% mark bottom 4
-\bookcover at xpos{\marklength+\bleedwidth+\flapwidth+\coverwidth+\spinewidth-.5\markthick}
-\bookcover at vmark
-%% mark bottom 5
-\ifdim\flapwidth>0mm
-    \bookcover at xpos{\marklength+\bleedwidth+\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
-    \bookcover at vmark\fi
-%% mark bottom 6
-\bookcover at xpos{\marklength+\bleedwidth+2\flapwidth+2\coverwidth+\spinewidth-.5\markthick}
-\bookcover at vmark
-%% mark left parameters
-\bookcover at xpos{0mm}
-\bookcover at partwidth{\marklength}
-%% mark left 1
-\bookcover at ypos{\marklength+\bleedwidth-.5\markthick}
-\bookcover at hmark
-%% mark left 2
-\bookcover at ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
-\bookcover at hmark
-%% mark right parameters
-\bookcover at xpos{\paperwidth-\marklength}
-\bookcover at partwidth{\marklength}
-%% mark right 1
-\bookcover at ypos{\marklength+\bleedwidth-.5\markthick}
-\bookcover at hmark
-%% mark right 2
-\bookcover at ypos{\marklength+\bleedwidth+\coverheight-.5\markthick}
-\bookcover at hmark
+%% marks
+\bookcover at marks
 %% trimming
-\ifbookcover at trimmed
-    \bookcover at trimming\fi
+\ifbookcover at trimmed\bookcover at trimming\fi
 %% new book cover
-\mbox{}
-\newpage
-\bookcover at reset}
+\mbox{}\newpage\bookcover at reset}
 \endinput
 %%
 %% End of file `bookcover.cls'.



More information about the tex-live-commits mailing list