forked from rrthomas/hpmor
-
Notifications
You must be signed in to change notification settings - Fork 5
/
hp-markup.tex
218 lines (180 loc) · 5.97 KB
/
hp-markup.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
% Logical markup
% These commands should be used to help make the source easy to understand
% and consistently typeset.
% Search for them in the source files to see how to use them.
% Special types of text
\newcommand{\abbrev}[1]{\textsc{\MakeLowercase{#1}}\xspace}
% Common abbreviations
\newcommand{\am}{~a.m.\xspace}
\renewcommand{\pm}{~p.m.\xspace}
\newcommand{\SPHEW}{\abbrev{BELFER}} % EN: SPHEW, DE: BELFER
% Tone of voice
\newcommand{\shout}[1]{\textsc{#1}}
\newcommand{\scream}[1]{\MakeUppercase{#1}}
\newcommand{\prophesy}[1]{\shout{#1}}
% \parsel
\newcommand{\parselify}[1]{%
% ss -> ß
\StrSubstitute{#1}{ss}{ß}[\parselstring]%
% s -> ss
\StrSubstitute{\parselstring}{s}{ss}[\parsselstring]%
% ß -> sss
\StrSubstitute{\parsselstring}{ß}{sss}[\parssselstring]%
% S -> Ss
\StrSubstitute{\parssselstring}{S}{Ss}[\parsssselstring]% for DE
% x -> xs
\StrSubstitute{\parsssselstring}{x}{xs}[\parxelstring]% for DE
% zz -> ß
\StrSubstitute{\parxelstring}{zz}{ß}[\parzzelstring]% for DE
% z -> zz
\StrSubstitute{\parzzelstring}{z}{zz}[\parzzzelstring]% for DE
% ß -> zzz
\StrSubstitute{\parzzzelstring}{ß}{zzz}[\parzzzzelstring]% for DE
% Z -> Zz
\StrSubstitute{\parzzzzelstring}{Z}{Zz}[\parzzzzzelstring]% for DE
}
%
% old version of parsel
\newcommand{\parsela}[1]{\parselify{#1}{\ptsansi\parzzzzzelstring}}
%
% new FR version of parsel
% N.B. Other commands, such as \emph, cannot be used inside \parsel
\newcommand{\parselb}[1]{{\fontspec[ExternalLocation]{Parseltongue.ttf}#1}{\ptsansi}} % no more \parselify (can’t convert to epub)
%
% select one of above
\newcommand{\parsel}[1]{\parsela{#1}}
% \spell macro experiments
% \newcommand{\spell}[1]{„\emph{#1}“}
% \usepackage{marvosym}
% \newcommand{\spell}[1]{„{\small\Lightning}\emph{#1}{\small\,\Lightning}“}
% \newcommand{\spell}[1]{{\small\Lightning\,}\emph{#1}{\small\,\Lightning}}
\newcommand{\spell}[1]{{\Star}\emph{#1}{\Star}}
% \spell{Wingardium Leviosa}
% \Lightning \Emailct \Laserbeam
% Author’s and translators notes
%
% Use with \footnotemark
% \newcommand{\authorsnotetext}[1]{\footnotetext{Anmerkung des Authors: #1}}
% translator notes
\newcommand{\translatorsnote}[1]{\footnote{Übersetzerhinweis: #1}}
% do not print translator notes
% \renewcommand{\translatorsnote}[1]{}
% McGonagall Whiteboard (chapter15)
%
\newcommand{\McGonagallWhiteBoard}[1]{
\begin{center}%
\fontspec[ExternalLocation,Color=AA0000]{Automobile Contest.ttf}
\textcolor{blue}{\Huge{\underline{\textcolor{red}{#1}}}}%
\end{center}%
}
% Newspaper headlines
\newcommand{\headline}[1]{%
\begin{center}%
\textsc{\fontspec[ExternalLocation]{gabriele-bad.ttf}#1}%
\end{center}%
}
\newcommand{\inlineheadline}[1]{%
\textsc{\fontspec[ExternalLocation]{gabriele-bad.ttf}#1}%
}
\newenvironment{headlines}{%
\newcommand{\header}[1]{\begin{SingleSpace}\upshape ##1\end{SingleSpace}}%
\let\hmorSavedLabel\label%
\renewcommand{\label}[1]{{\upshape\itshape\begin{flushleft}##1\end{flushleft}}}%
\begin{Spacing}{0.75}%
\begin{center}%
\scshape%
\nonzeroparskip%
}{%
\end{center}%
\end{Spacing}%
\let\label\hmorSavedLabel%
}
% Letters / writtenNote
\newenvironment{writtenNote}{%
\fontspec[ExternalLocation]{Graphe_Alpha_alt.ttf}\scriptsize%
%\vskip .1\baselineskip plus .1\baselineskip minus .1\baselineskip%
\begin{adjustwidth}{\parindent}{\parindent}%
%\par\noindent%
\itshape%
\setlength{\parindent}{0pt}%
\setlength{\parskip}{.5\baselineskip}%
}
{%
\end{adjustwidth}%
% \vskip 1\baselineskip plus 1\baselineskip minus 1\baselineskip
}
% \letterAddress
\newcommand{\letterAddress}[1]{%
\pagebreak[1]\fontspec[ExternalLocation]{Graphe_Alpha_alt.ttf}%
\scriptsize#1\nopagebreak[4]\par%
}
% \letterClosing
\newcommand{\letterClosing}[2][\vskip 1\baselineskip]{%
\nopagebreak[4]\fontspec[ExternalLocation]{Graphe_Alpha_alt.ttf}%
\par\scriptsize#1%
\par\nopagebreak[5]#2%
}
% PartChapters
% \partchapter{Das Stanford-Prison-Experiment}{V}
% \partchapter{The Stanford Prison Experiment}{TSPE}{XIII}{Aftermaths}
% TOC: TSPE part XIII: Aftermaths
% Page header: The Stanford Prison Experiment XIII: \\? Aftermaths
% Title: The Stanford Prison Experiment, Part XIII: \\? Aftermaths
\newcommand{\partchapter}[3][\relax]{%
% \chapter[\texorpdfstring{#2, \abbrev{Teil #3}}{#2, Teil #3}]%
% [#2 #3]{#2, Teil~#3#1}}
\chapter[#2~#3]%
[#2~#3]{#2~#3#1}}
% \namedpartchapter{The Stanford Prison Experiment}{TSPE}{VII}{Constrained Cognition}
\newcommand{\namedpartchapter}[5][\relax]{%
% \chapter[%
% \texorpdfstring{%
% \abbrev{#3, Teil #4}: #5}{%
% #3, Teil #4: #5}][%
% \mbox{#2 #4:} \mbox{#5}]{%
% #2, Teil~#4:\protect\linebreak[1] #5#1}%
% }
\chapter[%
#3~#4: #5][%
\mbox{#2 #4:} \mbox{#5}]{%
#2~#4:\protect\linebreak[1] #5#1}%
}
% Hanging paras for play scripts (used in Omake IV)
\newenvironment{playdialog}{\begin{hangparas}{2em}{1}}{\end{hangparas}}
% Chapter openings
% Definition of chapterOpeningAuthorNote when they are desired to be printed
% FIXME: Make the environment definition switchable with a flag
\newenvironment{chapterOpeningAuthorNote}{%
\par\noindent%
E.~Y.:~
}
{%
\newline\rule[1ex]{\textwidth}{.1pt}\newline%
}
% \excludecomment{chapterOpeningAuthorNote}
% chapterOpeningQuote
\newenvironment{chapterOpeningQuote}{%
\parindent=0pt%
% \rule{\textwidth}{.1pt}%
\itshape}
{\newline\rule[1ex]{\textwidth}{.1pt}\newline}
% Stars and breaks
% Single “magic star” decoration
\newcommand{\Star}{{\fontspec[ExternalLocation]{Miscelanea.ttf}*}}
% Three “magic stars” decoration
\def\Stars{{\large\Star\kern-.6ex\lower1.3ex\hbox{\large\Star}\kern-.1ex\raise.2ex\hbox{\tiny\Star}\spacefactor1000}}
% Text break made of \Stars (only used to define other commands)
\makeatletter
\def\sbreak{\mbox{}\nobreak\hfill\mbox{}\allowbreak\rule{.60\textwidth}{.0pt}\par%
\vskip 0pt plus 2\baselineskip\noindent{%
\parbox[c][0pt][c]{\textwidth}{%
\hfil \hbox{\lower14pt\hbox{\normalsize\Stars}}%
}%
}}
% A standalone break
\def\later{\sbreak%
\vskip 0pt plus 2\baselineskip%
\par\rule{.5\textwidth}{.0pt}\vskip1pt\noindent}
% A break followed by a new section
\newcommand{\latersection}[1]{\sbreak\section{#1}}
\makeatother