-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon_headers.tex
346 lines (296 loc) · 10.4 KB
/
common_headers.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
%KDP 6inx9in sans fonds perdus
\usepackage[paperwidth=6in, paperheight=9in]{geometry}
\usepackage{fontspec}
\usepackage[nolocalmarks]{polyglossia}
\usepackage[table]{xcolor}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage{expl3}
\usepackage{hyperref}
\usepackage{refcount}
\usepackage{needspace}
\usepackage{etoolbox}
\usepackage{enumitem}
\setdefaultlanguage[variant=french, frenchitemlabels=false]{french}
\geometry{
inner=25mm,
outer=14mm,
top=14mm,
bottom=14mm,
headsep=3mm,
}
%% General scale of all graphical elements.
%% Values different from 1 are largely untested.
%% Used in those commands (e.g. everything FontSpec) that use a scale parameter.
\newcommand{\customscale}{1}
%% Provide the command \fpevalc as a copy of the code-level \fp_eval:n.
%% \fpevalc allows to evaluate floating point calculation for scaled parameters, e.g. \setSomeStretchFactor{\fpevalc{0,6 * \customscale}}
\ExplSyntaxOn
\cs_new_eq:NN \fpevalc \fp_eval:n
\ExplSyntaxOff
%% No indentation of paragraphs
\setlength{\parindent}{0mm}
%% We want to allow large inter-words space
%% to avoid overfull boxes in two-columns rubrics.
\sloppy
%%%%%%%%%%%%%%% GREGORIO CONFIG %%%%%%%%%%%%%%%
\usepackage[forcecompile]{gregoriotex}
%% this limits how much scores can stretch vertically
%% when they are forced to adhere to the bottom of a page (i.e followed by \pagebreak)
%\grechangedim{baselineskip}{65pt plus 1pt minus 5pt}{scalable}
%% text above lines shall be of color gregoriocolor
\grechangestyle{abovelinestext}{\color{gregoriocolor}\footnotesize\itshape}
%% fine-tuning of space beween the staff and the text above lines
\newcommand{\altraise}{0mm} %% default is -0.1cm
\grechangedim{abovelinestextraise}{\altraise}{scalable}
\grechangedim{abovelinestextheight}{10mm}{scalable}
%% fine-tuning of space between the staff and the lyrics
\newcommand{\textraise}{2.8ex} %% default is 3.48471 ex
\grechangedim{spacelinestext}{\textraise}{scalable}
%% fine-tuning of space between the initial and the annotations
\newcommand{\annraise}{0mm} %% default is -0.2mm
\grechangedim{annotationraise}{\annraise}{scalable}
%% fine-tuning the behavior of text placed under bars. We use the so-called "new algorithm" which
%% places the bar in the middle of surrounding notes, and the text in the middle of surrounding text.
%% however, we restrict drastically the deviation of the text from the position of the bar.
\grechangedim{maxbaroffsettextleft}{0.5mm}{scalable}
\grechangedim{maxbaroffsettextright}{0.5mm}{scalable}
%% in case we show NABC, font selection
\gresetnabcfont{gregall}{10}
\newcommand{\smallscore}[1]{
\gresetinitiallines{0}
\vspace{1mm}
\gregorioscore{\subfix{gabc/#1}}
\vspace{-1mm}
\gresetinitiallines{1}
}
\newcommand{\gscore}[1]{
\gregorioscore{\subfix{gabc/#1}}
}
\newcommand{\incipit}[2]{
\gresetinitiallines{0}
\gregorioscore{\subfix{incipits/#1_#2}}
\gresetinitiallines{1}
}
% we want to print NABC 'cause this is the RG
\gresetnabc{1}{visible}
%correction of the space before and after the score by exchanging spaceabovelines for spacebeneathtext
\grechangedim{spaceabovelines}{-3mm}{scalable}
\grechangedim{spacebeneathtext}{3mm}{scalable}
%%%%%%%%%%%%%%% FONTS %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% Main font
\setmainfont[Ligatures=TeX, Scale=\customscale]{Charis SIL}
\setstretch{\fpevalc{1.05 * \customscale}}
%%%%%%%%%%%%%%% Score initials
%% \initialsize resizes the initials, with one argument (size in points)
\newcommand{\initialsize}[1]{
\grechangestyle{initial}{\fontspec{Zallman Caps}\fontsize{#1}{#1}\selectfont}
}
%% default initial size is 32 points
\newcommand{\defaultinitialsize}{28}
\initialsize{\defaultinitialsize}
%% spacing before and after initials to kern the Zallman Caps.
%% this should be changed if we move away from Zallman Caps.
\newcommand{\initialspace}[2]{
\grechangedim{afterinitialshift}{#2}{scalable}
\grechangedim{beforeinitialshift}{#1}{scalable}
}
%% default space before and after initials is 0mm to the left and 2mm to the right.
\newcommand{\defaultannotationshift}{-2mm}
\newcommand{\defaultinitialspace}{\initialspace{0mm}{-\defaultannotationshift}}
\defaultinitialspace{}
%%%%%%%%%%%%%%% Score annotations
\grechangestyle{annotation}{\small}
% on définit le système qui capture des headers pour générer des annotations
% cette commande sera appelée pour définir des abréviations ou autres substitutions
\newcommand{\resultat}{}
\newcommand{\abbrev}[3]{
\IfSubStr{#1}{#2}{ \renewcommand{\resultat}{#3} }{}
}
\newcommand{\officepartannotation}[1]{
\renewcommand{\resultat}{#1}
\abbrev{#1}{ntro}{Intr.}
\abbrev{#1}{re}{Resp.}
\abbrev{#1}{espo}{Resp.}
\abbrev{#1}{adu}{Gr.}
\abbrev{#1}{ll}{All.}
\abbrev{#1}{act}{Tract.}
\abbrev{#1}{equen}{Seq.}
\abbrev{#1}{ffert}{Off.}
\abbrev{#1}{ommun}{Co.}
\abbrev{#1}{an}{Ant.}
\abbrev{#1}{ntiph}{Ant.}
\abbrev{#1}{ntic}{Cant.}
\abbrev{#1}{ymn}{Hy.}
\abbrev{#1}{salm}{}
\abbrev{#1}{Toni Communes}{}
\abbrev{#1}{yrial}{}
\greannotation{\resultat}
}
\newcommand{\modeannotation}[1]{
\renewcommand{\resultat}{#1}
\abbrev{#1}{1}{ {\sc i} }
\abbrev{#1}{2}{ {\sc ii} }
\abbrev{#1}{3}{ {\sc iii} }
\abbrev{#1}{4}{ {\sc iv} }
\abbrev{#1}{5}{ {\sc v} }
\abbrev{#1}{6}{ {\sc vi} }
\abbrev{#1}{7}{ {\sc vii} }
\abbrev{#1}{8}{ {\sc viii} }
\greannotation{\resultat}
}
\gresetheadercapture{office-part}{officepartannotation}{}
\gresetheadercapture{mode}{modeannotation}{string}
%%%%%%%%%%%%%%% GRAPHICAL ELEMENTS %%%%%%%%%%%%%%%
%% V/, R/, A/ and + signs for in-line use (\vv \rr \aa \cc)
\newcommand{\specialcharhsep}{3mm} % space after invoking R/ or V/ or A/ outside rubrics
\newcommand{\vv}{\textcolor{gregoriocolor}{\fontspec[Scale=\customscale]{Charis SIL}℣.\nolinebreak[4]\hspace{\specialcharhsep}\nolinebreak[4]}}
\newcommand{\rr}{\textcolor{gregoriocolor}{\fontspec[Scale=\customscale]{Charis SIL}℟.\nolinebreak[4]\hspace{\specialcharhsep}\nolinebreak[4]}}
\renewcommand{\aa}{\textcolor{gregoriocolor}{\fontspec[Scale=\customscale]{Charis SIL}\Abar.\nolinebreak[4]\hspace{\specialcharhsep}\nolinebreak[4]}}
\newcommand{\cc}{\textcolor{gregoriocolor}{\fontspec[Scale=\customscale]{FreeSerif}\symbol{"2720}~}}
%% Same special characters, for in-score use (<sp>V/ R/ A/ +</sp>)
\gresetspecial{V/}{\textcolor{gregoriocolor}{\fontspec[Scale=\customscale]{Charis SIL}℣.~}}
\gresetspecial{R/}{\textcolor{gregoriocolor}{\fontspec[Scale=\customscale]{Charis SIL}℟.~}}
\gresetspecial{A/}{\textcolor{gregoriocolor}{\fontspec[Scale=\customscale]{Charis SIL}\Abar.~}}
\gresetspecial{+}{{\fontspec[Scale=\customscale]{FreeSerif}†~}}
\gresetspecial{*}{\gresixstar}
\gresetspecial{cross}{\textcolor{gregoriocolor}{\fontspec[Scale=\customscale]{FreeSerif}\symbol{"2720}}}
\gresetspecial{labiacross}{\textcolor{gregoriocolor}{+}}
%% Same special characters, for use in rubrics (no space, and no red command since it will be reddified with the rest)
\newcommand{\vvrub}{{\fontspec[Scale=\customscale]{Charis SIL}℣.~}}
\newcommand{\rrrub}{{\fontspec[Scale=\customscale]{Charis SIL}℟.~}}
\newcommand{\aarub}{{\fontspec[Scale=\customscale]{Charis SIL}\Abar.~}}
%% the asterisk as found in the mediants of text-only psalms
\newcommand{\psstar}{\GreSpecial{*}}
\newcommand{\pscross}{\GreSpecial{+}}
%% also, most psalms do not call those but use † and * - todo
%% Macro to print rubrics and normal text inside of them
\newcommand{\rubric}[1]{\textcolor{gregoriocolor}{\emph{#1}}}
\newcommand{\normaltext}[1]{{\normalfont\normalcolor #1}}
%% Macro to print initials of some texts in red
\newcommand{\colored}[1]{
\textcolor{gregoriocolor}{#1}%
}
%% Macro to print the blessing
\newcommand{\blessing}{
\vspace{2mm}
\versiculus{Dóminus vobíscum}{Et cum spíritu tuo}{Le Seigneur soit avec vous}{Et avec votre esprit}
\versiculus{Benedícat vos omnípotens Deus, \cc Pater, et Fílius, et Spíritus Sanctus}{Amen}{Et que Dieu tout-puissant vous bénisse, le Père, le Fils, et le Saint-Esprit}{Amen}
}
%%%%%%%%%%%%%%% PAGE HEADERS AND FOOTERS %%%%%%%
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\setlength{\headheight}{20pt}
\fancyhead[RO]{\small\rightmark\hspace{1cm}\thepage}
\fancyhead[LE]{\small\thepage\hspace{1cm}\leftmark}
%%%%%%%%%%%%%%% COLUMN MANAGEMENT %%%%%%%%%%%%%%%
\usepackage{paracol}
\usepackage{multicol}
\setlength\columnseprule{0.4pt}
\setlength{\multicolsep}{6pt plus 2pt minus 1.5pt}
\newcommand{\psalm}[2]{
\vspace{0.5\baselineskip}
\begin{paracol}{2}
\begin{itemize}[
label=\null,
leftmargin=0pt,
itemindent=10pt,
labelsep=0pt,
labelwidth=0pt,
rightmargin=0pt,
parsep=0pt,
itemsep=0pt,
topsep=-2mm]
\input{psalmi_la/#1_#2.tex}
\end{itemize}
\switchcolumn
\begin{itemize}[
label=\null,
leftmargin=0pt,
itemindent=10pt,
labelsep=0pt,
labelwidth=0pt,
rightmargin=0pt,
parsep=0pt,
itemsep=0pt,
topsep=-2mm]
\input{psalmi_fr/#1.tex}
\end{itemize}
\end{paracol}
}
\newcommand{\twocoltext}[2]{
\begin{paracol}{2}
#1
\switchcolumn
#2
\end{paracol}
}
\newcommand{\oratio}[2]{
\smalltitle{Oraison}
\twocoltext{#1}{#2}
}
\newcommand{\versiculus}[4]{
\twocoltext{
\vv #1. \\ \rr #2.
}{
\vv #3. \\ \rr #4.
}
}
\newcommand{\capitulum}[3]{
\smalltitle{Lecture brève}\hfill\rubric{#1}
\twocoltext{#2}{#3}
}
\newcommand{\columnbalancinglatin}[1]{
\vspace{2mm}#1
}
\newcommand{\smalltitle}[1]{
\vspace{0.5\baselineskip}
\par{\centering\textbf{#1}\par}
\vspace{0.5\baselineskip}
}
\newcommand{\bigtitle}[3]{
\begin{center}
{\fontspec[Scale=\customscale]{Futura Book}
\MakeUppercase{\Large #1}\\
}
\end{center}
\renewcommand{\rightmark}{\hyphenpenalty=50{\sc#3}}
\renewcommand{\leftmark}{\hyphenpenalty=50{\sc#2}}
\thispagestyle{empty}
\addcontentsline{toc}{section}{#3}
}
\newcommand{\translation}[1]{
\emph{#1}
}
\makeatletter
\newcommand{\@printReading}[1]{
\def\content{%
{#1
}
\par\noindent}
\content
\egroup\endgroup}
\newcommand\reading{\begingroup%
\begingroup%
\lccode`\~=9\relax%
\lowercase{%
\endgroup
\def~%
}{\hspace{8mm}}%
\catcode9=\active%
\bgroup\obeylines\@printReading}
\makeatother
\newcommand{\hymntranslation}[1]{
\begin{multicols}{2}
\reading{#1}
\end{multicols}
}
%%%%%%%%%%%%%%% SUBFILES %%%%%%%%%%%%%%%
\usepackage{xr}
\usepackage{subfiles}
%% When we start a new subfile (new chapter),
%% we start on a new page (with blank filling on the previous page) and create a corresponding label.
\newcommand{\customsubfile}[1]{\newpage\label{#1}\thispagestyle{empty}\subfile{#1}}