Commented Version of the LaTeX File to Create PDF ebooks and A6 Booklets

Below you can find a commented version of the LaTeX template I used to create two free ebooks and A6 booklets. Now you can tweak it as much as you like it!

The syntax highlighted TeX code comes from the htmlize package in emacs, to keep with my emacs 30 Day Challenge.

% Set the font size with 9pt. Openany states that a chapter may start
% in either page (recto or verso in publishing language). Final is the
% way to say memoir to remove any comment crap we may have
% fix-cm is a package to use arbitrary font sizes. I wrote about it in
% http://www.mostlymaths.net/2009/03/big-fonts-in-latex.html
\usepackage[pdftex, colorlinks=true, linkcolor=black,
% hyperref makes for clickable links inside a pdf and the table of
% contents. You can choose different colors as showed
% Microtype allows you to make a lot of nasty things to typography:
% adjust kern spacing, font protrusion and font expansion. I think I
% don't use it here (I use the fix-cm version), but the original
% template I used did
\usepackage[paperwidth=9cm, paperheight=12cm, hmargin={1cm, 1cm},
vmargin={1.2cm, 0.8cm}
% The geometry package allows you to set paper sizes. I tweaked it a
% little until the size looked good. You can leave it as is and tweak
% once you have everything written.
\widowpenalty 3999
\clubpenalty 3999
% Options for word and line breaking
% memoir options for footers. I leave them empty, with a ruled line
\emph{\rightmark}}{}{\footnotesize\scshape The Art of War, \thepage}
% Headings from memoir (even)
\emph{\rightmark}}{}{\footnotesize\scshape The Art of War, \thepage}
% Headings from memoir (odd)
% This copies the page style from "plain" to the first page of a
% chapter. A hack in the memoir class, redefining chapter didn't work
% Clean footers for chapters
% I don't know why I state this, as all headings are already ruled.
% More options for line and word breaking
% I used this for debug purposes. Can be removed
% Color definitions in grayscale
% These lengths are standard memoir names used for chapters. I just
% tweaked the values until I liked the result.

% Now I define a new chapter style, to be used through all the
% document. I think the commands are self-explanatory: I use
% renamecommand to change how the chapter will look like

% Use this chapter style
% Some more chapter & table of content redefinitions

% Now the content!
Be sure to check the free ebooks I posted using this template: The Art of War and How to Live on 24 Hours a Day.

Related posts:
Written by Ruben Berenguel