-
Notifications
You must be signed in to change notification settings - Fork 0
/
templateNV.sty
704 lines (609 loc) · 21.5 KB
/
templateNV.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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
%% templateNV.sty
%% A package modified from NotesTeXV3.sty from
%% https://jhep.sissa.it/jhep/help/JHEP_TeXclass.jsp
%% by Aditya Dhumuntarao.
% ----------------------------------------------------------------------
% Jhep Master Presets
% ----------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{templateNV}[2021/10/22 rV3]
\gdef\@fpheader{\ }
\gdef\@journal{jhep}
\newif\ifnotoc\notocfalse
\newif\ifemailadd\emailaddfalse
\newif\iftoccontinuous\toccontinuousfalse
\newif\ifnatbibsort\natbibsorttrue
\DeclareOption{no-natbib-sort}{\natbibsortfalse}
\ProcessOptions\relax
\ifnatbibsort\RequirePackage[numbers,sort&compress]{natbib}\else\RequirePackage[numbers,compress]{natbib}\fi
\RequirePackage{color}
\RequirePackage[colorlinks=true
,urlcolor=Maroon
,anchorcolor=Maroon
,citecolor=Maroon
,filecolor=Maroon
,linkcolor=Maroon
,menucolor=Maroon
,linktocpage=true
,pdfproducer=medialab
,pdfa=true
,pdfusetitle
]{hyperref}
% ----------------------------------------------------------------------
% User Top Level Packages: Required
% ----------------------------------------------------------------------
\usepackage{marginnote,sidenotes,fancyhdr,geometry}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[many]{tcolorbox}
% ----------------------------------------------------------------------
% User Top Level Packages: Additional & Styling
% ----------------------------------------------------------------------
\usepackage[T1]{fontenc} % Font Styling
\usepackage{lmodern,mathrsfs}
\usepackage[shortlabels]{enumitem} % Enumitem Options
\usepackage{mathtools,amsthm,amssymb,amsfonts} % Math Presets
\usepackage{thmtools,amsmath,cancel,dsfont,bm}
% \usepackage{minted} % Code cells
\usepackage{array,tabularx,booktabs} % Table Presets
\usepackage{nicematrix} % Block matrices
\usepackage{graphicx,wrapfig,float,caption} % Figure Presets
\usepackage{setspace,multicol} % Text Presets
\usepackage{tikz,tikz-cd,tikzsymbols,physics} % Physics Presets
\usepackage{lipsum} % Placeholder text
% ----------------------------------------------------------------------
% User Page Prefrences
% ----------------------------------------------------------------------
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\geometry{paperheight=11in,paperwidth=8.5in, %fix paperwidth and height.
marginparsep=.02\paperwidth,marginparwidth=.2\paperwidth,
inner=.11\paperwidth,voffset=-1in,headheight=.02\paperheight,
headsep=.03\paperheight,footskip=20pt,
textheight=.795\paperheight,textwidth=.62\paperwidth}
\pagestyle{fancy}%
\newlength{\myoddoffset}%
\setlength{\myoddoffset}{\marginparwidth + \marginparsep}%
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}%
\renewcommand{\subsectionmark}[1]{\markright{#1}{}}%
\fancypagestyle{fancynotes}{%
\fancyhf{}%
\fancyheadoffset[rh]{\myoddoffset}%
\renewcommand{\headrulewidth}{0pt}%
\fancyhead[L]{\textsc{\leftmark}}%
\fancyhead[R]{\footnotesize \textit{\rightmark}~~~~ \thepage}%
}%
\fancypagestyle{fancypart}{%
\fancyhf{}%
\fancyfootoffset[rh]{\myoddoffset}%
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[L]{\footnotesize \thepage}%
}%
\newenvironment{fullpage}
{\smallskip\noindent\begin{minipage}
{\textwidth+\marginparwidth+\marginparsep}\hrule\smallskip\smallskip}
{\hrule\end{minipage}\vspace{.1in}}
% ----------------------------------------------------------------------
% User Created Environments
% ----------------------------------------------------------------------
\newlength{\spacelength}
\settowidth{\spacelength}{\normalfont\ }
\declaretheoremstyle[
headfont={\bfseries\sffamily\footnotesize},
notefont={\normalfont},
bodyfont={\normalfont},
headpunct={\relax},%\newline,
headformat={%
\makebox[0pt][r]{\NAME\ \NUMBER\hspace{\marginparsep}}\hskip-\spacelength{\normalsize\NOTE}},
]{theorem}
\tcolorboxenvironment{theorem}{
boxrule=0pt,
boxsep=0pt,
colback={White!90!Dandelion},
enhanced jigsaw,
borderline west={1pt}{0pt}{Dandelion},
sharp corners,
before skip=10pt,
after skip=10pt,
left=5pt,
right=5pt,
breakable,
}
\declaretheorem[style=theorem]{theorem}
\let\proof\relax
\let\endproof\relax
\declaretheoremstyle[
headfont={\small\scshape},
notefont={\normalfont},
bodyfont={\normalfont},
headpunct={\relax},
headformat={%
\makebox[0pt][r]{\NAME\hspace{\marginparsep}}\hskip-\spacelength{\NOTE}},
]{proof}
\tcolorboxenvironment{proof}{
boxrule=0pt,
boxsep=0pt,
blanker,
borderline west={1pt}{0pt}{NavyBlue!80!white},
before skip=10pt,
after skip=10pt,
left=5pt,
right=5pt,
breakable,
}
\declaretheoremstyle[
headfont={\footnotesize\itshape},
notefont={\normalfont},
bodyfont={\normalfont},
headpunct={\relax},
headformat={%
\makebox[0pt][r]{\NAME\hspace{\marginparsep}}\hskip-\spacelength{\NOTE}},
]{claim}
\declaretheorem[
style=proof,
qed=\qedsymbol]{proof}
\declaretheorem[style=claim]{Intuition}
\theoremstyle{theorem}
\newtheorem{ques}{Question}
\theoremstyle{theorem}
\newtheorem{example}{Exercise}
\tcolorboxenvironment{example}{
boxrule=0pt,
boxsep=0pt,
blanker,
borderline west={1pt}{0pt}{Red},
before skip=35pt,
after skip=10pt,
sharp corners,
left=5pt,
right=5pt,
breakable,
}
\theoremstyle{theorem}
\newtheorem{definition}{Definition}
\tcolorboxenvironment{definition}{
boxrule=0pt,
boxsep=0pt,
colback={White!90!Cerulean},
enhanced jigsaw,
borderline west={1pt}{0pt}{Cerulean},
sharp corners,
before skip=25pt,
after skip=10pt,
left=5pt,
right=5pt,
breakable,
}
\theoremstyle{theorem}
\newtheorem{lemma}{Lemma}
\tcolorboxenvironment{lemma}{
boxrule=0pt,
boxsep=0pt,
blanker,
borderline west={1pt}{0pt}{Red},
before skip=10pt,
after skip=10pt,
sharp corners,
left=5pt,
right=5pt,
breakable,
}
\theoremstyle{claim}
\newtheorem{intu}{Intuition}
\theoremstyle{claim}
\newtheorem{sol}{Solution}
\theoremstyle{claim}
\newtheorem{remark}{Remark}
% \theoremstyle{claim}
% \newtheorem{example}{Example}
% \tcolorboxenvironment{example}{
% boxrule=0pt,
% boxsep=0pt,
% blanker,
% borderline west={1pt}{0pt}{Black},
% sharp corners,
% before skip=10pt,
% after skip=10pt,
% left=5pt,
% right=5pt,
% breakable,
% }
\renewcommand*{\raggedleftmarginnote}{\noindent}
\renewcommand*{\raggedrightmarginnote}{\noindent}
\newcommand{\mn}[1]{\textsuperscript{\thesidenote}{}\marginnote{\textsuperscript{\thesidenote}{}\itshape\footnotesize #1}\refstepcounter{sidenote}}
\newcommand{\en}[1]{\marginnote{\footnotesize{#1}}}
\newcommand{\lec}[2]{{\setlength{\marginparwidth}{.07\paperwidth}\reversemarginpar\marginnote{\centering\footnotesize{\textsf{\bfseries #1}}\\#2}}}
\newcommand{\sn}[1]{\sidenote{\itshape\footnotesize #1}}
% ----------------------------------------------------------------------
% User Macros: Add Below
% ----------------------------------------------------------------------
% Macros: https://blog.martisak.se/2023/08/11/top-latex-commands/
\newcommand{\invis}[1]{\begingroup\color{white}#1\endgroup}
% These commands are dynamically sized by the * version
\DeclarePairedDelimiter\br{\lbrace}{\rbrace}
\DeclarePairedDelimiter\p{\lparen}{\rparen}
\DeclarePairedDelimiter\pl{\Big(}{\Big)}
\DeclarePairedDelimiter\sparen{[}{]}
\DeclarePairedDelimiter\bk{\langle}{\rangle}
% \abs{} already defined: |x|
% \norm{} already defined: ||x||
% \ip{} and \braket{} already defined: \ip{x} = <x|x>, \ip{x}{y} = <x|y>
\newcommand{\BigO}[1]{\mathcal{O}\!\left(#1\right)}
\newcommand{\sharedkey}{
\raisebox{-.5 ex}{\tikz{
\draw[fill=blue, draw=white] (0ex,0) arc(90:270:1ex) -- cycle;
\draw[fill=red, draw=white] (0ex,0) arc(90:-90:1ex) -- cycle; }}
}
\newcommand{\di}{\mathrm{i}\mkern1mu} % imaginary i in roman and with correct spacing
%$\pd{f}{x}$ produces $\frac{\partial f}{\partial x}$
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}
\newcommand\ub[2]{
\underbracket[.25pt][12pt]{#1}_{#2}
}
\newcommand\ob[2]{
\overbracket[.25pt][12pt]{#1}^{#2}
}
\newcommand{\nt}{{}^3\!} % Superscript 3 before character with negative spacing
\newcommand{\np}{{}^+\!} % Superscript + before character with negative spacing
\newcommand{\Z}{\mathbb{Z}} % Integer numbers
\newcommand{\R}{\mathbb{R}} % Real numbers
\newcommand{\N}{\mathbb{N}} % Natural numbers or prime numbers
\newcommand{\C}{\mathbb{C}} % Complex numbers
\newcommand{\Np}{\mathbb{N}^+} % Natural numbers including 0
\newcommand{\F}{\mathbb{F}} % Natural numbers including 0
\newcommand{\Hs}{\mathbb{H}} % Half spaces/Quaternions
% Groups and Algebras
% \newcommand{\O}{\text{O}}
\newcommand{\U}{\text{U}}
\newcommand{\GL}{\text{GL}}
\newcommand{\SL}{\text{SL}}
\newcommand{\SO}{\text{SO}}
\newcommand{\SU}{\text{SU}}
% \newcommand{\sl}{\mathfrak{sl}}
\newcommand{\so}{\mathfrak{so}}
\newcommand{\su}{\mathfrak{su}}
\newcommand\tb[1]{\textbf{#1}} % Bold text
% Remember \intercal for matrix transpose
\newcommand\id{\mathds{1}} % Identity
\newcommand\vol{\text{vol}} % Volume
\newcommand\diag{\text{diag}} % Diagonal matrix
\newcommand\sign{\text{sign}} % Sign
\newcommand\supp{\text{supp\:}} % Support
\newcommand\Vect{\text{Vect}} % Vector space
\newcommand\Ad{\text{Ad}} % Adjoint space
% Images for math environment
% Centered image
\newcommand{\mim}[1]{
\begin{gathered}
\includegraphics[width=6em]{#1}
\end{gathered}}
% Centered image with size
\newcommand{\mims}[2]{
\begin{gathered}
\includegraphics[width=#2]{#1}
\end{gathered}}
% Captioned centered image
\newcommand{\mimc}[2]{
\begin{gathered}
\includegraphics[width=6em]{#1}
\caption{#2}
\end{gathered}}
% Rotated centered image
\newcommand{\mima}[2]{
\begin{gathered}
\rotatebox{#2}{\includegraphics[width=6em]{#1}}
\end{gathered}}
% Fraktur font
\newcommand{\mf}[1]{\mathfrak{#1}}
% Calligraphic font
\newcommand{\mc}[1]{\mathcal{#1}}
% Roman numerals
\newcommand{\rn}[1]{\MakeUppercase{\romannumeral #1}}
%===========================================================================================================
\def\@subheader{\@empty}
\def\@keywords{\@empty}
\def\@abstract{\@empty}
\def\@xtum{\@empty}
\def\@dedicated{\@empty}
\def\@arxivnumber{\@empty}
\def\@collaboration{\@empty}
\def\@collaborationImg{\@empty}
\def\@proceeding{\@empty}
\def\@preprint{\@empty}
\def\@acknowledgments{\@empty}
\newcommand{\subheader}[1]{\gdef\@subheader{#1}}
\newcommand{\keywords}[1]{\if!\@keywords!\gdef\@keywords{#1}\else%
\PackageWarningNoLine{\jname}{Keywords already defined.\MessageBreak Ignoring last definition.}\fi}
\renewcommand{\abstract}[1]{\gdef\@abstract{#1}}
\newcommand{\dedicated}[1]{\gdef\@dedicated{#1}}
\newcommand{\arxivnumber}[1]{\gdef\@arxivnumber{#1}}
\newcommand{\proceeding}[1]{\gdef\@proceeding{#1}}
\newcommand{\xtumfont}[1]{\textsc{#1}}
\newcommand{\correctionref}[3]{\gdef\@xtum{\xtumfont{#1} \href{#2}{#3}}}
\newcommand\jname{JHEP}
\newcommand{\acknowledgments}[1]{\gdef\@acknowledgments{#1}}
%\newcommand\acknowledgments{\section*{Acknowledgments}}
\newcommand\notoc{\notoctrue}
\newcommand\preprint[1]{\gdef\@preprint{\hfill #1}}
%Equivalent to ``\footnote'', but can be used inside the \author macro
% because it does not write the footnote mark
% it has an optional argument that will be used as footnote mark when given
% WARNING: when the optional argument is used, the footnotecounter is not increased
% WARNING: the character ``!'' cannot be used.
% If you really need it use somthing like [\relax !] as the optional arg.
\newcommand\note[2][]{%
\if!#1!%
\stepcounter{footnote}\footnotetext{#2}%
\else%
{\renewcommand\thefootnote{#1}%
\footnotetext{#2}}%
\fi}
%Use this if you want to try to keep some piece of the abstract on a
%very long first page
\newcommand\compress{%
\renewcommand\afterProceedingsSpace{\bigskip}%
\renewcommand\afterTitleSpace{\bigskip}%
\renewcommand\afterRuleSpace{\bigskip\bigskip}
\renewcommand\afterEmailSpace{\par\bigskip}}
%authors and affiliations
\newtoks\auth@toks
\renewcommand{\author}[2][]{%
\if!#1!%
\auth@toks=\expandafter{\the\auth@toks#2\ }%
\else
\auth@toks=\expandafter{\the\auth@toks#2$^{#1}$\ }%
\fi
}
\newtoks\affil@toks\newif\ifaffil\affilfalse
\newcommand{\affiliation}[2][]{%
\affiltrue
\if!#1!%
\affil@toks=\expandafter{\the\affil@toks{\item[]#2}}%
\else
\affil@toks=\expandafter{\the\affil@toks{\item[$^{#1}$]#2}}%
\fi
}
%emails
%automatically put a comma between emails
\newtoks\email@toks\newcounter{email@counter}%
\setcounter{email@counter}{0}%
\newcommand{\emailAdd}[1]{%
\emailaddtrue%
\ifnum\theemail@counter>0\email@toks=\expandafter{\the\email@toks, \@email{#1}}%
\else\email@toks=\expandafter{\the\email@toks\@email{#1}}%
\fi\stepcounter{email@counter}}
\newcommand{\@email}[1]{\href{mailto:#1}{\tt #1}}
% Collaboration macros
\newcommand*\collaboration[1]{\gdef\@collaboration{#1}}
\newcommand*\collaborationImg[2][]{\gdef\@collaborationImg{#2}}
%all pieces get a ``after'' spacing
\newcommand\afterLogoSpace{\smallskip}
\newcommand\afterSubheaderSpace{\vskip3pt plus 2pt minus 1pt}
\newcommand\afterProceedingsSpace{\vskip21pt plus0.4fil minus15pt}
\newcommand\afterTitleSpace{\vskip10pt}
%\newcommand\afterRuleSpace{\vskip23pt plus0.06fil minus13pt}
\newcommand\afterRuleSpace{\vskip20pt plus0.06fil minus13pt}
\newcommand\afterCollaborationSpace{\vskip3pt plus 2pt minus 1pt}
\newcommand\afterCollaborationImgSpace{\vskip3pt plus 2pt minus 1pt}
\newcommand\afterAuthorSpace{\vskip5pt plus4pt minus4pt}
\newcommand\afterAffiliationSpace{\vskip3pt plus3pt}
%\newcommand\afterEmailSpace{\vskip16pt plus9pt minus10pt\filbreak}
\newcommand\afterEmailSpace{\vskip20pt\filbreak}
\newcommand\afterXtumSpace{\par\bigskip}
\newcommand\afterAbstractSpace{\vskip16pt plus9pt minus13pt}
\newcommand\afterKeywordsSpace{\vskip16pt plus9pt minus13pt}
\newcommand\afterArxivSpace{\vskip3pt plus0.01fil minus10pt}
\newcommand\afterDedicatedSpace{\vskip0pt plus0.01fil}
\newcommand\afterTocSpace{\bigskip\medskip}
\newcommand\afterTocRuleSpace{\bigskip\bigskip}
%this is the ``itemsep'' of the affiliations list
\newlength{\affiliationsSep}\setlength{\affiliationsSep}{-3pt}
%this hook is needed if the toc starts on the first page
\newcommand\beforetochook{\pagestyle{myplain}\pagenumbering{roman}}
\DeclareFixedFont\trfont{OT1}{phv}{b}{sc}{11}
%first page
\renewcommand\maketitle{
%% First page
\pagestyle{empty}
\thispagestyle{titlepage}
\newgeometry{marginparwidth=0pt,marginparsep=0pt,textwidth=.8\paperwidth,hoffset=0in,voffset=0in}
\setcounter{page}{0}
\noindent{\small\scshape\@fpheader}\@preprint\par
\afterLogoSpace
% Subheader
\if!\@subheader!\else\noindent{\trfont{\@subheader}}\fi
\afterSubheaderSpace
% Proceedings
\if!\@proceeding!\else\noindent{\sc\@proceeding}\fi
\afterProceedingsSpace
% Title
{\huge\centering\sffamily\bfseries\sc\@title\par}
\afterTitleSpace
% Rule
{\color{Maroon}\hrule height .6\p@}%
\afterRuleSpace
% Collaboration
\if!\@collaboration!\else
{\Large\bfseries\sffamily\raggedright\@collaboration}\par
\afterCollaborationSpace
\fi
%
\if!\@collaborationImg!\else
{\normalsize\bfseries\sffamily\raggedright\@collaborationImg}\par
\afterCollaborationImgSpace
%% I leave the size and font so that if there are two collaboration
%% they can be linked with an 'and'
\fi
% Author
%{\bfseries\raggedright\sffamily\the\auth@toks\par}
{\bfseries\raggedright\sffamily\sc\the\auth@toks\par}
\afterAuthorSpace
% Affiliation
\ifaffil\begin{list}{}{%
\setlength{\leftmargin}{0.28cm}%
\setlength{\labelsep}{0pt}%
\setlength{\itemsep}{\affiliationsSep}%
\setlength{\topsep}{-\parskip}}
\itshape\small%
\the\affil@toks
\end{list}\fi
\afterAffiliationSpace
% E-mail
\ifemailadd %% if emailadd is true
\noindent\hspace{0.28cm}\begin{minipage}[l]{.9\textwidth}
\begin{flushleft}
%\textit{E-mail:} \the\email@toks
\the\email@toks
\end{flushleft}
\end{minipage}
\else %% if emailaddfalse do nothing
\PackageWarningNoLine{\jname}{E-mails are missing.\MessageBreak Plese use \protect\emailAdd\space macro to provide e-mails.}
\fi
\afterEmailSpace
%Erratum or addendum
\if!\@xtum!\else\noindent{\@xtum}\afterXtumSpace\fi
% Abstract
%\if!\@abstract!\else\noindent{\renewcommand\baselinestretch{.9}\textsc{Abstract:}}\ \@abstract\afterAbstractSpace\fi
\if!\@abstract!\else\noindent\@abstract\afterAbstractSpace\fi
% Keywords
\if!\@keywords!\else\noindent{\textsc{Keywords:}} \@keywords\afterKeywordsSpace\fi
% Arxivnumber
\if!\@arxivnumber!\else\noindent{\textsc{ArXiv ePrint:}} \href{http://arxiv.org/abs/\@arxivnumber}{\@arxivnumber}\afterArxivSpace\fi
% Dedication
\if!\@dedicated!\else\vbox{\small\it\raggedleft\@dedicated}\afterDedicatedSpace\fi
%
\ifnotoc\else
\iftoccontinuous\else\newpage\fi
\beforetochook\hrule
\tableofcontents
\afterTocSpace
\hrule
\afterTocRuleSpace
\fi
%\if!\@acknowledgments!\else\vfill\noindent{\renewcommand\baselinestretch{.9}\textsc{Acknowledgments:}}\ \@acknowledgments\afterAbstractSpace\fi
\setcounter{footnote}{0}
\restoregeometry
\pagestyle{myplain}\pagenumbering{arabic}
} % close the \renewcommand\maketitle{
% Page layout
\renewcommand{\baselinestretch}{1.0}\normalsize
\setlength\lineskip{1\p@}
\setlength\parindent{1.2\parindent}
\setlength\normallineskip{1\p@}
\setlength\parskip{0\p@ \@plus \p@}
\@lowpenalty 51
\@medpenalty 151
\@highpenalty 301
\widowpenalty 1000
\clubpenalty 1000
\setcounter{topnumber}{4}
\renewcommand\topfraction{1}
\setcounter{bottomnumber}{1}
\renewcommand\bottomfraction{.6}
\setcounter{totalnumber}{5}
\renewcommand\textfraction{0}
\renewcommand\floatpagefraction{1}
\addtolength\textheight{\topskip}
\marginparpush 6\p@
\topmargin .05\paperheight
\setlength\arraycolsep{2\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
% No dots in the table of contents
\renewcommand{\@dotsep}{10000}
% Footer and header of the body
% the command ``\pagestyle{myplain}'' must be inserted
% just after ``\begin{document}''
\newcommand\ps@myplain{
\pagenumbering{arabic}
\renewcommand\@oddfoot{\hfill-- \thepage\ --\hfill}
\renewcommand\@oddhead{}}
\let\ps@plain=\ps@myplain
% no header or footer in the title page
\newcommand\ps@titlepage{\renewcommand\@oddfoot{}\renewcommand\@oddhead{}}
%number equations after the sections
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\numberwithin{equation}{section}
%headings style
\renewcommand\section{\@startsection{section}{1}{\z@}%
{-3.5ex \@plus -1.3ex \@minus -.7ex}%
{2.3ex \@plus.4ex \@minus .4ex}%
{\normalfont\large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-2.3ex\@plus -1ex \@minus -.5ex}%
{1.2ex \@plus .3ex \@minus .3ex}%
{\normalfont\normalsize\bfseries}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-2.3ex\@plus -1ex \@minus -.5ex}%
{1ex \@plus .2ex \@minus .2ex}%
{\normalfont\normalsize\bfseries}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{1.75ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{1.75ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\RequirePackage{titlesec}
\titleformat{name=\section}[display]
{\normalfont}
{\footnotesize\textsc{Section \thesection}}
{0pt}
{\Large\bfseries}
[\vspace{-10pt}\color{Maroon}\rule{\textwidth}{.6pt}]
\titleformat{name=\section,numberless}[hang]
{\normalfont}
{}
{0pt}
{\Large\bfseries}
\titleformat{name=\subsection}[display]
{\normalfont}
{\footnotesize\textsc{Subsection \thesubsection}}
{0pt}
{\large\bfseries}
[\vspace{-5pt}\color{Maroon}\rule{\textwidth}{.6pt}]
\titleformat{\part}[hang]{{\thispagestyle{fancypart}}\Huge\bfseries}{\marginnote{
\begin{tcolorbox}[width=\marginparwidth,height=\marginparwidth/2,colback=black!50!white,colframe=black!50!white,center title,fonttitle=\bfseries\normalsize,title=BOOK,text fill]
\begin{center}
{\color{white}\thepart}
\end{center}
\end{tcolorbox}
}[-1.25in]}{0pt}{\Huge\bfseries\itshape}
%Caption of figure and table
\def\fnum@figure{\textbf{\figurename\nobreakspace\thefigure}}
\def\fnum@table{\textbf{\tablename\nobreakspace\thetable}}
%redefining \@makecaption, to have captions with \small font size
%taken from article.cls l.489--498
%the only differences are the ``\small '' commands added on two lines
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{\small #1. #2}%
\ifdim \wd\@tempboxa >\hsize
\small #1. #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
%apply some formatting on the biblio
%without redefining the whole env
\let\oldthebibliography=\thebibliography
\let\endoldthebibliography=\endthebibliography
\renewenvironment{thebibliography}[1]{%
\begin{oldthebibliography}{#1}%
\small%
\raggedright%
\setlength{\itemsep}{5pt plus 0.2ex minus 0.05ex}%
}%
{%
\end{oldthebibliography}%
}
% Reset Exercise counter at each part
% TODO fix bug which causes references to link incorrectly
% \makeatletter
% \@addtoreset{example}{part}
% \makeatother