templates/latex.erb in bookmaker-0.2.0 vs templates/latex.erb in bookmaker-0.3.1

- old
+ new

@@ -1,46 +1,12 @@ \NeedsTeXFormat{LaTeX2e}[1996/06/01] - -\documentclass[11pt,twoside,makeidx]{memoir} +\documentclass[11pt,twoside,makeidx,hidelinks]{memoir} \usepackage{layouts}[2001/04/29] -\makeglossary -\makeindex +\def\isfinal{<%= is_final %>} -%======================== -% Page Layout -\setstocksize{9in}{6in} -\settrimmedsize{9in}{6in}{*} % Use entire page -\settrims{0pt}{0pt} - -\setlrmarginsandblock{0.8in}{0.5in}{*} -\setulmarginsandblock{0.8in}{0.5in}{*} - -\setmarginnotes{0.1pt}{0.2in}{\onelineskip} -\setheadfoot{\onelineskip}{2\onelineskip} -\setheaderspaces{*}{2\onelineskip}{*} -\linespread{1.05} - -\checkandfixthelayout -\setlength{\headsep}{8pt} -\aliaspagestyle{title}{empty} - -\makepagestyle{ebook} -\makeoddhead{ebook}{}{\normalfont\scshape\theauthor}{\normalfont\thepage} -\makeevenhead{ebook}{\normalfont\thepage}{\normalfont\scshape \thetitle}{} - -%======================== -% Fonts -\usepackage{fontspec} -\usepackage{xunicode} -\usepackage{xltxtra} -\defaultfontfeatures{Mapping=tex-text} -\setmainfont{Liberation Serif} -\setsansfont{TitilliumText22L Light} -\setmonofont{Liberation Mono} -\newfontinstance\scshape[Letters=SmallCaps, Numbers=Uppercase]{Liberation Mono} -\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} - +% Packages +%========= \usepackage{verbatim} \usepackage[colorlinks=false]{hyperref} % \usepackage[utf8x]{inputenc} \usepackage{ fancyvrb, @@ -52,36 +18,41 @@ fancybox, glossaries, titling } -\ifdefined\disableligature - \DisableLigatures[f]{encoding = *, family = * } -\fi +% Boolean-ness +%============= +\newcommand{\onlyfinal}[1]{\ifdefined\isfinal{#1}\fi} +\newcommand{\notfinal}[1]{\ifdefined\isfinal\else{#1}\fi} +\newcommand{\whenfinal}[2]{% + \ifdefined\isfinal% + #1 + \else% + #2 + \fi}% -%======================== -% Document Headings +% Page Layout +%============ +\setstocksize{9in}{6in} +\settrimmedsize{9in}{6in}{*} % Use entire page +\settrims{0pt}{0pt} +\setlrmarginsandblock{0.8in}{0.5in}{*} +\setulmarginsandblock{0.8in}{0.5in}{*} -%% Chapter -\setsecheadstyle{\bfseries\large\centering} -\newcounter{renewsection} -\newcommand{\Chapter}[1]{ - \setcounter{renewsection}{\value{section}} - \chapter{#1} - \setcounter{section}{\value{renewsection}} -} +\setmarginnotes{0.1pt}{0.2in}{\onelineskip} +\setheadfoot{\onelineskip}{2\onelineskip} +\setheaderspaces{*}{2\onelineskip}{*} +\linespread{1.05} -%======================== -\renewcommand{\thesection}{\arabic{section}.} +\checkandfixthelayout -%======================== -% TEXT LAYOUT +\setlength{\headsep}{8pt} + \newlength{\AfterFancyBreakMin} \setlength{\AfterFancyBreakMin}{3\baselineskip} - \setlength{\parindent}{1.5 em} - \makeatletter \g@addto@macro\quote{\linespread{1}\small{}} \g@addto@macro\quotation{\linespread{1}\small{}} \g@addto@macro\caption{\linespread{1}\footnotesize{}} \makeatother @@ -91,45 +62,145 @@ \righthyphenmin 62 \emergencystretch 1.5em \hfuzz 0.3pt \widowpenalty=10000 \clubpenalty=10000 - \setlength{\parindent}{1.5 em} +% Page Heading +%------------- +\makepagestyle{ebook} +\makeoddhead{ebook}{}{\normalfont\scshape\theauthor}{\normalfont\thepage} +\makeevenhead{ebook}{\normalfont\thepage}{\normalfont\scshape \thetitle}{} + +\aliaspagestyle{title}{empty} + +% Text Tweaks +%------------- \def\thinspace{\kern .16667em } +\newcommand{\ellip}{\ldots} \newcommand{\Dash}{\thinspace---\thinspace} \newcommand{\dash}{\tk{--Wrong Dash--}} -%======================== +% Fonts +%------ +\usepackage{fontspec} +\usepackage{xunicode} +\usepackage{xltxtra} +\defaultfontfeatures{Mapping=tex-text} +\setmainfont{Liberation Serif} +\setsansfont{TitilliumText22L Light} +\setmonofont{Liberation Mono} +\newfontinstance\scshape[Letters=SmallCaps, Numbers=Uppercase]{Liberation Mono} +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} +\ifdefined\disableligature + \DisableLigatures[f]{encoding = *, family = * } +\fi + % Dates +%------- \usepackage{datetime} \newdateformat{yearonly}{\THEYEAR} \newdateformat{usmonthyear}{\monthname[\THEMONTH], \THEYEAR} \newcommand{\monthyear}{% \ifcase\month\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or December\fi\space\number\year } -%======================== -% Text Tweaks -\newcommand{\ellip}{\ldots} -\newcommand{\pbreak}{\pfbreak}% +% Document Headings +%================== -%======================== +% Chapter +%----------- +\setsecheadstyle{\bfseries\large\centering} +\newcounter{renewsection} +\newcommand{\Chapter}[1]{ + \setcounter{renewsection}{\value{section}} + \chapter{#1} + \setcounter{section}{\value{renewsection}} +} + +% Section +%--------- +\renewcommand{\thesection}{\arabic{section}.} + +% Novel Tweaks +%============= + +% Scene Formatting +%----------------- + +\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{\smee}[1]{\Dash{}\textsc{\small#1}} +\whenfinal% + {\newcommand{\pbreak}{\pfbreak}}% + {\newcommand{\pbreak}{\begin{center} \# \# \# \end{center}}} + +% Indices +%========= +\makeglossary +\makeindex +\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{\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}}}% +\newcommand{\location}[1]{\oldindex{Location!#1}\marked{#1}}% +\newcommand{\Location}[2]{\oldindex{Location!#1}\marked{#2}}% +\newcommand{\clin}[1]{\oldindex{Clin!#1}Clin \marked{#1}}% + % Book-Specific Metadata +%======================== + \def\NextBook{Luctation} \def\ReturningCharacters{Bophendze and Smee} \title{<%= title %>} \author{<%= authors.join(', ') %>} \date{<%= published_at %>} \newdate{firstprint}{<%= published_at.split('-')[2]%>}{<%= published_at.split('-')[1]%>}{<%= published_at.split('-')[0]%>} -% \newcommand{\isbn}{<} -\renewcommand{\thesection}{\arabic{section}.} + +% Drafting Help +%============== +\newcommand{\tk}[1]{% + \ifdefined\isdraft% + % \textbf{TK-#1} + \todo{#1}\textbf{TK-#1}% + \else% + \textbf{TK-#1}% + % \todo{#1}\textbf{TK-#1} + \fi% +}% +\newcommand{\TK}[1]{\tk{BAD-TK--#1}} + +% Document +%======================== \begin{document} + +% Frontmatter +%------------- \frontmatter \begin{titlingpage} \pagestyle{empty} \begin{center} \vspace*{\fill} @@ -199,12 +270,13 @@ % Todolist % % \ifdefined\isdraft % \listoftodos % \fi + % Back Matter -% +%------------- \backmatter %% Bibliography % \bibliographystyle{\mybibliostyle} % \bibliocommand @@ -238,11 +310,7 @@ \printglossaries %% Index \printindex % } - -% \chapter{Colophon} - -% This book was typeset using the venerable \TeX document markup protocol, using \XeTeX. The \emph{Memoir} class was used for the many features it provided over the standard \emph{Book} class of \TeX{}. \XeTeX{} is distributed at no cost under the \TeX{} Project Public License. Spell checking was done using Aspell. The final version was compiled into the Portable Document Format (PDF) or various epublishing formats, facilitated by use of Make, a utility for automatically building large applications that would otherwise be time-consuming to build through non-automated means. \end{document} \ No newline at end of file