forked from rrthomas/hpmor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhp-markup.tex
117 lines (95 loc) · 4.05 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
% 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.
% Tone of voice
\newcommand{\shout}[1]{\textsc{#1}}
\newcommand{\scream}[1]{\MakeUppercase{#1}}
\newcommand{\prophesy}[1]{\shout{#1}}
\newcommand{\parselify}[1]{%
\StrSubstitute{#1}{ss}{ß}[\parselstring]%
\StrSubstitute{\parselstring}{s}{ss}[\parsselstring]%
\StrSubstitute{\parsselstring}{ß}{sss}[\parssselstring]%
}
% N.B. Other commands, such as \emph, cannot be used inside \parsel
\newcommand\parsel[1]{{\fontspec[ExternalLocation]{Parseltongue.ttf}#1}{\ptsansi}} % no more \parselify (can’t convert to epub)
% McGonagall Whiteboard (chapter15)
\newcommand\McGonagallWhiteBoard[1]{
\begin{center}
\fontspec[ExternalLocation,Color=AA0000]{Automobile Contest.ttf}
\textcolor{blue}{\Huge{\underline{\textcolor{red}{#1}}}}
\end{center}
}
% Special types of text
\newcommand{\abbrev}[1]{\textsc{\MakeLowercase{#1}}\xspace}
\newcommand{\headline}[1]{\begin{center}\textsc{\fontspec[ExternalLocation]{gabriele-bad.ttf}#1}\end{center}}
% Common abbreviations
\newcommand{\am}{~a.m.\xspace}
\renewcommand{\pm}{~p.m.\xspace}
\newcommand{\SPHEW}{{\abbrev{SPHEW}}}
% Newspaper headlines
\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
}
% Author’s notes
% Use with \footnotemark
%\newcommand{\authorsnotetext}[1]{\footnotetext{Author’s note: #1}}
\newcommand{\authorsnotetext}[1]{\footnotetext{Note de l'auteur~: #1}}
\newcommand{\translatorsnotetext}[1]{\footnotetext{Note du traducteur~: #1}}
% Letters
\newcommand{\letterAddress}[1]{\pagebreak[1]\noindent{}\fontspec[ExternalLocation]{Graphe_Alpha_alt.ttf}\scriptsize#1\nopagebreak[4]\par}
\newcommand{\letterClosing}[2][\vskip 1\baselineskip]{\nopagebreak[4]\fontspec[ExternalLocation]{Graphe_Alpha_alt.ttf}\scriptsize#1\par\nopagebreak[5]\noindent#2}
\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}
{\end{adjustwidth}\vskip 1\baselineskip plus 1\baselineskip minus 1\baselineskip}
% Chapter parts
% \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{\namedpartchapter}[5][\relax]{%
\chapter[%
\texorpdfstring{%
\abbrev{#3, part #4}: #5}{%
#3, part #4: #5}][%
\mbox{#2 #4:} \mbox{#5}]{%
#2, Part~#4:\protect\linebreak[1] #5#1}%
}
\newcommand{\partchapter}[3][\relax]{%
\chapter[\texorpdfstring{#2, \abbrev{part #3}}{#2, part #3}]%
[#2 #3]{#2, Part~#3#1}}
% Hanging paras for play scripts (used in Omake IV)
\newenvironment{playdialog}{\begin{hangparas}{2em}{1}}{\end{hangparas}}
% Stars
% 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\sbre@k{\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{\sbre@k%
\vskip 0pt plus 2\baselineskip%
\par\rule{.5\textwidth}{.0pt}\vskip1pt\noindent}
% A break followed by a new section
\newcommand{\latersection}[1]{\sbre@k\section{#1}}
\makeatother