Mention in README.md the need for the iftex package and how to get it.
[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 %% Avoid too-deepy-nested problems.
34 \usepackage{enumitem}
35 \setlistdepth{99}
36
37 %% Covering page.
38 \def\coverpage{
39     \begin{titlepage}
40     \centering
41     \textbf{\Huge ${title}}\par
42     \vspace{0.5cm}
43     \textbf{\LARGE ${author}}\par
44     \vspace{2cm}
45     \includegraphics[width=\textwidth]{${image}}\par
46     \vspace{2cm}
47     \textit{\large ${edition}}\par
48     \vspace{0.5cm}
49     \textbf{\large ${extra}}\par
50     \vfill
51     \end{titlepage}
52     \newpage
53 }
54
55 %% License page
56 \def\licensepage{
57     \pagestyle{plain}
58     ${title}
59
60     Authors: ${author}\par
61     Editor: ${editor}\par
62
63     Cover: \textit{${imagetitle}} ${imageinfo}
64
65     ${licensetext}
66     \newpage
67 }
68
69 %% History page.
70 \def\historypage{
71     \pagestyle{plain}
72
73     \huge \textbf{Release history} \normalsize
74     \vspace{3em}
75
76     \begin{tabular}{|l|l|l|}
77     \hline
78     First Edition       & April 2002    & \\
79     \hline
80     Second Edition      & August 2002   & Minor revisions \\
81     \hline
82     Third Edition       & August 2004   & Alignment with Inform 6.30 \\
83                         &               & Further minor revisions \\
84     \hline
85     \end{tabular}
86     \newpage
87 }
88
89 %% Contents page.
90 \def\contentspage{
91     \pagestyle{plain}
92     \tableofcontents
93 }
94
95 %% Main text.
96 \def\maintext{
97     \pagestyle{headings}
98     \pagenumbering{arabic}
99     \renewcommand\thepage{\arabic{page}}
100     \setcounter{page}{1}
101 }
102
103 %% Start the main chapter text.
104 \def\startchapters{
105     \setcounter{secnumdepth}{1}
106 }
107
108 %% Start the appendices
109 \def\startappendices{
110     \setcounter{secnumdepth}{0}
111 }
112
113 %% Disable standard title (but keep PDF info).
114 \renewcommand{\maketitle}{
115   \ifsphinxpdfoutput
116     \begingroup
117     % These \defs are required to deal with multi-line authors; it
118     % changes \\ to ', ' (comma-space), making it pass muster for
119     % generating document info in the PDF file.
120     \def\\{, }
121     \def\and{and }
122     \pdfinfo{
123       /Title (${title})
124       /Author (${author})
125     }
126     \endgroup
127   \fi
128 }
129
130 %% Fix up index and references.
131 \makeatletter
132
133 \renewcommand{\theindex}{
134   \newpage
135   \phantomsection
136   \py@OldTheindex
137   \addcontentsline{toc}{section}{Index}
138 }
139
140 \renewcommand{\thebibliography}[1]{
141   \newpage
142   \phantomsection
143   \py@OldThebibliography{1}
144   \addcontentsline{toc}{section}{References}
145 }
146
147 \makeatother
148
149 %% For picture alphabet drop caps
150 \newcommand{\dropcap}[1]{\lettrine[lines=3]{\ECFAPicture{\fontsize{50}{60}\selectfont #1}\normalfont}{}}