-
Notifications
You must be signed in to change notification settings - Fork 0
/
nmd-article.cls
151 lines (129 loc) · 4.38 KB
/
nmd-article.cls
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
%%% Nathan M. Dunfield's personal LaTeX class %%%
%
% A document class which allows one to easily switch between the AMS,
% Geometry & Topology, and its own custom style (inspired by Hatcher's
% "Algebraic Topology"). In particular, a document that uses this
% style can easily be switched over to either "amsart" or "gtpart"
% with minimal modification. See "template.tex" a minimal useage
% example.
%
% Main options: custom (default), gt, ams
%
% Font options:
% * custom look: utopia (default), times, stix, lucida.
% * ams look: computer modern (default), utopia, times, stix, lucida.
% * gt look: times (default and only option).
%
% Font size options:
%
% * custom: 12pt (default), 11pt.
% * ams look: 9-12pt with 10pt the default.
% * gt look: 11pt (default and only option).
%
% Additional options in the custom look:
%
% * fullpage: PDF is full US letter sized.
% * fatpage: wider textwidth.
% * grant: suitable for NSF grants.
%
% Formating commands:
% \trimpages, \laptop, \printing
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{nmd/nmd-article}[2021/04/30]
\RequirePackage{etex}
\RequirePackage{nmd/nmd-common}
%%% Setup options
\newif\ifgt
\newif\ifams
\newif\ifcustom
\DeclareOption{gt}{\gttrue}
\DeclareOption{ams}{\amstrue}
\DeclareOption{custom}{\customtrue}
\PassDownOptionToPackage{xy}{nmd-graphics}
\PassDownOptionToPackage{tikz}{nmd-graphics}
\PassDownOptionToPackage{times}{nmd-fonts}
\PassDownOptionToPackage{stix}{nmd-fonts}
\PassDownOptionToPackage{utopia}{nmd-fonts}
\PassDownOptionToPackage{lucida}{nmd-fonts}
\PassDownOptionToPackage{eulercal}{nmd-fonts}
\PassDownOptionToPackage{computermodern}{nmd-fonts}
\PassDownOptionToPackage{sepfignums}{nmd-thm}
\PassDownOptionToPackage{sepfigandtablenums}{nmd-thm}
\PassDownOptionToPackage{defaultenums}{nmd-thm}
\PassDownOptionToClass{noaddress}{nmd-custom}
\PassDownOptionToClass{grant}{nmd-custom}
\PassDownOptionToClass{fullpage}{nmd-custom}
\PassDownOptionToClass{fatpage}{nmd-custom}
\PassDownOptionToClass{nogeometry}{nmd-custom}
\PassDownOptionToClass{smalltitle}{nmd-custom}
\PassDownOptionToClass{lineno}{nmd-custom}
% The GT style has a fixed size font, but the AMS and custom ones
% doesn't.
\PassDownOptionToClass{9pt}{amsart}
\PassDownOptionToClass{10pt}{amsart}
\DeclareOption{11pt}{\PassOptionsToClass{11pt}{amsart}%
\PassOptionsToClass{11pt}{nmd-custom}}
\DeclareOption{11.25pt}{\PassOptionsToClass{11.25pt}{nmd-custom}}
\DeclareOption{11.5pt}{\PassOptionsToClass{11.5pt}{nmd-custom}}
\DeclareOption{11.75pt}{\PassOptionsToClass{11.75pt}{nmd-custom}}
\DeclareOption{12pt}{\PassOptionsToClass{12pt}{amsart}%
\PassOptionsToClass{12pt}{nmd-custom}}
\ProcessOptions
%%% Make the custom style the default
\customtrue
\ifams \customfalse \fi
\ifgt \customfalse \fi
%%% Load underlying Latex class
%% G&T Style
\ifgt
\LoadClass[microtype]{gtpart}
%% Improve fit on US letter
\addtolength{\topmargin}{-1.3cm}
\addtolength{\oddsidemargin}{0.35cm}
% The style actually has no footers
\setlength{\footskip}{0pt}
\RequirePackage{tocloft}
\setlength{\cftbeforesecskip}{0.05cm}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
% \dedicatory{{\scriptsize \versioninfo}}
\renewcommand{\subjclass}[2][2010]{}
% gtpart hardwires the max width of a biblabel, so we rewire it manually.
\def\thebibliography#1 {\@thebibliography@{999999}\small\parskip0pt
plus2pt\relax\addcontentsline{toc}{section}{Bibliography}}
\fi
%% AMS Style
\ifams
\LoadClass{amsart}
\RequirePackage[colorlinks=true, linkcolor=blue, citecolor=blue,
urlcolor=blue]{hyperref}
\fi
%% Custom Style
\ifcustom
\LoadClassWithOptions{nmd/nmd-custom}
\fi
%%% Set font %%%
\RequirePackage{nmd/nmd-fonts}
% Dummy commands for things used by GT style
\providecommand{\givenname}[1]{}
\providecommand{\surname}[1]{}
\providecommand{\arxivreference}[1]{}
\providecommand{\arxivpassword}[1]{}
\providecommand{\subject}[3]{}
\providecommand{\keyword}[1]{}
%%% Change float params to make things more flexible
\nmd@freefloats
%%% For the bibilography
\RequirePackage{ragged2e}
%%% For the MathReview links
\def\MR#1{\href{http://www.ams.org/mathscinet-getitem?mr=#1}{MR#1}}
\def\checkMR MR#1#2#3 #4\relax%
{\ifx#1M%
\ifx#2R\MR{#3}\else\MR{#1#2#3}\fi
\else
\MR{#1#2#3}%
\fi}
\def\mathreviewsnumber#1{\checkMR MR#1 \relax}
\RequirePackage{nmd/nmd-graphics}
\RequirePackage{nmd/nmd-thm}
\RequirePackage{nmd/nmd-math}
% End of nmd article class