1

Previous materials and purpose of a book template

Let's assume for a second: I already have all the text (content) done for a book. Now, I want to set it ready for auto-publishing, in the best punk-rock Do It Yourself [DIY] style. What can I do with LaTeX?

Let's get a bit more specific. Many questions on this site ask for templates in several fields:

  • Math for example, and yes, as an answer there suggests memoir is generally a very good class for this purpose. In fact, that post informs of another post with a very functional painless template. One of the few and best book templates in fact that I could find: code appears clearly and not too long, compiles well. Just that when I try to add more text it just doesn't work...

  • Another post asks for a class to write novels. And of course comes the comment: what features are you looking for?. I'll be back on this point.

  • Another post looks to use LaTeX for writing a fiction book. Here appears a good requirement that is quite simple and deserves some attention: a ready-to-go template...for a book . The above painless template more or less can serve this purpose of mwe as template. However I'd like some specifications that I mention as follows.

Sidenote: another cool template is the tufte-book, but it's not prepared for changes of page-size with geometry package... Hence some requirements...


Ideas for a book template

Most books, as far as I check my bookshelf, are not made in a4 paper. So here a list of desirable basic possibilties for a book template.

Inside the book

  • First foursih pages could have:

    1) title page with the title alone

    2) blank page

    3) title page with title and author name

    4) copyright, and other front matter info on the book/publisher

  • Then: main matter/contents ...yada yada

  • Others/index/bib/etc.

  • Maybe date/place of publication at the end, and perhaps some other information.

Configuration

  • Fit por papers of sizes other than a4. Could be different shape, or bigger or smaller than a4. I like a5, and a6.

  • Set some kind of typography.

  • As for style: this template for a speech, even if subjective, seems nice.


Subjective scope and possible answers

Yes, all these pointers are somewhat arbitrary, but a template book shall come very handy and it's a good place to start at for those who have a ready text and want to format it for print. And I haven't seen this solidly responded elsewhere. I've browsed around and page title alone requires a whole series of consideration, same with typography, page size and so on.

This question aims not only for a variety of answers but also to achieving a code that could be not too long and somewhat clean with those basic points inside the book and maybe an additional tweak or so of configuring a style.

Granted that this is not very close to getting a minimal example. But I still feel that just these few requirements could be usefull for people planning to do a book. My pointers intend to go in the same direction as a comment-link suggested:

we can work together to establish some common standards of best practice (What does that even mean?) to improve the initial state of future templates and improve the current situation

That post has very good points. And references too (tl,dr). However, even if this question may be improved I still see some valid points and that it could be a good starting point.

  • 2
    In my opinion, this question is scratched. A minimal thing does not contain any other packages. Also, the concept of templates is scratched, you may want to read about the confusion. – Johannes_B May 7 '16 at 6:51
  • @Johannes_B granted that it wasn't minimal, and edited that. I understand the main idea of scratched but please add more info so that we can move forward. I really liked your title page customization. Maybe we can combine that answer with additional data for these requirements? – nilon May 7 '16 at 13:56
  • The topic of thesis templates came up a few weeks ago on c.t.t. (<- Link). I have very strong feelings against templates, as you might have already noticed. chat.stackexchange.com/transcript/message/29508320#29508320 – Johannes_B May 7 '16 at 14:26
  • @Johannes_B I think we have a common ground on "the initial state of future templates", yes? If this were a pasta salad, and I lower my level and amount of questions to just one. How can I set proper code for a book with this structure: the 4 1st pages as set above (this is the most important part of the question, and seeking for clean code, and then...),contents, the end details? – nilon May 7 '16 at 14:42
  • 1
    You want something generic that fits with your specific ideas? All that is feasible is something generic that enables you to tweak it to get what you want. BTW the traditional place for publication date and place is not at the end but on your idea of a copyright page. – Peter Wilson May 7 '16 at 18:42
3

I recently posted a new document class, specifically for the purpose of a novel. It is not just a template, but a complete method for created a file in PDF/X for print-on-demand (paper, not e-book). You can find it on CTAN:

https://ctan.org/pkg/novel

It comes with elaborate documentation, directed toward writers rather than programmers. You may need to start from scratch, but that should not be difficult, as the document class is pre-configured for the most likely needs of book publishing.

You can also see a demonstration novel (from public domain) both in the LaTeX code and finished PDF.

2

I know content is already done but for next writing it's good reminder that you can always focus the most on content, and using stripped down writing software is always a nice time. If you use plain text you can always use markdown (+pandoc)


Now to the actual answer. I've set a book with 4 initial pages as stated. Not sure if code is clean, or could get more minimal, but I can make modifications with little or no errors. It's set for a6paper/landscape. It's intended to be a book that has some text and some pictures at full page. At the end it also has indication of printing and even a bar code.

Here the not so mwe, or rather more of a ¿complete skeleton working example?

(Side note: remember the how-to for a mwe)

\documentclass[openany,11pt]{scrbook} 
%\input{packages}
\usepackage[a6paper,landscape]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{kpfonts,baskervald}
\usepackage{incgraph,tikz} 
\usepackage{microtype} 
\usepackage{wasysym}
\usepackage{marvosym}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{mdframed}
\usepackage{epigraph}
\renewcommand{\textflush}{flushepinormal}
\setlength\epigraphwidth{8.5cm} 
\setlength\epigraphrule{0pt}

\widowpenalty10000
\clubpenalty10000

\newcommand\textlcsc[1]{\textsc{\MakeLowercase{#1}}}

\date{}

%\input{main-matter} 
\makeindex

\begin{document}
\begin{titlepage}\thispagestyle{empty} \vspace*{7em}{\centering\Huge throwing up upwards \par}\clearpage
\newpage \thispagestyle{empty} \mbox{} \cleardoublepage
\thispagestyle{empty} \vspace*{7em}{\centering\Huge throwing up upwards \par}
    {\centering -- a guy with a heavy flu \par}\cleardoublepage
\newpage \thispagestyle{empty} \mbox{} \clearpage

\begin{mdframed} \begin{scriptsize} \noindent 
Author: X -- \\ 
Title: throwing up upwards. \\ 
1\textsuperscript{st} edition. nowhere. \\ 
1. Stuff 2. Literature 3. Astrology 4. Science 5. Crazy photography
\end{scriptsize} \end{mdframed}

\thispagestyle{empty} \vspace*{\fill} \parbox{.8\textwidth}{\raggedright \scriptsize
\textit{imposible} publisher 2016 

printed blindfolded

design: \LaTeX 
}
\end{titlepage} 
\clearpage \thispagestyle{empty}\cleardoublepage

%%%%%%%%%%%%%%%%%% QUOTE %%%%%%%%%%%%%%%%%%%
\thispagestyle{empty}
\vspace*{\fill}
\epigraph{one original thought is worth a thousand mindless quotings} 
{--- \textup{\textit{Banksy ...quoting Diogenes? }} } 
\vspace*{\fill} \cleardoublepage

\tableofcontents\thispagestyle{empty}
\clearpage \cleardoublepage 
\thispagestyle{empty}

\pagestyle{plain}

\part{1} hey 

\incgraph[documentpaper,overlay={\node[red] at (page.center) {\Huge Picture sized to paper};}][width=\paperwidth,height=\paperheight]{example-image-b}

%\input{final}

\newpage \thispagestyle{empty} \mbox{} \clearpage

\thispagestyle{empty}
\vspace*{\fill}\hfill   \parbox{\textwidth}
{\scriptsize  \centering
printed in december\\ feeling that the year was still ok}

\newpage \thispagestyle{empty} \mbox{} \cleardoublepage 

\def\barcode#1#2#3#4#5#6#7{\begingroup%
\dimen0=0.1em
\def\stack##1##2{\oalign{##1\cr\hidewidth##2\hidewidth}}%
\def\0##1{\kern##1\dimen0}%
\def\1##1{\vrule height10ex width##1\dimen0}%
\def\L##1{\ifcase##1\bc3211##1\or\bc2221##1\or\bc2122##1\or\bc1411##1%
\or\bc1132##1\or\bc1231##1\or\bc1114##1\or\bc1312##1\or\bc1213##1%
\or\bc3112##1\fi}%
\def\R##1{\bgroup\let\next\1\let\1\0\let\0\next\L##1\egroup}%
\def\G##1{\bgroup\let\bc\bcg\L##1\egroup}% reverse
\def\bc##1##2##3##4##5{\stack{\0##1\1##2\0##3\1##4}##5}%
\def\bcg##1##2##3##4##5{\stack{\0##4\1##3\0##2\1##1}##5}%
\def\bcR##1##2##3##4##5##6{\R##1\R##2\R##3\R##4\R##5\R##6\11\01\11\09%
\endgroup}%
\stack{\09}#1\11\01\11\L#2%
\ifcase#1\L#3\L#4\L#5\L#6\L#7\or\L#3\G#4\L#5\G#6\G#7%
\or\L#3\G#4\G#5\L#6\G#7\or\L#3\G#4\G#5\G#6\L#7%
\or\G#3\L#4\L#5\G#6\G#7\or\G#3\G#4\L#5\L#6\G#7%
\or\G#3\G#4\G#5\L#6\L#7\or\G#3\L#4\G#5\L#6\G#7%
\or\G#3\L#4\G#5\G#6\L#7\or\G#3\G#4\L#5\G#6\L#7%
\fi\01\11\01\11\01\bcR}

\thispagestyle{empty} \vspace*{\fill}
\centering{\barcode 9780029021408} 

\end{document}
  • maybe it'd be nice if you can set all pictures on odd sides... this way if the paper is of limited quality it doesn't superpose with images in next/previous pages... – nilon May 7 '16 at 4:37
  • 1
    \cleardoublepage\newpage\mbox{}\clearpage? KOMA-script provides commands like \cleartooddpage that you might like. – Johannes_B May 7 '16 at 6:56
  • Why are you setting the global option openany? – Johannes_B May 7 '16 at 7:01
  • 1
    kpfonts and baskervald? – Thérèse Aug 19 '16 at 16:28
  • 2
    That’s mixing an old-style serif into a transitional serif. If you can’t use Open Type fonts, there’s support for the (commercial) Berthold Baskerville, with lowercase figures, at ctan.org/tex-archive/fonts/psfonts/w-a-schmidt. And if you can’t buy a commercial font, have a look at ctan.org/tex-archive/fonts/boisik for a Metafont typeface, with lowercase figures, inspired by Baskerville. – Thérèse Aug 24 '16 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.