diff options
author | Norbert Preining <norbert@preining.info> | 2021-07-15 03:01:01 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-07-15 03:01:01 +0000 |
commit | 55ae461252a599d6bc951065a37c16a8971fc560 (patch) | |
tree | 1b73269f29ae053c3fa9f00a365b009569df721a /macros/latex/contrib/kdpbook | |
parent | 3303a89b11161d66ec78811056b85306f696cc09 (diff) |
CTAN sync 202107150300
Diffstat (limited to 'macros/latex/contrib/kdpbook')
-rw-r--r-- | macros/latex/contrib/kdpbook/DEPENDS.txt | 2 | ||||
-rw-r--r-- | macros/latex/contrib/kdpbook/README.md | 9 | ||||
-rw-r--r-- | macros/latex/contrib/kdpbook/kdpcover-signature.pdf (renamed from macros/latex/contrib/kdpbook/images/signature.pdf) | bin | 7256 -> 7256 bytes | |||
-rw-r--r-- | macros/latex/contrib/kdpbook/kdpcover-vol-1.pdf (renamed from macros/latex/contrib/kdpbook/images/volume-1.pdf) | bin | 8540 -> 8540 bytes | |||
-rw-r--r-- | macros/latex/contrib/kdpbook/kdpcover-vol-2.pdf (renamed from macros/latex/contrib/kdpbook/images/volume-2.pdf) | bin | 6504 -> 6504 bytes | |||
-rw-r--r-- | macros/latex/contrib/kdpbook/kdpcover-vol-3.pdf (renamed from macros/latex/contrib/kdpbook/images/volume-3.pdf) | bin | 7156 -> 7156 bytes | |||
-rw-r--r-- | macros/latex/contrib/kdpbook/kdpcover-vol-4.pdf (renamed from macros/latex/contrib/kdpbook/images/volume-4.pdf) | bin | 6723 -> 6723 bytes | |||
-rw-r--r-- | macros/latex/contrib/kdpbook/kdpcover.cls | 32 | ||||
-rw-r--r-- | macros/latex/contrib/kdpbook/kdpcover.pdf | bin | 104845 -> 103975 bytes | |||
-rw-r--r-- | macros/latex/contrib/kdpbook/kdpcover.tex | 4 |
10 files changed, 16 insertions, 31 deletions
diff --git a/macros/latex/contrib/kdpbook/DEPENDS.txt b/macros/latex/contrib/kdpbook/DEPENDS.txt index 2be9f7df5e..75af288d41 100644 --- a/macros/latex/contrib/kdpbook/DEPENDS.txt +++ b/macros/latex/contrib/kdpbook/DEPENDS.txt @@ -1,4 +1,4 @@ -hard shellesc +hard iexec hard xkeyval hard anyfontsize hard tikz diff --git a/macros/latex/contrib/kdpbook/README.md b/macros/latex/contrib/kdpbook/README.md index 5c5765b4fc..a3fe02d0f9 100644 --- a/macros/latex/contrib/kdpbook/README.md +++ b/macros/latex/contrib/kdpbook/README.md @@ -1,4 +1,4 @@ -[![make](https://github.com/yegor256/kdpcover/actions/workflows/make.yml/badge.svg)](https://github.com/yegor256/kdpcover/actions/workflows/make.yml) +[![make](https://github.com/yegor256/kdpcover/actions/workflows/latexmk.yml/badge.svg)](https://github.com/yegor256/kdpcover/actions/workflows/latexmk.yml) [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/kdpcover/blob/master/LICENSE.txt) This LaTeX class I use to format covers for [my books](https://www.yegor256.com/books.html), @@ -7,7 +7,7 @@ The problem this class solves is [the necessity](https://kdp.amazon.com/en_US/he to change the size of the cover PDF respectfully to the number of pages in the book — the bigger the book, the larger must be the cover. The provided class makes necessary -calculations on-fly, using the `qpdf` took from GhostScript. Obviously, +calculations on-fly, using the [`qpdf`](http://qpdf.sourceforge.net/) tool. Obviously, you need to have it installed. Also, you must run `pdflatex` with the `--shell-escape` option, in order to allow LaTeX to run `qpdf`. @@ -18,14 +18,15 @@ and then use in the preamble: ```tex \documentclass[pdf=my-book.pdf]{kdpcover} \begin{document} -% Here you print the cover as you with, but I recommend +% Here you print the cover as you wish, but I recommend % you to use the commands available in the class, such as: \putSpine{my book, vol. 1} \putAuthor{Yegor Bugayenko} \end{document} ``` -The full example and all commands are available in the `kdpcover.tex` file. +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. diff --git a/macros/latex/contrib/kdpbook/images/signature.pdf b/macros/latex/contrib/kdpbook/kdpcover-signature.pdf Binary files differindex af185666b2..af185666b2 100644 --- a/macros/latex/contrib/kdpbook/images/signature.pdf +++ b/macros/latex/contrib/kdpbook/kdpcover-signature.pdf diff --git a/macros/latex/contrib/kdpbook/images/volume-1.pdf b/macros/latex/contrib/kdpbook/kdpcover-vol-1.pdf Binary files differindex 8ccf53f517..8ccf53f517 100644 --- a/macros/latex/contrib/kdpbook/images/volume-1.pdf +++ b/macros/latex/contrib/kdpbook/kdpcover-vol-1.pdf diff --git a/macros/latex/contrib/kdpbook/images/volume-2.pdf b/macros/latex/contrib/kdpbook/kdpcover-vol-2.pdf Binary files differindex 4dd3c14199..4dd3c14199 100644 --- a/macros/latex/contrib/kdpbook/images/volume-2.pdf +++ b/macros/latex/contrib/kdpbook/kdpcover-vol-2.pdf diff --git a/macros/latex/contrib/kdpbook/images/volume-3.pdf b/macros/latex/contrib/kdpbook/kdpcover-vol-3.pdf Binary files differindex a554387e49..a554387e49 100644 --- a/macros/latex/contrib/kdpbook/images/volume-3.pdf +++ b/macros/latex/contrib/kdpbook/kdpcover-vol-3.pdf diff --git a/macros/latex/contrib/kdpbook/images/volume-4.pdf b/macros/latex/contrib/kdpbook/kdpcover-vol-4.pdf Binary files differindex a2d12b0d43..a2d12b0d43 100644 --- a/macros/latex/contrib/kdpbook/images/volume-4.pdf +++ b/macros/latex/contrib/kdpbook/kdpcover-vol-4.pdf diff --git a/macros/latex/contrib/kdpbook/kdpcover.cls b/macros/latex/contrib/kdpbook/kdpcover.cls index 91603e47bf..1e33276217 100644 --- a/macros/latex/contrib/kdpbook/kdpcover.cls +++ b/macros/latex/contrib/kdpbook/kdpcover.cls @@ -21,34 +21,18 @@ % SOFTWARE. \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{kdpcover}[2021/06/04 0.1.0 Cover for KDP book] +\ProvidesClass{kdpcover}[2021/07/14 0.2.1 Cover for KDP book] \LoadClass{article} \newcommand*\kdppages{100} \newlength\kdpxsize \newlength\kdpysize -\RequirePackage{shellesc} +\RequirePackage{iexec} \RequirePackage{xkeyval} -\DeclareOptionX{6x9}{ - \setlength\kdpxsize{6in} - \setlength\kdpysize{9in} -} +\DeclareOptionX{6x9}{\setlength\kdpxsize{6in}\setlength\kdpysize{9in}} \DeclareOptionX{pages}{\renewcommand*\kdppages{#1}} -\makeatletter\newcommand{\kdpexec}[3][1=]{% - \begingroup - \let\%\@percentchar - \let\{\@charlb - \let\}\@charrb - \ShellEscape{#3 > #2}% - \endgroup% - \ifthenelse{\isempty{#1}}{\input{#2}}{}% -}\makeatother -\makeatletter\let\primitiveinput\@@input\makeatother% -\DeclareOptionX{pdf}{ - \kdpexec[noprint]{totalpages.exc}{qpdf --show-npages #1 | tr -d '[[:space:]]' | \{ cat; echo \%; \}}% - \renewcommand{\kdppages}{\primitiveinput totalpages.exc } -} +\DeclareOptionX{pdf}{\renewcommand*{\kdppages}{\iexec{qpdf --show-npages #1 | tr -d '[[:space:]]' | \{ cat; echo \%; \}}}} \ProcessOptionsX\relax \RequirePackage{anyfontsize} @@ -74,7 +58,7 @@ \RequirePackage[absolute]{textpos} \TPGrid{16}{16} -\newcommand\putSpine[2]{ +\newcommand\putSpine[2][kdpcover-signature]{ \begin{textblock}{2.4}[0.5,0](8,0) \begin{tikzpicture} \node [rectangle, inner sep=0em, fill=black, minimum width=2.4\TPHorizModule, minimum height=16\TPVertModule] at (0,0) {}; @@ -88,7 +72,7 @@ \end{tikzpicture} \end{textblock} \begin{textblock}{2.4}[0.5,1](8,14) - \centerline{\includegraphics[width=0.32in]{#2}} + \centerline{\includegraphics[width=0.32in]{#1}} \end{textblock} } @@ -101,7 +85,7 @@ \newcommand\putVolume[1]{ \begin{textblock}{2}[1,1](15,14) \raggedleft - \includegraphics[height=0.4in]{images/volume-#1} + \includegraphics[height=0.4in]{kdpcover-vol-#1} \end{textblock} } @@ -139,7 +123,7 @@ \begin{textblock}{4}[0,1](10,14) #1 \quad - \kdpexec[]{date.exc}{git log -n 1 --pretty='format:\%ad' --date='format:\%e-\%b-\%Y'} + \iexec{git log -n 1 --pretty='format:\%ad' --date='format:\%e-\%b-\%Y'} \end{textblock} } diff --git a/macros/latex/contrib/kdpbook/kdpcover.pdf b/macros/latex/contrib/kdpbook/kdpcover.pdf Binary files differindex 7c9f844d5a..0b99980c10 100644 --- a/macros/latex/contrib/kdpbook/kdpcover.pdf +++ b/macros/latex/contrib/kdpbook/kdpcover.pdf diff --git a/macros/latex/contrib/kdpbook/kdpcover.tex b/macros/latex/contrib/kdpbook/kdpcover.tex index ef2c073d60..93b9f91eac 100644 --- a/macros/latex/contrib/kdpbook/kdpcover.tex +++ b/macros/latex/contrib/kdpbook/kdpcover.tex @@ -28,7 +28,7 @@ % a good practice to mention the volume number at the end of the text, % if you have more than one volume, e.g. "my book, vol. 1". I suggest % using small caps in the text only. -\putSpine{kdpcover, a LaTeX class for KDP books}{./images/signature} +\putSpine{kdpcover, a LaTeX class for KDP books} % This one prints the volume picture. It is intentionally made large, % in order to make it obvious. @@ -37,7 +37,7 @@ % Here we print the version and it will also add the date of the latest % Git commit in the current directory. If it's not a Git repository, % the date won't be printed. -\putVersion{0.1.0} +\putVersion{0.2.1} % This prints the price, which is a good practice to mention, I believe. \putPrice{\$0.00} |