-
Notifications
You must be signed in to change notification settings - Fork 0
/
mtor.sty
367 lines (311 loc) · 11.4 KB
/
mtor.sty
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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
\NeedsTeXFormat{LaTeX2e}[2000/06/01]
\ProvidesPackage{mtor}[2022/02/24 v1.0]
\RequirePackage[intlimits]{amsmath}
\RequirePackage{indentfirst,amsfonts,amssymb,fancyhdr,theorem,enumerate,makeidx,multicol,textcase,fancybox,color,xltxtra,polyglossia,graphicx,calc,gensymb,hyphenat,etoolbox}
\patchcmd{\thebibliography}{\chapter*}{\section*}{}{}
\setdefaultlanguage{english}
\RequirePackage[perpage,symbol]{footmisc}[2005/03/17]
\RequirePackage{datetime}
\def\DTtoday{\formatdate{\day}{\month}{\year}}
\def\shorttoday{{\shortdate\showdowfalse\formatdate{\day}{\month}{\year}}}
\RequirePackage{lettrine}
\setcounter{DefaultLines}{2}
% conditional markup tuning, to maintain more than 1 version of module sources with hand-tuned markup
\def\tunemarkuptag#1{\@namedef{tune@markup@#1}{}}
\def\tunemarkup#1#2{\@ifundefined{tune@markup@#1}{}{#2}}
\def\tunemarkuptwo#1#2#3{\@ifundefined{tune@markup@#1}{#3}{#2}}
% various page sizes
\tunemarkuptag{pgnexus10}
%\tunemarkuptag{pgauraone}
% various font families
%\tunemarkuptag{garamond}
\tunemarkuptag{caslon}
\tunemarkup{garamond}{%
\def\mainfontname{Garamond Premier Pro}
\def\parttitlefontname{GoudyHandtooled BT}
\def\titlefontname{Garamond Premier Pro Medium Display}
\def\mdheadingfontname{Garamond Premier Pro Medium Caption}
}
\tunemarkup{caslon}{%
\def\mainfontname{Adobe Caslon Pro}
\def\parttitlefontname{GoudyHandtooled BT}
\def\titlefontname{Adobe Caslon Pro}
\def\mdheadingfontname{Adobe Caslon Pro}
}
\setmainfont[WordSpace={1.2,2.5,1.0},Mapping=tex-text]{\mainfontname}
\newfontfamily\parttitlefont[Letters=Uppercase,LetterSpace=3.0,WordSpace=2.0,Mapping=tex-text]{\parttitlefontname}
\newfontfamily\titlefont[Letters=Uppercase,LetterSpace=3.0,WordSpace=2.0,Mapping=tex-text]{\titlefontname}
\newfontfamily\mdheadingfont[Numbers=Lining,LetterSpace=1.2,WordSpace=1.2,Mapping=tex-text]{\mdheadingfontname}
\newfontfamily\libertinefont[Mapping=tex-text]{Linux Libertine O}
\newcommand{\tux}{{\libertinefont ^^^^e000}}
% Google Nexus 10 (or any Android 10" colour device)
\tunemarkup{pgnexus10}{\RequirePackage[dvips,headheight=19pt,headsep=2pt,vmargin={0.3in,0.2in},hmargin={0.1in},twoside=true,papersize={135.0mm,216mm}]{geometry}}
% Kobo Aura One 8"
\tunemarkup{pgauraone}{\RequirePackage[dvips,headheight=19pt,headsep=4pt,vmargin={0.3in,0.25in},hmargin={0.07in},twoside=true,papersize={118.0mm,158.0mm}]{geometry}}
\RequirePackage[plainpages=false,
hyperfootnotes=false,
pdfpagelabels,
colorlinks,
linkcolor=\tunemarkup{pgnexus7}{blue}\tunemarkup{pgnexus10}{blue}\tunemarkup{pgthinmob}{blue}\tunemarkup{pgkoboaurahd}{black}\tunemarkup{pgkoboauraone}{black}\tunemarkup{pgkobomini}{black}\tunemarkup{pgafour}{black},%
anchorcolor=black,
citecolor=black,
filecolor=black,
menucolor=black,
pagecolor=black,
urlcolor=\tunemarkup{pgnexus7}{blue}\tunemarkup{pgnexus10}{blue}\tunemarkup{pgthinmob}{blue}\tunemarkup{pgkoboaurahd}{black}\tunemarkup{pgkoboauraone}{black}\tunemarkup{pgkobomini}{black}\tunemarkup{pgafour}{black}]{hyperref}
\AtBeginDocument{%
\hypersetup{%
pdftitle={The Mathematical Theory of Relativity},%
pdfauthor={Sir Arthur Stanley Eddington, M.A., M.Sc., F.R.S.},%
pdfcreator={Bibles.org.uk Typesetting System based on TeX Live 2021},%
pdfsubject={General Theory of Relativity},%
pdfkeywords={time,space,relativity,gravitation,metric,Einstein},%
pdflang={English},%
pdfcreationdate={D:20220224142200Z},%
pdfmoddate={D:\pdfdate-00'00'}%
}%
}
\newcommand{\Ham}{\mathfrak{h}}
\newcommand{\Foreign}[1]{\textit{#1}}
\newcommand{\ChapNum}[1]{\hyperref[chapter:#1]{{\upshape #1}}}
\newcommand{\SecNum}[1]{\hyperref[section:#1]{{\upshape #1}}}
\newcommand{\SecRef}[1]{\hyperref[section:#1]{{\upshape §\;#1}}}
\newcommand{\SecRefs}[1]{\hyperref[section:#1]{{\upshape §§\;#1}}}
\newcommand{\Title}[1]{\textit{#1}}
\newcommand{\Item}[1]{$#1$}% Upright parentheses
\newcommand{\Vol}[1]{\textsc{\MakeLowercase{#1}}}
\newcommand{\CGS}{\textsc{c.g.s.}}
\newcommand{\NGC}{\text{\textsc{n.g.c.}}}
\newcommand{\RA}{\text{\textsc{r.a.}}}
\newcommand{\Indent}{\null\qquad}
\renewcommand{\(}{{\upshape(}}
\renewcommand{\)}{{\upshape)}}
%% Miscellaneous mathematical formatting %%
\newcommand{\Neg}{\phantom{-}}
\newcommand{\9}{\phantom{9}}
\newcommand{\FlushRunningHeads}{\clearpage\fancyhf{}}
\newcommand{\InitRunningHeads}{%
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\thispagestyle{empty}
\fancyhead[R]{\thepage}
}
\newcommand{\RHeads}[1]{\small\textsc{\MakeTextLowercase{#1}}}
\newcommand{\SetRunningHeads}[2][C]{\fancyhead[#1]{\RHeads{#2}}}
\newcommand{\BookMark}[2]{\phantomsection\pdfbookmark[#1]{#2}{#2}}
\newcommand{\ChapHead}[2][\titlefontsize]{%
\section*{\centering\mdheadingfont\titlefontsize#1\MakeUppercase{#2}}
}
\newcommand{\SectTitle}[2][\sectionfontsize]{%
\section*{\centering#1\titlefont #2}
}
\newcommand{\SubsectTitle}[2][]{%
\subsubsection*{\indent#1#2}
}
\newcommand{\Preface}{%
\FlushRunningHeads
\InitRunningHeads
\BookMark{0}{Preface}
\SetRunningHeads{Preface}
\vspace*{0.5in}
\ChapHead{\MakeUppercase{Preface}}
\mainfontsize
}
\newcommand{\Matter}[2][]{%
\FlushRunningHeads
\InitRunningHeads
\BookMark{0}{#2}
\SetRunningHeads{#2}
\vspace*{0.5in}
\ChapHead{\MakeUppercase{#2}}
\label{appendix:#2}%
\addtocontents{toc}{\protect\ToCApp{#2}}
\mainfontsize
}
\newcommand{\Chapter}[2]{%
\FlushRunningHeads
\InitRunningHeads
\BookMark{0}{#1. #2}
\label{chapter:#1}
\vspace*{0.5in}
\ChapHead{\MakeUppercase{Chapter #1}}
\SectTitle[\sectionfontsize]{\MakeUppercase{#2}}
\addtocontents{toc}{\protect\ChapHead{CHAPTER #1}}
\addtocontents{toc}{\protect\SectTitle[\protect\small]{\MakeUppercase{#2}}}
\SetRunningHeads[L]{Ch.~#1}%
\mainfontsize
}
\newcommand{\Part}[2]{%
\addtocontents{toc}{\protect\SectTitle[\protect\small]{\protect\textsc{Part #1 #2}}}
\SectTitle[\small]{\textsc{Part #1 #2}}
}
% \PadTo[alignment]{width text}{visible text}
\newcommand{\PadTo}[3][c]{%
\settowidth{\TmpLen}{$#2$}%
\makebox[\TmpLen][#1]{$#3$}%
}
\newcommand{\PadTxt}[3][c]{%
\settowidth{\TmpLen}{#2}%
\makebox[\TmpLen][#1]{#3}%
}
% For internal use by \Tag and \Eq
\newcounter{SecNo}
\newcommand{\Section}[3][]{
\subsubsection*{\sectionfontsize\indent#2 #3.}
\BookMark{1}{#2 #3}
\refstepcounter{SecNo}
\label{section:\theSecNo}
\addtocontents{toc}{\protect\ToCLine{\theSecNo}{#3}}
\ifthenelse{\equal{#1}{}}{%
\SetRunningHeads[C]{#3}%
}{%
% \addtocontents{toc}{\protect\ToCLine{\theSecNo}{#1}}
\SetRunningHeads[C]{#1}%
}
\mainfontsize
}
% Cross-ref-able equation tags
\newcommand{\Tag}[1]{%
\phantomsection\label{eqn:#1}\tag*{\ensuremath{#1}}%
}
\newcommand{\tTag}[1]{%
\phantomsection\label{eqn:#1}\ensuremath{#1}%
}
\newcommand{\Eq}[1]{%
\hyperref[eqn:#1]{\ensuremath{#1}}%
}
\newcommand{\EqNo}[1]{%
\hyperref[eqn:(#1)]{\ensuremath{#1}}%
}
\newcommand{\Subsection}[2][]{%
\ifthenelse{\equal{#1}{}}{%
\SubsectTitle[\normalfont\itshape\mainfontsize]{#2}
}{% else
\SubsectTitle[\normalfont\itshape\mainfontsize]{\Item{#1} #2}
}
}
\newcommand{\Summary}[1]{%
\SubsectTitle{\centering\normalfont\textsc{#1}}
}
\newcommand{\Signature}[2]{%
\medskip
\null\hfill#1\hspace{\parindent}
\medskip
{\large #2}%
}
\tolerance=100
\renewcommand{\headrulewidth}{0pt}
\newcommand{\dd}{\partial}
\newcommand{\Wave}{\square}
\newcommand{\Eta}{\mathrm{H}}
\newcommand{\Kappa}{\mathrm{K}}
\newcommand{\omicron}{o}
\newcommand{\mf}[1]{\mathfrak{#1}}
\newcommand{\mc}[1]{\mathcal{#1}}
\newcommand{\Star}[1]{{}^{*}\!#1}
\DeclareMathOperator{\cosec}{cosec}
%[** TN: Hard-coded lengths to make arrows abut]
\newcommand{\MuNuarrow}{\llap{$\begin{array}{@{}l@{}l@{}}
\raisebox{-1ex}{$\downarrow$} & \hspace*{-0.4em}\rightarrow \mu \\[-\baselineskip]
\nu
\end{array}$}
}
% Loosen spacing
\setlength{\emergencystretch}{1em}
\newcommand{\Loosen}{\spaceskip 0.375em plus 0.5em minus 0.25em}
% Scratch pad for length calculations
\newlength{\TmpLen}
% Appendix entries
\newcommand{\ToCApp}[1]{%
\noindent\parbox[b]{\textwidth-2em}{%
\small\ToCBox{}\textsc{#1}\ \dotfill}\ToCPage{appendix:#1}%
}
% Page numbers
\newcommand{\ToCPage}[1]{\makebox[2em][r]{\small\pageref{#1}}}
% ** Approximate; refers to original page separators, no hyperlink
\newcommand{\PgNo}[2][]{%
\ifthenelse{\equal{#1}{}}{%
\pageref*{pg:#2}%
}{%
\pageref{page:#2}%
}%
}
\newenvironment{ToCPar}{\begin{quote}\footnotesize}{\end{quote}}
%% Index formatting
\makeindex
\renewcommand{\@idxitem}{\par\hangindent 30\p@\global\let\idxbrk\nobreak}
\renewcommand\subitem{\idxbrk\@idxitem \hspace*{12\p@}\let\idxbrk\relax}
\renewcommand{\indexspace}{\par\penalty-3000 \vskip 10pt plus5pt minus3pt\relax}
\renewenvironment{theindex}{%
\setlength\columnseprule{0.5pt}\setlength\columnsep{18pt}%
\begin{multicols}{2}[{\Matter[The numbers refer to pages]{Index}\small}]%
\setlength\parindent{0pt}\setlength\parskip{0pt plus 0.3pt}%
\thispagestyle{empty}\let\item\@idxitem\raggedright%
}{%
\end{multicols}\FlushRunningHeads%
}
%** Auxiliary index commands
\newcommand{\indexfn}[1]{#1 (footnote)}
\newcommand{\MainMatter}{%
\FlushRunningHeads
\InitRunningHeads
\mainmatter
%\BookMark{-1}{Main Matter}
}
\newcommand{\TableofContents}{%
\FlushRunningHeads
\InitRunningHeads
\SetRunningHeads{Contents}
\BookMark{0}{Contents}
\tableofcontents
}
% Set the section number in a fixed-width box
\newcommand{\ToCBox}[1]{\settowidth{\TmpLen}{999.}%
\makebox[\TmpLen][r]{#1}\hspace*{1em}%
}
% For internal use, to determine if we need the Section/Page line
\newcommand{\ToCAnchor}{}
% \ToCLine{SecNo}{Title}
\newcommand{\ToCLine}[2]{%
\label{toc:#1}%
\ifthenelse{\not\equal{\pageref{toc:#1}}{\ToCAnchor}}{%
\renewcommand{\ToCAnchor}{\pageref{toc:#1}}%
%\noindent\makebox[\textwidth][r]{\scriptsize SECTION\hfill PAGE}\\[8pt]%
}{}%
\settowidth{\TmpLen}{9999}%
\noindent\strut\parbox[b]{\textwidth-\TmpLen}{\small%
\ToCBox{#1.}\hangindent4em#2\dotfill}%
\makebox[\TmpLen][r]{\small\pageref{section:#1}}%
\smallskip
}
\newcommand{\Bibitem}[1]{\par\noindent\hangindent2em\textsc{#1}}
\newcommand{\Same}{\raisebox{0.5ex}{\rule{2em}{1pt}}}
\tunemarkup{pgnexus10}{%
\definecolor{mygreen}{rgb}{0.0, 0.4, 0.0}
\definecolor{lettrinecolour}{rgb}{0.8, 0.0, 0.0}
\DeclareMathSizes{15}{11}{7}{6}
\newcommand{\mainfontsize}{\fontsize{15}{17}\selectfont}
\newcommand{\sectionfontsize}{\titlefont\fontsize{15}{15}\selectfont}
\newcommand{\booktitlefontsize}{\LARGE}
\newcommand{\authortitlefontsize}{\Large}
\newcommand{\titlefontsize}{\fontsize{18}{18}\selectfont}
\newcommand{\tablefontsize}{\small}
\renewcommand{\footnotesize}{\fontsize{13}{15}\selectfont}
}
\tunemarkup{pgauraone}{%
\definecolor{mygreen}{rgb}{0.0, 0.0, 0.0}
\definecolor{lettrinecolour}{rgb}{0.0, 0.0, 0.0}
\DeclareMathSizes{16}{10}{7}{6}
\newcommand{\mainfontsize}{\fontsize{16}{18}\selectfont}
\newcommand{\sectionfontsize}{\titlefont\fontsize{15}{15}\selectfont}
\newcommand{\booktitlefontsize}{\Large}
\newcommand{\authortitlefontsize}{\large}
\newcommand{\titlefontsize}{\fontsize{18}{18}\selectfont}
\newcommand{\tablefontsize}{\fontsize{9.5}{12}\selectfont}
\renewcommand{\footnotesize}{\fontsize{13}{15}\selectfont}
}
\addto\captionsenglish{%
\renewcommand{\contentsname}{\protect\thispagestyle{empty}\protect\ChapHead{\titlefont CONTENTS}\protect\vspace{-\baselineskip}}
}
\newcommand{\titlesepbig}{{\usefont{U}{webo}{xl}{n}\Large\textcolor{mygreen}{ahb}}}
\newcommand{\myurl}[1]{\href{#1}{#1}}