templates/latex.erb in bookmaker-0.5.5 vs templates/latex.erb in bookmaker-0.6.0
- old
+ new
@@ -1,9 +1,9 @@
\NeedsTeXFormat{LaTeX2e}[1996/06/01]
-\documentclass[12pt,twoside,makeidx,hidelinks]{memoir}
+\documentclass[11pt,twoside,makeidx,hidelinks,<%= (status == 'final') ? '' : 'showtrims' %>]{memoir}
\usepackage{layouts}[2001/04/29]
-\def\isfinal{<%= (status == 'final') ? 1 : 0 %>}
+<%= (status == 'final') ? '\def\isfinal{1}' : '' %>
% Packages
%=========
\usepackage{verbatim}
\usepackage[colorlinks=false]{hyperref}
@@ -15,47 +15,55 @@
rotating,
lipsum,
microtype,
fancybox,
glossaries,
- titling
+ titling,
+ xspace,
}
+\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
+\input{./extras/characters.tex}
% Boolean-ness
%=============
-\newcommand{\onlyfinal}[1]{\ifdefined\isfinal{#1}\fi}
-\newcommand{\notfinal}[1]{\ifdefined\isfinal\else{#1}\fi}
+\newcommand{\onlyfinal}[1]{\ifdefined\isfinal{#1}\fi}%
+\newcommand{\notfinal}[1]{\ifdefined\isfinal\else{#1}\fi}%
\newcommand{\whenfinal}[2]{%
\ifdefined\isfinal%
- #1
+ #1%
\else%
- #2
+ #2%
\fi}%
+%
% Page Layout
%============
-<%
+<%
if status == 'final'
- stock_size = %w(9in 6in)
- ul_margin = %w(0.8in 0.5in)
- trim_size = %w(9in 6in)
+ stock_size = [9, 6]
+ trims = [0, 0]
else
- stock_size = %w(11in 8.5in)
- ul_margin = %w(1.8in 1.5in)
- trim_size = %w(11in 6in)
+ stock_size = [11 , 8.5]
+ trims = [0.8, 0.5]
end
+ ul_margin = [0.8, 0.5]
+ lr_margin = [0.8, 0.6]
+ type_block = [(9 - ul_margin.sum), (6 - lr_margin.sum)]
+
%>
-\setstocksize{<%=stock_size[0]%>}{<%=stock_size[1]%>}
-\settrimmedsize{<%=trim_size[0]%>}{<%=trim_size[1]%>}{*} % Use entire page
-\settrims{0pt}{0pt}
+<%= (status == 'final') ? '' : '\trimFrame' %>
+\setstocksize{<%=stock_size[0]%>in}{<%=stock_size[1]%>in}
+\setulmarginsandblock{0.8in}{0.5in}{*}
+\settrims{<%=trims[0]%>in}{<%=trims[1]%>in}
\setlrmarginsandblock{0.8in}{0.5in}{*}
-\setulmarginsandblock{<%=ul_margin[0]%>}{<%=ul_margin[1]%>}{*}
+\settrimmedsize{9in}{6in}{*}
+\settypeblocksize{<%=type_block[0]%>in}{<%=type_block[1]%>in}{*}
\setmarginnotes{0.1pt}{0.2in}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
-\linespread{1.05}
+\linespread{1.15}
\checkandfixthelayout
\setlength{\headsep}{8pt}
@@ -125,11 +133,12 @@
%-----------
\setsecheadstyle{\bfseries\large\centering}
\newcounter{renewsection}
\newcommand{\Chapter}[1]{
\setcounter{renewsection}{\value{section}}
- \chapter{#1}
+ \chapter{}
+ %\chapter{#1}
\setcounter{section}{\value{renewsection}}
}
\chapterstyle{<%= chapter_style || 'ell'%>}
@@ -138,57 +147,84 @@
\renewcommand{\thesection}{\arabic{section}.}
% Novel Tweaks
%=============
+\newenvironment{xdedication}%
+ {\vspace*{6ex}\begin{quotation}\begin{center}\begin{em}}%
+ {\par\end{em}\end{center}\end{quotation}}%
+
+\newenvironment{dedication}
+ {\clearpage % we want a new page
+ \thispagestyle{empty}% no header and footer
+ \vspace*{\stretch{1}}% some space at the top
+ \itshape % the text is in italics
+ \raggedleft % flush to the right margin
+ }
+ {\par % end the paragraph
+ \vspace{\stretch{3}} % space at bottom is three times that at the top
+ \clearpage % finish off the page
+ }
+
% Scene Formatting
%-----------------
+\newcommand*\thoughtbreak{
+ \begin{center}
+ \vspace{1cm}
+ \noindent\rule{0.5\textwidth}{0.4pt}
+ \vspace{1cm}
+ \end{center}
+}
+
\newcommand{\thought}[1]{\emph{#1}}
\newcommand{\email}[1]{\texttt{#1}}
\newcommand{\status}[1]{\notfinal{\textbf{Status:} #1\newline}}
\newcommand{\synopsis}[1]{\notfinal{\line(1,0){320}\newline\textbf{What's going on here?} #1\newline
\line(1,0){320}\newline}}
\newcommand{\slug}[1]{\notfinal{\MakeUppercase{#1}\newline\newline}}
\newcommand{\slugline}[2]{\notfinal{\section{#1}}\onlyfinal{\section{}}\slug{#2}}
\newcommand{\interlude}[1]{\plainfancybreak{\AfterFancyBreakMin}{1}{#1}}
-\newcommand{\scene}[3]{%
- \notfinal{\section{#1}\slug{#2}}
- \input{#3}
- \pbreak
-}%
+% \newcommand{\scene}[3]{%
+% \notfinal{\section{#1}\slug{#2}}
+% \input{#3}
+% \pbreak
+% }%
\newcommand{\smee}[1]{\${-} \textsc{\small#1}}
\whenfinal%
{\newcommand{\pbreak}{\pfbreak}}%
{\newcommand{\pbreak}{\begin{center} \# \# \# \end{center}}}
+% \renewcommand{\pbreak}{\thoughtbreak}
% Series Title Page
%==================
\def\seriestitle#1{\def\theseriestitle{\uppercase{#1}}}
\def\seriespage{\thispagestyle{empty}
\begin{center}
\noindent{\large\theseriestitle}
\vskip10.5pt
\noindent Other Books in the series:
\vskip4pt
\theseriesbooks
-\end{center}\newpage}
+\end{center}\cleardoublepage}
\def\seriesbook#1{\vskip.5pt{\noindent\hskip8pt\emph{#1}}\vskip1sp}
\def\seriesbooks#1\endseriesbooks{\def\theseriesbooks{\let\book\seriesbook{#1}}}
% Indices
%=========
\makeglossary
\makeindex
-\let\oldindex\index
+\let\oldindex\index{}%
\newcommand{\marked}[1]{\whenfinal{#1}{\underline{#1}}}%
\renewcommand{\index}[1]{\oldindex{#1}\marked{#1}}%
\newcommand{\Index}[2]{\oldindex{#1}\marked{#2}}%
\newcommand{\orbital}[1]{\oldindex{Orbital!#1}\marked{#1}}%
\newcommand{\equipment}[1]{\oldindex{Equipment!#1}\marked{#1}}%
+\newcommand{\Equipment}[2]{\oldindex{Equipment!#1}\marked{#2}}%
+\newcommand{\System}[2]{\oldindex{System!#1}\marked{#2}}%
\newcommand{\system}[1]{\oldindex{System!#1}\marked{#1}}%
\newcommand{\character}[1]{\oldindex{Character!#1}\marked{#1}}%
\newcommand{\Character}[2]{\oldindex{Character!#1}\marked{#2}}%
\newcommand{\ship}[1]{\oldindex{Ship!#1}\marked{\emph{#1}}}%
\newcommand{\Ship}[1]{\oldindex{Ship!#1}\marked{\emph{#1}}}%
@@ -197,12 +233,12 @@
\newcommand{\clin}[1]{\oldindex{Clin!#1}Clin \marked{#1}}%
% Book-Specific Metadata
%========================
-\def\NextBook{Luctation}
-\def\ReturningCharacters{Bophendze and Smee}
+\def\NextBook{<%=next_book%>}
+\def\ReturningCharacters{<%=returning_characters%>}
\title{<%= title %>}
\author{<%= authors.join(', ') %>}
\date{<%= published_at %>}
\newdate{firstprint}{<%= published_at.split('-')[2]%>}{<%= published_at.split('-')[1]%>}{<%= published_at.split('-')[0]%>}
@@ -227,19 +263,33 @@
\newcommand{\TK}[1]{\tk{BAD-TK--#1}}
% Document
%========================
\begin{document}
-
+
% Frontmatter
%-------------
\frontmatter
% r.1 - Half-Title
-
+ \begin{titlingpage}
+ \pagestyle{empty}
+ \begin{center}
+ \vspace*{2in}
+
+ \Huge\textbf{\textsf\thetitle}
+
+ \vspace*{0.75in}
+
+ \Large\textsf\theauthor
+
+ \vspace*{\fill}
+ \end{center}
+ \end{titlingpage}
+
% r.2 - Series Title Page
<%= "\\seriespage" unless series.nil? %>
-
+ \newpage
% r.3 Titlepage
\begin{titlingpage}
\pagestyle{empty}
\begin{center}
\vspace*{\fill}
@@ -253,33 +303,33 @@
\Large\textsf\theauthor
\vspace*{\fill}
\vspace*{\fill}
- \includegraphics[width=0.25\textwidth]{images/dp-logo.png}\\[0cm]
+ \includegraphics[width=0.75in]{images/dp-logo.png}\\[0cm]
\hspace*{\fill}\textsf{Dausha}\hspace*{\fill}\newline%
- \textsf{Communications}
+ \textsf{Publishing}
\end{center}
\end{titlingpage}
% r.4 Copyright Page
\vspace*{\fill}
\pagestyle{empty}
\par\noindent\emph{\thetitle}
\newline
-
+
<% if type == 'fiction' %>
-
+
\par\noindent This is a work of fiction. Names, characters, places and incidents are either
- the product of the author's imagination or are used ficticiously, and any resemblance to
+ the product of the author's imagination or are used fictitiously, and any resemblance to
actual persons, living or dead, business establishments, events or locales is entirely
coincidental.\newline
<% end %>
\par\noindent\emph{<%= copyright %>}\newline
-
+
<% unless designer['cover'].nil? || designer['cover'].empty? %>
\par\noindent Cover Design by <%= designer['cover'] %>\newline
<% end %>
<% unless designer['book'].nil? || designer['book'].empty? %>
@@ -287,12 +337,12 @@
<% end %>
<% unless editors['text'].nil? || editors['text'].empty? %>
\par\noindent Book Design by <%= editors['text'].join(',') %>\newline
<% end %>
-
+
\par\noindent All rights reserved.\newline
\par\noindent No part of this publication may be reproduced, stored in a retrieval system, posted on the Internet, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior written permission from the author. The only exception is by a reviewer, who may quote short excerpts in a review.\newline
\par\noindent \theauthor
@@ -301,19 +351,21 @@
\par\noindent Printed in the United States of America
\newline
\par\noindent\textit{First Printing, \usmonthyear\displaydate{firstprint}}
\newline
-
+
\par\noindent <%= identifier['type'] %> <%= identifier['id'] %>
\vspace*{\fill}
- \newpage
% r.5 - Dedication
+ <%= "\\begin{dedication}\n#{File.open('extras/dedication.tex').read}\\end{dedication}" if File.exist?('extras/dedication.tex')
+ %>
+ <%= (status != 'final') ? '\tableofcontents' : '' %>
-\tableofcontents
+ \newpage
\mainmatter
\pagestyle{ebook}
\sloppy
<%= contents %>
@@ -325,31 +377,31 @@
%% Bibliography
% \bibliographystyle{\mybibliostyle}
% \bibliocommand
% \pagestyle{empty}
\begin{center}
- \vspace*{\fill}
-
+ \vspace*{\fill}
+
{\Large \par
- \noindent Thank you for reading
+ \noindent Thank you for reading
- \vspace*{0.125in}
- {\LARGE\textbf{\textsf{\thetitle}}}
- \vspace*{0.125in}
-
- \ifdefined\ReturningCharacters
- \par
- \noindent\ReturningCharacters{} will return in \emph{\NextBook}.} \vspace*{\fill}
- \fi
-
- {\LARGE\textbf{\textsf{Follow Me}}}
-
- \vspace*{0.125in}
-
- \textbf{\theauthor{}} can be followed on Twitter and Facebook.
- \newline Visit his web site at http://dausha.net for more information. You can also sign up for announcements of other books in this series at http://dausha.net.
-
- \vspace*{\fill}
+ \vspace*{0.125in}
+ {\LARGE\textbf{\textsf{\thetitle}}}
+ \vspace*{0.125in}
+
+ \ifdefined\ReturningCharacters
+ \par
+ \noindent\ReturningCharacters{} will return in \emph{\NextBook}.} \vspace*{\fill}
+ \fi
+
+ {\LARGE\textbf{\textsf{Follow Me}}}
+
+ \vspace*{0.125in}
+
+ \textbf{\theauthor{}} can be followed on Twitter and Facebook.
+ \newline Visit his web site at http://dausha.net for more information. You can also sign up for announcements of other books in this series at http://dausha.net.
+
+ \vspace*{\fill}
\end{center}
<% if (type == 'fiction' and status != 'final') or type == 'nonfiction' %>
%% Glossary
\ No newline at end of file