diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-02 20:18:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-02 20:18:52 +0000 |
commit | ab912a2b4e973f642f3549eb9831e30be9eb580c (patch) | |
tree | 26fa30e0fe572cd3789baa7f67422e6cb462fe85 | |
parent | 1bb1c5dc96daf4c438e0a7929f64d14b968ca5ca (diff) |
kdpcover (2oct22)
git-svn-id: svn://tug.org/texlive/trunk@64582 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/kdpcover/LICENSE.txt | 21 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/kdpcover/README.md | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/kdpcover/cactus.pdf | bin | 0 -> 47687 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf | bin | 104667 -> 260022 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/kdpcover/kdpcover.tex | 93 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx | 475 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/kdpcover/kdpcover.ins | 55 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls | 138 |
9 files changed, 645 insertions, 146 deletions
diff --git a/Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt b/Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt index e33e2679576..c4c670d01b7 100644 --- a/Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt +++ b/Master/texmf-dist/doc/latex/kdpcover/DEPENDS.txt @@ -1,11 +1,9 @@ hard iexec hard xkeyval hard anyfontsize -hard tikz +hard pgf hard microtype hard xcolor -hard graphicx -hard calc hard setspace hard geometry -hard textpos +hard textpos
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/kdpcover/LICENSE.txt b/Master/texmf-dist/doc/latex/kdpcover/LICENSE.txt new file mode 100644 index 00000000000..bd949ffdabc --- /dev/null +++ b/Master/texmf-dist/doc/latex/kdpcover/LICENSE.txt @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2021-2022 Yegor Bugayenko + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the 'Software'), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Master/texmf-dist/doc/latex/kdpcover/README.md b/Master/texmf-dist/doc/latex/kdpcover/README.md index a3fe02d0f99..a50e85a40ab 100644 --- a/Master/texmf-dist/doc/latex/kdpcover/README.md +++ b/Master/texmf-dist/doc/latex/kdpcover/README.md @@ -1,4 +1,5 @@ -[](https://github.com/yegor256/kdpcover/actions/workflows/latexmk.yml) +[](https://github.com/yegor256/kdpcover/actions/workflows/l3build.yml) +[](https://ctan.org/pkg/kdpcover) [](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), diff --git a/Master/texmf-dist/doc/latex/kdpcover/cactus.pdf b/Master/texmf-dist/doc/latex/kdpcover/cactus.pdf Binary files differnew file mode 100644 index 00000000000..f42d027a49c --- /dev/null +++ b/Master/texmf-dist/doc/latex/kdpcover/cactus.pdf diff --git a/Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf b/Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf Binary files differindex 984c26469bd..a59838ee2a3 100644 --- a/Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf +++ b/Master/texmf-dist/doc/latex/kdpcover/kdpcover.pdf diff --git a/Master/texmf-dist/doc/latex/kdpcover/kdpcover.tex b/Master/texmf-dist/doc/latex/kdpcover/kdpcover.tex deleted file mode 100644 index 793ba90b013..00000000000 --- a/Master/texmf-dist/doc/latex/kdpcover/kdpcover.tex +++ /dev/null @@ -1,93 +0,0 @@ -% (The MIT License) -% -% Copyright (c) 2021-2022 Yegor Bugayenko -% -% Permission is hereby granted, free of charge, to any person obtaining a copy -% of this software and associated documentation files (the 'Software'), to deal -% in the Software without restriction, including without limitation the rights -% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -% copies of the Software, and to permit persons to whom the Software is -% furnished to do so, subject to the following conditions: -% -% The above copyright notice and this permission notice shall be included in all -% copies or substantial portions of the Software. -% -% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -% SOFTWARE. - -% Here we set the total count of the pages in the book and set the size -% of the page to 6x9 inches. You can set your own size like this: -% \setlength\kdpxsize{8.1in} -% \setlength\kdpysize{12.7in} -% It's better not to use "pages" option here, but to let it calculate -% the size of your book from the PDF file. Just say "pdf=book.pdf" and it -% will be calculated automatically. -% -% To get rid of the black bar at the center of the page, just add -% "barless" option here. -\documentclass[pages=200,6x9]{kdpcover} - -\begin{document} -% Here we put the vertical black spine line with two white elements -% inside: the text at the top and the logo at the bottom. Make sure -% the text is short enough so that it doesn't touch the logo. It's -% 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} - -% This one prints the volume picture. It is intentionally made large, -% in order to make it obvious. -\putVolume{1} - -% 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.3.0} - -% This prints the price, which is a good practice to mention, I believe. -\putPrice{\$0.00} - -% This one prints the copyright short message with the year and the -% name of the autor. -\putCopyright{\the\year}{Yegor Bugayenko} - -% Here we print the title of the book -\putTitle{kdpcover} - -% Here we print the author. -\putAuthor{Yegor Bugayenko} - -% Here we print the TL;DR paragraph, which summarizies the message -% of the entire book. -\putTLDR{I use this LaTeX class to design covers for my books published -by Kindle Direct Publishing; you also can do it, provided you like the layout and the style.} - -% The picture. -\putPicture{cactus.pdf} - -% This is the text on the back of the book, which usually I suggest -% to omit and keep the back empty and white. -\putBack{ - You need to either specify the number of pages - in your PDF book, or provide the path to the PDF. - In the latter case, the pages will be counted using - "qpdf," which has to be installed: - \newline\newline - \char`\\documentclass[pages=200,pdf=book.pdf]\string{kdpcover\string}\newline - \char`\\begin\string{document\string}\newline - \char`\\putSpine\string{my book\string}\newline - \char`\\end\string{document\string} - \newline\newline - See the file "kdpcover.tex" for a full example with all - available commands and class options. - \newline\newline - Even more details you can find on GitHub:\newline - https://github.com/yegor256/kdpcover -} -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx b/Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx new file mode 100644 index 00000000000..0d3fc2b2b08 --- /dev/null +++ b/Master/texmf-dist/source/latex/kdpcover/kdpcover.dtx @@ -0,0 +1,475 @@ +% \iffalse meta-comment +% (The MIT License) +% +% Copyright (c) 2021-2022 Yegor Bugayenko +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the 'Software'), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all +% copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +% SOFTWARE. +% \fi + +% \CheckSum{0} +% +% \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 +% Lower-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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} + +% \GetFileInfo{kdpcover.dtx} +% \DoNotIndex{\endgroup,\begingroup,\let,\else,\fi,\newcommand,\newenvironment} + +% \iffalse +%<*driver> +\ProvidesFile{kdpcover.dtx} +%</driver> +%<class>\NeedsTeXFormat{LaTeX2e} +%<class>\ProvidesClass{kdpcover} +%<*class> +[02.10.2022 0.4.0 Cover for Kindle Direct Publishing books] +%</class> +%<*driver> +\documentclass{ltxdoc} +\usepackage[tt=false, type1=true]{libertine} +\usepackage{href-ul} +\raggedbottom +\PageIndex +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{kdpcover.dtx} + \PrintChanges + \PrintIndex +\end{document} +%</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}}} +% \author{Yegor Bugayenko \\ \texttt{yegor256@gmail.com}} +% \date{\filedate, \fileversion} +% +% \maketitle +% +% \section{Introduction} +% + +% 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 + +% 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, +% the larger the spine of the book must be. The provided class makes +% the necessary calculations on-the-fly, using the |qpdf| 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|. + +% \section{Class Options} + +% \begin{macro}{pages} +% With |pages| you can set the total count of the pages in the book: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\documentclass[pages=120]{kdpcover} +\begin{document} +\end{document} +\end{verbatim} +%\iffalse +%</verb> +%\fi +% \end{macro} + +% \begin{macro}{pdf} +% It's better not to use |pages| option, but let the class calculate +% the size of your book from the PDF file (using |qpdf| command line +% tool, which has to be installed): +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\documentclass[pdf=book.pdf]{kdpcover} +\begin{document} +\end{document} +\end{verbatim} +%\iffalse +%</verb> +%\fi +% \end{macro} + +% \begin{macro}{9x6} +% With this option you can set the size of the page to 6x9 inches. +% You can also set your own size like this: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\documentclass[6x9]{kdpcover} +\setlength\kdpxsize{8.1in} +\setlength\kdpysize{12.7in} +\begin{document} +\end{document} +\end{verbatim} +%\iffalse +%</verb> +%\fi +% \end{macro} + +% \begin{macro}{barless} +% To get rid of the black bar at the center of the page, just add +% |barless| option: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\documentclass[barless]{kdpcover} +\begin{document} +\end{document} +\end{verbatim} +%\iffalse +%</verb> +%\fi +% \end{macro} + +% \section{Commands} + +% \begin{macro}{\putSpine} +% The |\putSpine| command puts a vertical black spine line with two white elements +% inside: the text at the top and the logo at the bottom. Make sure +% the text is short enough so that it doesn't touch the logo. It's +% 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. +% \end{macro} + +% \begin{macro}{\putVolume} +% This one prints the volume picture. It is intentionally made large, +% in order to make it obvious. +% \end{macro} + +% \begin{macro}{\putVersion} +% This one prints 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 hash won't be printed. +% \end{macro} + +% \begin{macro}{\putPrice} +% This one prints the price, which is a good practice to mention, I believe. +% \end{macro} + +% \begin{macro}{\putCopyright} +% This one prints the copyright short message with the year and the +% name of the author. +% \end{macro} + +% \begin{macro}{\putCopyright} +% This one prints the title of the book +% \end{macro} + +% \begin{macro}{\putAuthor} +% This one prints the author. +% \end{macro} + +% \begin{macro}{\putTLDR} +% This one prints the TL;DR paragraph, which summarizies the message +% of the entire book. +% \end{macro} + +% \begin{macro}{\putTLDR} +% This one prints the front picture. You can use |cactus.pdf|. +% \end{macro} + +% \begin{macro}{\putBack} +% This is prints the text on the back of the book, which usually I suggest +% to omit and keep the back empty and white. +% \end{macro} + +% \StopEventually{} + +% \section{Implementation} + +% \changes{v0.2.0}{2021/07/14}{Initial version} + +% First, we define a few internal commands: +% \begin{macrocode} +\makeatletter +\newcommand*\kdp@pages{100} +\newlength\kdp@xsize +\setlength\kdp@xsize{6in} +\newlength\kdp@ysize +\setlength\kdp@ysize{9in} +\makeatother +% \end{macrocode} + +% Then, we include |iexec| for being able to execute |qpdf|: +% \begin{macrocode} +\RequirePackage{iexec} +% \end{macrocode} + +% Then, we parse class options: +% \begin{macrocode} +\RequirePackage{xkeyval} +\makeatletter +\DeclareOptionX{6x9} + {\setlength\kdp@xsize{6in}\setlength\kdp@ysize{9in}} +\DeclareOptionX{7x10} + {\setlength\kdp@xsize{7in}\setlength\kdp@ysize{10in}} +\DeclareOptionX{8x10} + {\setlength\kdp@xsize{8in}\setlength\kdp@ysize{10in}} +\DeclareOptionX{pages} + {\renewcommand*\kdp@pages{#1}} +\newif\ifkdp@barless +\DeclareOptionX{barless}{\kdp@barlesstrue} +\DeclareOptionX{pdf}{% + \iexec[trace,quiet,stdout=kdpcover-pages-count.txt] + {qpdf --show-npages #1 | tr -d '[[:space:]]' | \{ cat; echo \%; \}}% + \newread\kdp@pagescount% + \openin\kdp@pagescount=kdpcover-pages-count.txt + \read\kdp@pagescount to \kdp@pages% +} +\ProcessOptionsX\relax\makeatother +% \end{macrocode} + +% Then, we include a few useful packages: +% \begin{macrocode} +\RequirePackage{anyfontsize} +\RequirePackage{tikz} +\RequirePackage[letterspace=-50]{microtype} +\RequirePackage{xcolor} +\RequirePackage{graphicx} +\RequirePackage{calc} +% \end{macrocode} + +% Then, we set spacing using |setspace|: +% \begin{macrocode} +\RequirePackage{setspace} + \setstretch{1.2} +% \end{macrocode} + +% Then, we set calculate size. +% The height of the page is 9 inches plus 0.125 "bleed" on top and +% on the bottom, see \href{https://kdp.amazon.com/en_US/help/topic/G201953020}{this}. +% The width is 6 inches plus 0.125 "bleed" on each side. The width of the +% "spine" depends on the amount of pages in the book. +% \begin{macrocode} +\makeatletter + \newlength\kdp@height + \setlength\kdp@height{0.125in + \kdp@ysize + 0.125in} + \newlength\kdp@width + \setlength\kdp@width{ + 0.125in + \kdp@xsize + + 0.0025in * \kdp@pages + + \kdp@xsize + 0.125in} +\makeatother +% \end{macrocode} + +% Then, we set the size of the page, using |geometry|: +% \begin{macrocode} +\RequirePackage{geometry} +\makeatletter +\geometry{paperwidth=\kdp@width,paperheight=\kdp@height, + left=0pt,right=0pt,top=0pt,bottom=0pt} +\makeatother +% \end{macrocode} + +% Then, we set coordinates using |textpos|: +% \begin{macrocode} +\RequirePackage[absolute]{textpos} +\TPGrid{16}{16} +% \end{macrocode} + +% \begin{macro}{\putSpine} +% Then, we define |\putSpine|: +% \begin{macrocode} +\makeatletter\newcommand\putSpine[2][kdpcover-signature]{% + \ifkdp@barless\else + \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) {}; + \end{tikzpicture}% + \end{textblock}% + \fi + \begin{textblock}{1}[0.5,0](8,2)% + \begin{tikzpicture}% + \node [color=white, inner sep=0cm, outer sep=0cm, + rotate=270, minimum height=\TPHorizModule] at (0,0) { + \Large #2 + };% + \end{tikzpicture}% + \end{textblock}% + \begin{textblock}{2.4}[0.5,1](8,14)% + \centerline{\includegraphics[width=0.32in]{#1}}% + \end{textblock}% +}\makeatother +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putPicture} +% Then, we define |\putPicture|: +% \begin{macrocode} +\newcommand\putPicture[1]{% + \begin{textblock}{4}(10,2)% + \includegraphics[width=\textwidth]{#1} + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putVolume} +% Then, we define |\putVolume|: +% \begin{macrocode} +\newcommand\putVolume[1]{% + \begin{textblock}{2}[1,1](15,14)% + \raggedleft + \includegraphics[height=0.4in]{kdpcover-vol-#1} + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putPrice} +% Then, we define |\putPrice|: +% \begin{macrocode} +\newcommand\putPrice[1]{% + \begin{textblock}{4}[0,1](1,2)% + \small #1 + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putBack} +% Then, we define |\putBack|: +% \begin{macrocode} +\newcommand\putBack[1]{% + \begin{textblock}{5}[0,0](1,3)% + \small #1 + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putTitle} +% Then, we define |\putTitle|: +% \begin{macrocode} +\newcommand\putTitle[1]{% + \begin{textblock}{5}(10,9)% + \fontsize{32}{32}\selectfont #1 + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putAuthor} +% Then, we define |\putAuthor|: +% \begin{macrocode} +\newcommand\putAuthor[1]{% + \begin{textblock}{4}(10,10)% + \large by #1 + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putTLDR} +% Then, we define |\putTLDR|: +% \begin{macrocode} +\newcommand\putTLDR[1]{% + \begin{textblock}{5}(10,11)% + TL;DR #1 + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putVersion} +% Then, we define |\putVersion|: +% \begin{macrocode} +\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'} + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\putCopyright} +% Then, we define |\putCopyright|: +% \begin{macrocode} +\newcommand\putCopyright[2]{% + \begin{textblock}{4}[0,1](1,14)% + \small (c) + #1 #2 + \end{textblock}% +} +% \end{macrocode} +% \end{macro} + +% Finally, a few layout instructions: +% \begin{macrocode} +\AtBeginDocument{% + \ttfamily% + \raggedright% + \setlength\parindent{0pt}% + \setlength\parskip{0pt}% + \interfootnotelinepenalty=10000% +} +% \end{macrocode} + +% \Finale + +%\clearpage +% +%\PrintChanges +%\clearpage +%\PrintIndex diff --git a/Master/texmf-dist/source/latex/kdpcover/kdpcover.ins b/Master/texmf-dist/source/latex/kdpcover/kdpcover.ins new file mode 100644 index 00000000000..e5b5eccbd56 --- /dev/null +++ b/Master/texmf-dist/source/latex/kdpcover/kdpcover.ins @@ -0,0 +1,55 @@ +%% (The MIT License) +%% +%% Copyright (c) 2021-2022 Yegor Bugayenko +%% +%% Permission is hereby granted, free of charge, to any person obtaining a copy +%% of this software and associated documentation files (the 'Software'), to deal +%% in the Software without restriction, including without limitation the rights +%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +%% copies of the Software, and to permit persons to whom the Software is +%% furnished to do so, subject to the following conditions: +%% +%% The above copyright notice and this permission notice shall be included in all +%% copies or substantial portions of the Software. +%% +%% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +%% SOFTWARE. + +\input docstrip.tex +\keepsilent +\usedir{macros/latex/contrib/kdpcover} +\preamble +(The MIT License) + +Copyright (c) 2021-2022 Yegor Bugayenko + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the 'Software'), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +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.} +\endbatchfile diff --git a/Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls b/Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls index 9e38b0d3b50..28feb70560b 100644 --- a/Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls +++ b/Master/texmf-dist/tex/latex/kdpcover/kdpcover.cls @@ -1,28 +1,59 @@ -% (The MIT License) -% -% Copyright (c) 2021-2022 Yegor Bugayenko -% -% Permission is hereby granted, free of charge, to any person obtaining a copy -% of this software and associated documentation files (the 'Software'), to deal -% in the Software without restriction, including without limitation the rights -% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -% copies of the Software, and to permit persons to whom the Software is -% furnished to do so, subject to the following conditions: -% -% The above copyright notice and this permission notice shall be included in all -% copies or substantial portions of the Software. -% -% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -% SOFTWARE. +%% +%% This is file `kdpcover.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% kdpcover.dtx (with options: `class') +%% (The MIT License) +%% +%% Copyright (c) 2021-2022 Yegor Bugayenko +%% +%% Permission is hereby granted, free of charge, to any person obtaining a copy +%% of this software and associated documentation files (the 'Software'), to deal +%% in the Software without restriction, including without limitation the rights +%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +%% copies of the Software, and to permit persons to whom the Software is +%% furnished to do so, subject to the following conditions: +%% +%% The above copyright notice and this permission notice shall be included in all +%% copies or substantial portions of the Software. +%% +%% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +%% SOFTWARE. + + \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{kdpcover}[2022/07/03 0.3.0 Cover for Kindle Direct Publishing books] -\LoadClass{article} +\ProvidesClass{kdpcover} +[02.10.2022 0.4.0 Cover for Kindle Direct Publishing books] + + + + + + + + + + + + + + + + + + + + + + \makeatletter \newcommand*\kdp@pages{100} @@ -35,16 +66,20 @@ \RequirePackage{iexec} \RequirePackage{xkeyval} - \makeatletter -\DeclareOptionX{6x9}{\setlength\kdp@xsize{6in}\setlength\kdp@ysize{9in}} -\DeclareOptionX{7x10}{\setlength\kdp@xsize{7in}\setlength\kdp@ysize{10in}} -\DeclareOptionX{8x10}{\setlength\kdp@xsize{8in}\setlength\kdp@ysize{10in}} -\DeclareOptionX{pages}{\renewcommand*\kdp@pages{#1}} +\DeclareOptionX{6x9} + {\setlength\kdp@xsize{6in}\setlength\kdp@ysize{9in}} +\DeclareOptionX{7x10} + {\setlength\kdp@xsize{7in}\setlength\kdp@ysize{10in}} +\DeclareOptionX{8x10} + {\setlength\kdp@xsize{8in}\setlength\kdp@ysize{10in}} +\DeclareOptionX{pages} + {\renewcommand*\kdp@pages{#1}} \newif\ifkdp@barless \DeclareOptionX{barless}{\kdp@barlesstrue} \DeclareOptionX{pdf}{% - \iexec[trace,quiet,stdout=kdpcover-pages-count.txt]{qpdf --show-npages #1 | tr -d '[[:space:]]' | \{ cat; echo \%; \}}% + \iexec[trace,quiet,stdout=kdpcover-pages-count.txt] + {qpdf --show-npages #1 | tr -d '[[:space:]]' | \{ cat; echo \%; \}}% \newread\kdp@pagescount% \openin\kdp@pagescount=kdpcover-pages-count.txt \read\kdp@pagescount to \kdp@pages% @@ -61,34 +96,39 @@ \RequirePackage{setspace} \setstretch{1.2} -% The height of the page is 9 inches plus 0.125 "bleed" on top and -% on the bottom. -% Check this doc: https://kdp.amazon.com/en_US/help/topic/G201953020 -\makeatletter\newlength\kdp@height\makeatother% -\makeatletter\setlength\kdp@height{0.125in + \kdp@ysize + 0.125in}\makeatother% -% The width is 6 inches plus 0.125 "bleed" on each side. The width of the -% "spine" depends on the amount of pages in the book. -\makeatletter\newlength\kdp@width\makeatother -\makeatletter\setlength\kdp@width{0.125in + \kdp@xsize + 0.0025in * \kdp@pages + \kdp@xsize + 0.125in}\makeatother +\makeatletter + \newlength\kdp@height + \setlength\kdp@height{0.125in + \kdp@ysize + 0.125in} + \newlength\kdp@width + \setlength\kdp@width{ + 0.125in + \kdp@xsize + + 0.0025in * \kdp@pages + + \kdp@xsize + 0.125in} +\makeatother + \RequirePackage{geometry} - \makeatletter - \geometry{paperwidth=\kdp@width,paperheight=\kdp@height,left=0pt,right=0pt,top=0pt,bottom=0pt} - \makeatother +\makeatletter +\geometry{paperwidth=\kdp@width,paperheight=\kdp@height, + left=0pt,right=0pt,top=0pt,bottom=0pt} +\makeatother + \RequirePackage[absolute]{textpos} - \TPGrid{16}{16} +\TPGrid{16}{16} -\makeatletter -\newcommand\putSpine[2][kdpcover-signature]{% +\makeatletter\newcommand\putSpine[2][kdpcover-signature]{% \ifkdp@barless\else \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) {}; + \node [rectangle, inner sep=0em, fill=black, + minimum width=2.4\TPHorizModule, + minimum height=16\TPVertModule] at (0,0) {}; \end{tikzpicture}% \end{textblock}% \fi \begin{textblock}{1}[0.5,0](8,2)% \begin{tikzpicture}% - \node [color=white, inner sep=0cm, outer sep=0cm, rotate=270, minimum height=\TPHorizModule] at (0,0) { + \node [color=white, inner sep=0cm, outer sep=0cm, + rotate=270, minimum height=\TPHorizModule] at (0,0) { \Large #2 };% \end{tikzpicture}% @@ -96,8 +136,7 @@ \begin{textblock}{2.4}[0.5,1](8,14)% \centerline{\includegraphics[width=0.32in]{#1}}% \end{textblock}% -} -\makeatother +}\makeatother \newcommand\putPicture[1]{% \begin{textblock}{4}(10,2)% @@ -165,4 +204,7 @@ \interfootnotelinepenalty=10000% } + \endinput +%% +%% End of file `kdpcover.cls'. |