-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpaper.cls
89 lines (82 loc) · 2.77 KB
/
paper.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
% Auth: Nicklas Vraa
% Docs: https://github.com/NicklasVraa/LiX
% ------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{paper}[2023/02/10 For academic research papers]
% Intercept class options.
\newcommand{\numColumns}{1}
\DeclareOption{twocolumn}{
\renewcommand{\numColumns}{2}
\PassOptionsToClass{\CurrentOption}{article}
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass{article}
% SETUP: -----------------------------------------------------------------------
\RequirePackage[algorithms, basics, code, figures, formatting, headings, lists, math, metadata, refs, size, tables]{lix}
% OVERRIDES: -------------------------------------------------------------------
\setlength\parindent{0pt}
\usecompacttoc
\bibfont{\footnotesize}
\authorfont{\normalsize}
\setcounter{secnumdepth}{3}% Levels of heading that will be numbered.
\titlespacing{\numberless}{0pt}{14pt}{4pt}
\titlespacing{\section}{0pt}{14pt}{4pt}
\titlespacing{\subsection}{0pt}{14pt}{4pt}
\titlespacing{\subsubsection}{0pt}{14pt}{4pt}
\titleformat*{\section}{\bfseries\scshape}
\titleformat*{\subsection}{\bfseries\scshape}
\titleformat*{\subsubsection}{\bfseries\scshape}
\titleformat*{\paragraph}{\bfseries\scshape}
\renewcommand*{\@seccntformat}[1]{% Add dot after number.
\csname the#1\endcsname.\hspace{0.5em}%
}
\ifnum\numColumns=1
\geometry{a4paper, top=28mm, left=34mm, right=34mm, bottom=36mm}
\setlength{\droptitle}{-3.8em}
\else\ifnum\numColumns=2
\geometry{a4paper, top=20mm, left=24mm, right=24mm, bottom=30mm}
\setlength{\columnsep}{5mm}
\setlength{\droptitle}{-2.8em}
\fi\fi
\fancyhfoffset[O]{0pt}
% HEADER AND FOOTER: -----------------------------------------------------------
\fancypagestyle{plain}{% First page.
\renewcommand{\headrulewidth}{0pt}%
\fancyhead{}%
\fancyfoot[C]{{\thepage} of \pageref{LastPage}}%
}
\fancypagestyle{fancy}{%
\renewcommand{\headrulewidth}{0pt}%
\fancyhead{}%
\fancyfoot[C]{{\thepage} of \pageref{LastPage}}%
}
\pagestyle{fancy}
% LAYOUT: ----------------------------------------------------------------------
\wrap{%
\@ifundefined{theTitle}{}{%
\@ifundefined{theSubtitle}{%
\oldtitle{\LARGE\textbf{\textsc{\theTitle}}}%
}{%
\oldtitle{\LARGE\textbf{\textsc{\theTitle}}\\[0.4ex]%
\large\scshape\theSubtitle}%
}
}
\@ifundefined{theAuthor}{%
\oldauthor{}%
}{%
\oldauthor{\theAuthor}%
}
\@ifundefined{theDate}{%
\olddate{}%
}{%
\olddate{\normalsize{\theDate}}%
}
\@ifundefined{theTitle}{}{%
\maketitle%
}
\@ifundefined{theAbstract}{}{%
\textbf{\textsc{Abstract:}} \theAbstract%
}
\addMetadata
}