-
Notifications
You must be signed in to change notification settings - Fork 1
/
rcclab.cls
204 lines (176 loc) · 5.75 KB
/
rcclab.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
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
%% Class rcclab
%% Adapted from the nature class https://www.ctan.org/tex-archive/macros/latex/contrib/nature/
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{rcclab}[2024-6-17 v1.2]
\typeout{A class for writing RCCLab manuscripts}
\typeout{Written by Ryan Chiechi}
\typeout{ }
\LoadClass[12pt]{article}
\RequirePackage{setspace}
\RequirePackage{fullpage} % Non-stupid layout
\RequirePackage{graphicx} % Figures
\RequirePackage{float} % So we can force figures to appear in the rigth place
\RequirePackage[version=4]{mhchem} % Formula subscripts using \ce{}
\RequirePackage{xcolor} % For colored text
\RequirePackage{siunitx} % Enables \SI{} for units
\RequirePackage[utf8]{inputenc} % Needed to render UTF8 characters
\RequirePackage{subfig} % For sub figures because some people like them for some reason
\RequirePackage{xr} % For cross-referencing figures
\RequirePackage{hyperref} % Hyperlinks
\RequirePackage{ifthen}
\RequirePackage{kvoptions}
\RequirePackage{booktabs}
\RequirePackage[capitalize]{cleveref}
\SetupKeyvalOptions{%
family=rcclab,
prefix=rcclab@,
% setkeys=\kvsetkeys,
}
\DeclareStringOption[chem-acs]{bibstyle}[chem-acs]
\DeclareStringOption[false]{articletitle}[false]
\DeclareStringOption[false]{articledoi}[false]
\DeclareStringOption[false]{articleurl}[false]
\DeclareStringOption[100]{maxauthors}[100]
\DeclareBoolOption[false]{suppinfo}
\DeclareBoolOption[false]{numberedsubsections}
\DeclareBoolOption[false]{stixfont}
\ProcessKeyvalOptions{rcclab}
\ifrcclab@stixfont
\RequirePackage{stix2} % Super nice science font
\fi
\PassOptionsToPackage{style=\rcclab@bibstyle,
articletitle=\rcclab@articletitle,
doi=\rcclab@articledoi,
url=\rcclab@articleurl,
maxbibnames=\rcclab@maxauthors}{biblatex}
\RequirePackage{biblatex} % For BibLaTeX referencing
%% Some style parameters
\captionsetup{justification=justified,%
font={md,singlespacing},%
labelfont=bf%
}
\setlength{\parindent}{0.39in}
\setlength{\parskip}{18pt}
\renewcommand{\spacing}[1]{\renewcommand{\baselinestretch}{#1}\large\normalsize}
\spacing{2}
\ifrcclab@suppinfo
\def\thepage{S-\arabic{page}}
\renewcommand*\thefigure{S\@arabic\c@figure}
\renewcommand*\thetable{S\@arabic\c@table}
\renewcommand*\thesection{S\@arabic\c@section}
\renewcommand{\theequation}{S\arabic{equation}}
\newcommand{\@siprefix}{Supporting Information for: }
\else
\newcommand{\@siprefix}{}
\fi
%% Redefine \maketitle for RCCLab style
\def\@maketitle{%
\newpage\spacing{1}\setlength{\parskip}{12pt}%
{\Large\bfseries\noindent\sloppy \@siprefix \textsf{\@title} \par}%
{\noindent\sloppy \@author}%
}
%% Define the affiliations environment, list each institution as an \item
%% Put after \maketitle
\newenvironment{affiliations}{%
\renewcommand{\baselinestretch}{1}
\setcounter{enumi}{1}%
\setlength{\parindent}{0in}%
%\slshape\sloppy
\normalfont\sloppy
\begin{list}{\upshape$^{\arabic{enumi}}$}{%
\usecounter{enumi}%
\setlength{\leftmargin}{0in}%
\setlength{\topsep}{0in}%
\setlength{\labelsep}{0in}%
\setlength{\labelwidth}{0in}%
\setlength{\listparindent}{0in}%
\setlength{\itemsep}{0ex}%
\setlength{\parsep}{0in}%
}
}{\end{list}\par\vspace{12pt}}
%% Itemize list for outlining
\newenvironment{outline}{%
\renewcommand{\baselinestretch}{1}
\setlength{\parindent}{0in}%
\normalfont%
\begin{itemize}{}{}%
}{\end{itemize}}
% Redefine the abstract environment to be the first centered paragraph
\renewenvironment{abstract}{%
\renewcommand{\baselinestretch}{1}%
\textbf{Abstract}%
\setlength{\parindent}{0in}%
\setlength{\parskip}{0in}%
\centering%
}{\par\vspace{-6pt}}
\ifrcclab@suppinfo
\else
%% Redefine the \section command.
\renewcommand{\section}{\@startsection {section}{1}{0pt}%
{-6pt}{1pt}%
{\bfseries}%
}
\ifrcclab@numberedsubsections
\renewcommand{\subsection}{\@startsection {subsection}{2}{0pt}%
{-0pt}{-0.5em}%
{\bfseries}%
}
\else
\renewcommand{\subsection}{\@startsection {subsection}{2}{0pt}%
{-0pt}{-0.5em}%
{\bfseries}*%
}
\fi
\fi
%% Define the methods environment. Use \subsection to separate.
\newenvironment{methods}{%
\section*{Methods}%
\setlength{\parskip}{12pt}%
}{}
%% Define the experimental environment. Use \subsection to separate.
\newenvironment{experimental}{%
\section*{Experimental}%
\setlength{\parskip}{12pt}%
}{}
% Setup SI units pacakge for \SI, \si and \SIrange commands
\sisetup{mode = match}
\sisetup{propagate-math-font = true}
\sisetup{uncertainty-mode = separate}
\sisetup{range-units = single}
%% Provide some common macros
\DeclareCiteCommand{\citenum}
{}
{\printfield{labelnumber}}
{}
{}
%% Dispersity symbol (\Dbar)
\ProvideTextCommand{\Dbar}{OT1}{\raisebox{0.25ex}{-}\kern-0.4em D}
\newcommand{\red}[1]{\textcolor{red}{#1}}%
\newcommand{\blue}[1]{\textcolor{blue}{#1}}%
\newcommand{\green}[1]{\textcolor{green}{#1}}%
\newcommand*{\ie}{\textit{i.e.}, }%
\newcommand*{\eg}{\textit{e.g.}, }%
\newcommand*{\et}{\textit{et al}.}%
\newcommand*{\ts}[1]{$\mathrm{#1}^{\mathrm{TS}}$}%
\newcommand*{\mica}[1]{$\mathrm{#1}^{\mathrm{Mica}}$}%
\newcommand*{\afm}[1]{$\mathrm{#1}^{\mathrm{AFM}}$}%
\newcommand*{\cp}[1]{$\mathrm{#1}^{\mathrm{AFM}}$}%
\newcommand*{\Mn}{$M_\mathrm{n}$}
\newcommand*{\Mw}{$M_\mathrm{w}$}
\newcommand*{\fermi}{E_\mathrm{F}} % Use inside math
\newcommand*{\egap}{E_\mathrm{g}} % Use inside math
\newcommand*{\Junits}{\si{Acm^{-2}}}%
\newcommand*{\logJ}{$\log|J|$}%
\newcommand*{\logI}{$\log|I|$}%
\newcommand*{\vtrans}{$V_{\mathrm{trans}}$}%
\newcommand*{\vtransp}[1]{$V_{\mathrm{trans}}^{(#1)}$}%
\newcommand*{\vtransmm}[1]{V_{\mathrm{trans}(#1)}}%
\newcommand*{\degC}[1]{\SI{#1}{\celsius}}%
% Chemistry Units
\DeclareSIPrefix{\micro}{\text{\textmu}}{-6}
\DeclareSIUnit\molar{\mole\per\cubic\deci\metre}
\DeclareSIUnit\Molar{\textsc{M}}
\DeclareSIUnit\torr{torr}
\DeclareSIUnit\calorie{cal}
\DeclareSIUnit\debye{D}
\DeclareSIUnit\angstrom{\protect \text {Å}}