30d6f20f6607f436499c3f3306e92cf5ec107eac
[ibg.git] / config / preamble.tex
1 %% LaTeX preamble.
2
3 \usepackage[left=2.5cm,right=2.5cm,top=3cm,bottom=2cm]{geometry}
4 \usepackage{setspace}
5 \usepackage{emerald}
6 \usepackage{type1cm}
7 \usepackage{lettrine}
8 \usepackage{titlesec}
9
10 %% Set up page.
11 \pagestyle{empty}
12 \pagenumbering{roman}
13 \thispagestyle{fancy}
14
15 \renewcommand\thepage{\roman{page}}
16 \newcommand\pagefoot{\thepage}
17
18 %% Set various lengths.
19 \setlength{\parskip}{\medskipamount}
20 \setlength{\parindent}{0pt}
21
22 %% Set section numbering depth.
23 \setcounter{secnumdepth}{0}
24
25 %% Add page break before each section.
26 \newcommand{\sectionbreak}{\clearpage}
27
28 %% Revert to original table of contents.
29 \makeatletter
30 \renewcommand{\tableofcontents}{\py@OldTableofcontents}
31 \makeatother
32
33 %% Covering page.
34 \def\coverpage{
35     \begin{titlepage}
36     \centering
37     \textbf{\Huge ${title}}\par
38     \vspace{0.5cm}
39     \textbf{\LARGE ${author}}\par
40     \vspace{2cm}
41     \includegraphics[width=\textwidth]{${image}}\par
42     \vspace{2cm}
43     \textit{\large ${edition}}\par
44     \vspace{0.5cm}
45     \textbf{\large ${extra}}\par
46     \vfill
47     \end{titlepage}
48     \newpage
49 }
50
51 %% License page
52 \def\licensepage{
53     \pagestyle{plain}
54     ${title}
55
56     Authors: ${author}\par
57     Editor: ${editor}\par
58
59     Cover: \textit{${imagetitle}} ${imageinfo}
60
61     ${licensetext}
62     \newpage
63 }
64
65 %% History page.
66 \def\historypage{
67     \pagestyle{plain}
68
69     \huge \textbf{Release history} \normalsize
70     \vspace{3em}
71
72     \begin{tabular}{|l|l|l|}
73     \hline
74     First Edition       & April 2002    & \\
75     \hline
76     Second Edition      & August 2002   & Minor revisions \\
77     \hline
78     Third Edition       & August 2004   & Alignment with Inform 6.30 \\
79                         &               & Further minor revisions \\
80     \hline
81     \end{tabular}
82     \newpage
83 }
84
85 %% Contents page.
86 \def\contentspage{
87     \pagestyle{plain}
88     \tableofcontents
89 }
90
91 %% Main text.
92 \def\maintext{
93     \pagestyle{headings}
94     \pagenumbering{arabic}
95     \renewcommand\thepage{\arabic{page}}
96     \setcounter{page}{1}
97 }
98
99 %% Start the main chapter text.
100 \def\startchapters{
101     \setcounter{secnumdepth}{1}
102 }
103
104 %% Start the appendices
105 \def\startappendices{
106     \setcounter{secnumdepth}{0}
107 }
108
109 %% Disable standard title (but keep PDF info).
110 \renewcommand{\maketitle}{
111   \ifsphinxpdfoutput
112     \begingroup
113     % These \defs are required to deal with multi-line authors; it
114     % changes \\ to ', ' (comma-space), making it pass muster for
115     % generating document info in the PDF file.
116     \def\\{, }
117     \def\and{and }
118     \pdfinfo{
119       /Title (${title})
120       /Author (${author})
121     }
122     \endgroup
123   \fi
124 }
125
126 %% Fix up index and references.
127 \makeatletter
128
129 \renewcommand{\theindex}{
130   \newpage
131   \phantomsection
132   \py@OldTheindex
133   \addcontentsline{toc}{section}{Index}
134 }
135
136 \renewcommand{\thebibliography}[1]{
137   \newpage
138   \phantomsection
139   \py@OldThebibliography{1}
140   \addcontentsline{toc}{section}{References}
141 }
142
143 \makeatother
144
145 %% For picture alphabet drop caps
146 \newcommand{\dropcap}[1]{\lettrine[lines=3]{\ECFAPicture{\fontsize{50}{60}\selectfont #1}\normalfont}{}}