summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/kdpcover/kdpcover.tex
blob: 8f09b9f9b2a625527d75cfbdfe8edf1ea09de0ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
% (The MIT License)
%
% Copyright (c) 2021 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.
\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.2.2}

% 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}