summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-11-30 20:30:37 +0000
committerKarl Berry <karl@freefriends.org>2022-11-30 20:30:37 +0000
commite05e0ef0bb5bf445d47c31fc60e4591e0f81f89b (patch)
tree86fde0e4d34ebdcf6c4f7dfc014a428abf8919dc
parent8624a5d970faf95011e4ab23ae9e567bc93a8575 (diff)
kdpcover (30nov22)
git-svn-id: svn://tug.org/texlive/trunk@65150 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt3
-rw-r--r--Master/texmf-dist/doc/latex/kdpcover/README.md3
-rw-r--r--Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdfbin260022 -> 368603 bytes
-rw-r--r--Master/texmf-dist/doc/latex/kdpcover/yb-book-logo.pdfbin0 -> 5216 bytes
-rw-r--r--Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx65
-rw-r--r--Master/texmf-dist/source/latex/kdpcover/kdpcover.ins8
-rw-r--r--Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls9
7 files changed, 48 insertions, 40 deletions
diff --git a/Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt b/Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt
index c4c670d01b7..e07680365e0 100644
--- a/Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt
+++ b/Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt
@@ -6,4 +6,5 @@ hard microtype
hard xcolor
hard setspace
hard geometry
-hard textpos \ No newline at end of file
+hard textpos
+hard etoolbox \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/kdpcover/README.md b/Master/texmf-dist/doc/latex/kdpcover/README.md
index a50e85a40ab..6563185c6e9 100644
--- a/Master/texmf-dist/doc/latex/kdpcover/README.md
+++ b/Master/texmf-dist/doc/latex/kdpcover/README.md
@@ -26,9 +26,6 @@ and then use in the preamble:
\end{document}
```
-The full example and all commands are available in the
-[`kdpcover.tex`](https://github.com/yegor256/kdpcover/blob/master/kdpcover.tex) file.
-
If you want to contribute yourself, make a fork, then create a branch,
then run `make` in the root directory.
It should compile everything without errors. If not, submit an issue and wait.
diff --git a/Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf b/Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf
index a59838ee2a3..6280c2cb4ea 100644
--- a/Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf
+++ b/Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/kdpcover/yb-book-logo.pdf b/Master/texmf-dist/doc/latex/kdpcover/yb-book-logo.pdf
new file mode 100644
index 00000000000..5d49cb9daa4
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/kdpcover/yb-book-logo.pdf
Binary files differ
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}
diff --git a/Master/texmf-dist/source/latex/kdpcover/kdpcover.ins b/Master/texmf-dist/source/latex/kdpcover/kdpcover.ins
index e5b5eccbd56..64a5d011068 100644
--- a/Master/texmf-dist/source/latex/kdpcover/kdpcover.ins
+++ b/Master/texmf-dist/source/latex/kdpcover/kdpcover.ins
@@ -48,8 +48,8 @@ SOFTWARE.
\endpreamble
\generate{\file{kdpcover.cls}{\from{kdpcover.dtx}{class}}}
\obeyspaces
-\Msg{*** To finish the installation you have to move the ".cls"}
-\Msg{*** file into a directory searched by TeX. To produce the}
-\Msg{*** documentation run the file ".dtx" through LaTeX. If any}
-\Msg{*** questions, submit a new GitHub issue.}
+\Msg{To finish the installation you have to move the ".cls"}
+\Msg{file into a directory searched by TeX. To produce the}
+\Msg{documentation run the file ".dtx" through LaTeX. If any}
+\Msg{questions, submit a new GitHub issue.}
\endbatchfile
diff --git a/Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls b/Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls
index 28feb70560b..125fa6c0526 100644
--- a/Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls
+++ b/Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls
@@ -31,7 +31,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{kdpcover}
-[02.10.2022 0.4.0 Cover for Kindle Direct Publishing books]
+[2022.11.30 0.5.1 Cover for Kindle Direct Publishing books]
@@ -55,6 +55,8 @@
+\LoadClass{article}
+
\makeatletter
\newcommand*\kdp@pages{100}
\newlength\kdp@xsize
@@ -184,8 +186,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}%
}