Fixing your TEX header to make your PDF suitable for book interiors

If you open your generated TEX file in your favorite text editor you'll see a bunch of lines in the beginning of the file and the last line of the bunch is this:

%%% Body

Replace all of those lines with these:

\documentclass[12pt]{book}
\usepackage{geometry}
\geometry{
papersize={7.5in,9.25in},
inner=.88in,
outer=.5in,
headheight=.5in,
bottom=.5in,
}

\title{Your Book's Title}
\author{Your Book's Author}
\date{}

\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[CE]{Your Book's Title}
\fancyhead[CO]{Your Book's Author}
\fancyhead[LE,RO]{\thepage}


\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields to avoid page number in TOC.
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}

\renewcommand{\chaptername}{CHAPTER}
\renewcommand{\partname}{PART}

\sloppy

% generated by Docutils
\usepackage{cmap} % fix search and cut-and-paste in Acrobat
\usepackage{ifthen}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{alltt}
\usepackage{color}
\usepackage{float} % float configuration
\usepackage{graphicx}
\usepackage{multirow}
\setcounter{secnumdepth}{0}
\usepackage{longtable,ltcaption,array}
\setlength{\extrarowheight}{2pt}
\newlength{\DUtablewidth} % internal use in tables
\usepackage{textcomp} % text symbol macros
\usepackage{verse}
\usepackage{wrapfig}

%%% Custom LaTeX preamble
% PDF Standard Fonts
\usepackage{mathptmx} % Times
\usepackage[scaled=.90]{helvet}
\usepackage{courier}

% insert vertical spacing
\def\vs#1{\vspace{#1\baselineskip}}

% define environments for most of the
% standard building blocks of a book

\def\startenv{%
\thispagestyle{empty}%
}
\def\endenv{%
}

\newenvironment{container}{}{\par}

\newenvironment{coverpage_env}{\startenv}{\endenv}
\newenvironment{frontispiece_env}{\startenv}{\endenv}
\newenvironment{titlepage_env}{\startenv}{\endenv}
\newenvironment{verso_env}{\startenv}{\endenv}
\newenvironment{dedication_env}{\startenv}{\endenv}
\newenvironment{plainpage_env}{\startenv}{\endenv}
\newenvironment{contents_env}{}{}
\newenvironment{foreword_env}{}{}
\newenvironment{preface_env}{}{}
\newenvironment{introduction_env}{}{}
\newenvironment{prologue_env}{}{}
\newenvironment{epilogue_env}{}{}
\newenvironment{glossary_env}{}{}
\newenvironment{bibliography_env}{}{}
\newenvironment{index_env}{}{}
\newenvironment{colophon_env}{}{}
\newenvironment{pgfooter_env}{}{}
\newenvironment{pgheader_env}{}{}
\newenvironment{appendix_env}{}{}

% generated by Docutils
% rubber: set program xelatex
\usepackage{fontspec}
% \defaultfontfeatures{Scale=MatchLowercase}
% straight double quotes (defined T1 but missing in TU):
\ifdefined \UnicodeEncodingName
\DeclareTextCommand{\textquotedbl}{\UnicodeEncodingName}{%
{\addfontfeatures{RawFeature=-tlig,Mapping=}\char34}}%
\fi
\usepackage{ifthen}
\usepackage{alltt}
\usepackage{color}
\usepackage[justification=centering]{caption}
\usepackage{caption}
\captionsetup{font=footnotesize,labelformat=empty}
\setcounter{secnumdepth}{0}

%%% Custom LaTeX preamble
% Linux Libertine (free, wide coverage, not only for Linux)
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}

%%% User specified packages and stylesheets

%%% Fallback definitions for Docutils-specific commands

% class handling for environments (block-level elements)
% \begin{DUclass}{spam} tries \DUCLASSspam and
% \end{DUclass}{spam} tries \endDUCLASSspam
\ifx\DUclass\undefined % poor man's "provideenvironment"
\newenvironment{DUclass}[1]%
{\def\DocutilsClassFunctionName{DUCLASS#1}% arg cannot be used in end-part of environment.
\csname \DocutilsClassFunctionName \endcsname}%
{\csname end\DocutilsClassFunctionName \endcsname}%
\fi

% admonition (specially marked topic)
\providecommand{\DUadmonition}[2][class-arg]{%
% try \DUadmonition#1{#2}:
\ifcsname DUadmonition#1\endcsname%
\csname DUadmonition#1\endcsname{#2}%
\else
\begin{center}
\fbox{\parbox{0.9\linewidth}{#2}}
\end{center}
\fi
}

\renewcommand*{\contentsname}{CONTENTS}
\renewcommand{\listfigurename}{ILLUSTRATIONS}

% subtitle (in document title)
\providecommand*{\DUdocumentsubtitle}[1]{{\large #1}}
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
\hyperlink{#2}{\textsuperscript{#3}}%
}
\providecommand{\DUfootnotetext}[4]{%
\begingroup%
\renewcommand{\thefootnote}{%
\protect\raisebox{1em}{\protect\hypertarget{#1}{}}%
\protect\hyperlink{#2}{#3}}%
\footnotetext{#4}%
\endgroup%
}

% title for topics, admonitions, unsupported section levels, and sidebar
\providecommand*{\DUtitle}[2][class-arg]{%
% call \DUtitle#1{#2} if it exists:
\ifcsname DUtitle#1\endcsname%
\csname DUtitle#1\endcsname{#2}%
\else
\smallskip\noindent\textbf{#2}\smallskip%
\fi
}
% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
\usepackage[colorlinks=true,linkcolor=black,urlcolor=black]{hyperref}
\usepackage{bookmark}
\urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}
\hypersetup{
pdftitle={Your Book's Title},
}

%%% Body

I have bolded the parts of the TEX file that you will likely want to change. The first one is the page size. I have found two page sizes to be useful:

1. 6x9 inches for novels. I also use this for Hindu scriptures, and it might work for other kinds of titles like biographies, etc. This is a very common size for published books.

2. 7.5x9.25 for non fiction titles, especially illustrated ones. If your book has full page illustrations or lots of diagrams this is a good size. You can't really do full page illustrations with TEX and making the page size larger compensates for that. Also, when choosing an illustrated book to put back in print avoid color interior illustrations. A print on demand book needs to print every page the same way, so you're paying for color on every page whether the book needs it or not, and the color pages just don't look that good.

Most conventionally published books with photographs or color illustrations print the illustrations separately from the rest of the book and glue those pages into the rest of the book as part of the printing process. You can't do that with print on demand. Your pictures will look like they were printed on regular quality paper using an InkJet printer. For black and white photos this can give usable results, for color not so much.

The place for color and color illustrations is on the book cover. That is where they will look their best.

There are several places to put in your book's title and author. In the printed book left hand page headings will have the title and right hand page headings will have the author name. There are probably ways to get LaTeX to do fancier things with page headings but I never bothered to learn how.

More details on how to nicely format your book interior to come. Stay tuned.
 •  0 comments  •  flag
Share on Twitter
Published on October 19, 2021 15:09
No comments have been added yet.


Bhakta Jim's Bhagavatam Class

Bhakta Jim
If I have any regrets about leaving the Hare Krishna movement it might be that I never got to give a morning Bhagavatam class. You need to be an initiated devotee to do that and I got out before that ...more
Follow Bhakta Jim's blog with rss.