-
Notifications
You must be signed in to change notification settings - Fork 4
/
anstrans.cls
183 lines (151 loc) · 5.1 KB
/
anstrans.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
% American Nuclear Society Transaction template
% by Seth R. Johnson, based on the ANS transaction guidelines
%
% This class lives at the git repository https://github.com/sethrj/anstrans
%
% See also http://reference-man.com/projects.html#anstemplate
%
% Usage: \documentclass{anstrans}
% Define \title and \author as usual, and also define \institute and \email .
% For two-column tables, use the table* environment. Multiple authors should
% look like
% {Seth R. Johnson \and Edward W. Larsen}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{anstrans}[2018/01/01 ANS Transaction class]
%%%%%%%%%%% TYPE AND GEOMETRY %%%%%%%%%%%
\LoadClass[twocolumn,10pt]{article}
\pagestyle{empty} %no page numbering
\RequirePackage[text={7in,9in},centering,columnsep=18pt]{geometry}
\RequirePackage{fancyhdr}
% ams math must be loaded before txfonts
\usepackage{amsmath}
% Use Times for math font and text font.
\RequirePackage[T1]{fontenc}
\RequirePackage{txfonts}
% bold math must be loaded after Times font
\usepackage{bm}
%%%%%%%%%%% TITLE PAGE FORMAT %%%%%%%%%%%
\fancypagestyle{firstpage}{
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.5pt}
\rhead{}
\cfoot{}
\lfoot{\footnotesize \@disclaimer}
}
%%%%%%%%%%% INCLUDE PACKAGES %%%%%%%%%%%
\RequirePackage{cuted} % defines 'strip' environment for single column
\RequirePackage{indentfirst} % indent the leading paragraph
%%%%%%%%%%% REQUIRED VARIABLES %%%%%%%%%%%
\newif\if@institutedefined
\@institutedefinedfalse
\def\@institute{\PackageWarning{anstrans}{No institute has been defined.}}
\newcommand{\institute}[1]{\def\@institute{#1}\@institutedefinedtrue}
\newif\if@emaildefined
\@emaildefinedfalse
\def\@email{\PackageWarning{anstrans}{No email address has been defined.}}
\newcommand{\email}[1]{\def\@email{#1}\@emaildefinedtrue}
\newif\if@disclaimerdefined
\@disclaimerdefinedfalse
\def\@disclaimer{}
\newcommand{\disclaimer}[1]{\def\@disclaimer{#1}\@disclaimerdefinedtrue}
%%%%%%%%%%% PARAGRAPH FORMATTING %%%%%%%%%%%
\setlength{\parindent}{0.25in}
%% For more aesthetically pleasing but looser spacing (more pages),
%% comment these lines:
\AtBeginDocument{\setlength{\baselineskip}{11pt}}
\setlength{\lineskip}{0pt plus 2pt minus 2pt}
\setlength{\parskip}{0pt}
%%%%%%%%%%% SECTIONING %%%%%%%%%%%
\setcounter{secnumdepth}{-2} %hide all section heading numbers
\renewcommand\section{\@startsection
{section}{1}{0pt}% %name, level, indent
{-\baselineskip}% %beforeskip
{.75\baselineskip}% %afterskip
{\reset@font\bf\MakeUppercase}%
}
\renewcommand\subsection{\@startsection
{subsection}{1}{0pt}% %name, level, indent
{-\baselineskip}% %beforeskip
{.75\baselineskip}% %afterskip
{\reset@font\bf}%
}
\renewcommand\subsubsection{\@startsection
{subsubsection}{1}{-\parindent}% %name, level, indent
{-.75\baselineskip}% %beforeskip
{.5\baselineskip}% %afterskip
{\reset@font\emph}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% APPENDIX %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% appendix needs equations labeled A.1 etc., but shouldn't look like
% A MY FIRST APPENDIX
\let\@oldappendix\appendix
\renewcommand\appendix{%
\setcounter{secnumdepth}{-1}%keep section headings
\renewcommand\theequation{\thesection.\arabic{equation}}
\@oldappendix
\renewcommand\section{%
\addtocounter{section}{1}%
\setcounter{equation}{0}%reset equation counter
\@startsection%
{section}{1}{0pt}% %name, level, indent
{-\baselineskip}% %beforeskip
{.75\baselineskip}% %afterskip
{\reset@font\bf\MakeUppercase}%
}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BIBLIOGRAPHY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\@biblabel[1]{#1.} %change from [x] to x.
%% reduce spacing in bibliography; thanks to Jose Carlos Santos.
\let\@oldthebibliography=\thebibliography
\let\@endoldthebibliography=\endthebibliography
\let\@olditemsep=\itemsep
\renewenvironment{thebibliography}[1]{%
\begin{@oldthebibliography}{#1}%
\setlength{\itemsep}{-\@olditemsep}%
}%
{%
\@endoldthebibliography%
\end{@oldthebibliography}%
}
%%%%%%%%%%% CHANGE TABLE/FIGURE STYLE %%%%%%%%%%%
\renewcommand{\figurename}{Fig.}
\renewcommand{\tablename}{TABLE}
\setlength{\abovecaptionskip}{0.25\baselineskip}
\setlength{\belowcaptionskip}{0.25\baselineskip}
\setlength{\textfloatsep}{0.5\baselineskip}
\setlength{\intextsep}{0.5\baselineskip}
\renewcommand{\bottomfraction}{0.9}
\renewcommand{\topfraction}{0.9}
% captions should be flush with the left and use a stop instead of a colon
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
{#1. #2\par}
\vskip\belowcaptionskip}
% tables use roman numerals
\renewcommand\thetable{\@Roman\c@table}
%%%% Title section
\setlength{\stripsep}{0pt}
\renewcommand{\maketitle}{%
\begin{strip}%
\centering%
%title
{\bf \@title}
\vspace{.75\baselineskip}%
%author
{\def\and{\!, } \@author}%
\vspace{.75\baselineskip}%
%institute (optional?)
\if@institutedefined%
{\let\and\par \itshape \@institute}%
\fi%
%email
\if@emaildefined%
{\def\and{\!, } \itshape \@email}%
\fi%
\vspace{\baselineskip}%
\end{strip}%
%disclaimer
\if@disclaimerdefined%
\thispagestyle{firstpage}
\fi
}