summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx')
-rw-r--r--Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx65
1 files changed, 36 insertions, 29 deletions
diff --git a/Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx b/Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx
index 0d3fc2b2b08..da1ab39d4d3 100644
--- a/Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx
+++ b/Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx
@@ -50,13 +50,16 @@
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{kdpcover}
%<*class>
-[02.10.2022 0.4.0 Cover for Kindle Direct Publishing books]
+[2022.11.30 0.5.1 Cover for Kindle Direct Publishing books]
%</class>
%<*driver>
\documentclass{ltxdoc}
\usepackage[tt=false, type1=true]{libertine}
+\usepackage{microtype}
+\AddToHook{env/verbatim/begin}{\microtypesetup{protrusion=false}}
\usepackage{href-ul}
-\raggedbottom
+\usepackage[dtx,margin=0,small]{docshots}
+\usepackage{graphicx}
\PageIndex
\EnableCrossrefs
\CodelineIndex
@@ -69,7 +72,7 @@
%</driver>
% \fi
-% \title{|kdpcover|: \LaTeX{} Package \\ for Amazon Book Covers\thanks{The sources are in GitHub at \href{https://github.com/yegor256/kdpcover}{yegor256/kdpcover}}}
+% \title{\includegraphics[width=0.75in]{yb-book-logo.pdf} \\ |kdpcover|: \LaTeX{} Package \\ for Amazon Book Covers\thanks{The sources are in GitHub at \href{https://github.com/yegor256/kdpcover}{yegor256/kdpcover}}}
% \author{Yegor Bugayenko \\ \texttt{yegor256@gmail.com}}
% \date{\filedate, \fileversion}
%
@@ -78,29 +81,26 @@
% \section{Introduction}
%
+% \changes{v0.5.0}{2022/11/29}{The \texttt{docshots} package is used to render the documentation.}
% This class will render you a book cover, suitable for Kindle Direct Publishing (KDP).
% I use it for \href{https://amzn.to/2WMTXWF}{all my books}.
% This is how you make your \LaTeX{} document look like:
-%\iffalse
-%<*verb>
-%\fi
-\begin{verbatim}
-\documentclass[pages=200,6x9]{kdpcover}
-\begin{document}
-\putSpine{kdpcover, a LaTeX class for KDP books}
-\putVolume{1}
-\putVersion{0.4.0}
-\putPrice{\$0.00}
-\putCopyright{\the\year}{Yegor Bugayenko}
-\putTitle{kdpcover}
-\putAuthor{Yegor Bugayenko}
-\putTLDR{This book will tell you an interesting story!}
-\putPicture{cactus.pdf}
-\end{document}
-\end{verbatim}
-%\iffalse
-%</verb>
-%\fi
+% \docshotPrerequisite{cactus.pdf}
+% \begin{docshot}
+% \documentclass[pages=200,6x9]{kdpcover}
+% \begin{document}
+% \putSpine{kdpcover, a LaTeX class for KDP books}
+% \putVolume{1}
+% \putVersion{0.5.1}
+% \putPrice{\$0.00}
+% \putCopyright{\the\year}{Yegor Bugayenko}
+% \putTitle{kdpcover}
+% \putAuthor{Yegor Bugayenko}
+% \putTLDR{This book will tell you
+% an interesting story!}
+% \putPicture{cactus.pdf}
+% \end{document}
+% \end{docshot}
% The problem this class solves is the necessity to change the size of the
% cover PDF according to the number of pages in the book --- the bigger the book,
@@ -143,7 +143,7 @@
%\fi
% \end{macro}
-% \begin{macro}{9x6}
+% \begin{macro}{6x9}
% With this option you can set the size of the page to 6x9 inches.
% You can also set your own size like this:
%\iffalse
@@ -208,7 +208,7 @@
% name of the author.
% \end{macro}
-% \begin{macro}{\putCopyright}
+% \begin{macro}{\putTitle}
% This one prints the title of the book
% \end{macro}
@@ -221,7 +221,7 @@
% of the entire book.
% \end{macro}
-% \begin{macro}{\putTLDR}
+% \begin{macro}{\putPicture}
% This one prints the front picture. You can use |cactus.pdf|.
% \end{macro}
@@ -236,7 +236,13 @@
% \changes{v0.2.0}{2021/07/14}{Initial version}
-% First, we define a few internal commands:
+% First, we load our parent class:
+% \changes{v0.5.0}{2022/11/29}{The base class is now \texttt{article}.}
+% \begin{macrocode}
+\LoadClass{article}
+% \end{macrocode}
+
+% Then, we define a few internal commands:
% \begin{macrocode}
\makeatletter
\newcommand*\kdp@pages{100}
@@ -436,8 +442,9 @@
\newcommand\putVersion[1]{%
\begin{textblock}{4}[0,1](10,14)%
#1
- \quad
- \iexec{git log -n 1 --pretty='format:\%ad' --date='format:\%e-\%b-\%Y'}
+ \IfFileExists{.git}
+ {\quad\iexec{git log -n 1 --pretty='format:\%ad' --date='format:\%e-\%b-\%Y'}}
+ {}
\end{textblock}%
}
% \end{macrocode}