-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathib-assignment.cls
More file actions
125 lines (104 loc) · 2.13 KB
/
Copy pathib-assignment.cls
File metadata and controls
125 lines (104 loc) · 2.13 KB
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
\ProvidesClass{ib-assignment}
\LoadClass[11pt]{article}
% fields that user can set (in addition to title, author, etc)
\makeatletter
\newcommand{\candidatenum}[1]{\def \@candidatenum {#1}}
\newcommand{\subtitle}[1]{\def \@subtitle {#1}}
\newcommand{\subject}[1]{\def \@subject {#1}}
\newcommand{\wordcount}[1]{\def \@wordcount {#1}}
\newcommand{\email}[1]{\def \@email {#1}}
\candidatenum{}
\subtitle{}
\subject{}
\wordcount{}
\email{}
\makeatother
% margins
\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
% fonts
\usepackage{newcent}
\usepackage{fouriernc}
\renewcommand{\ttdefault}{cmtt}
% alignment
% (must be before indentation because raggedright clears parindent)
\raggedright
% indentation
\usepackage{indentfirst}
\setlength{\parindent}{18pt}
\setlength{\parskip}{3pt}
% spacing
\usepackage{setspace}
% references
\usepackage{varioref}
% figures
\usepackage[pdftex]{graphicx}
% bibliography
\usepackage{natbib}
% page headings and numbering
\makeatletter
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\footrulewidth}{\headrulewidth}
\fancyhf{}
\newcommand{\updateheaders}{
\ifx \@candidatenum \@empty
\relax
\else
\fancyfoot[R]{Candidate \#\@candidatenum}
\fi
\ifx \@author \@empty
\relax
\else
\fancyfoot[L]{\@author}
\fi
\ifx \@subtitle \@empty
\fancyhead[L]{\@title}
\else
\fancyhead[L]{\@title: \@subtitle}
\fi
}
\fancyhead[R]{\thepage}
\makeatother
% title
\makeatletter
\def \maketitle {%
\pdfinfo{/Title (\@title) /Author (\@author)}
\begin{titlepage}
~\vfill
\begin{center}
{\Large \@title} \\
\ifx \@subtitle \@empty
\relax
\else
\vspace{0.5em}
{\large \@subtitle} \\
\fi
\vspace{0.5in}
\ifx @author \@empty
\relax
\else
\@author \\
\ifx\@email\@empty
\relax
\else
\texttt{\@email} \\
\fi
\ifx \@candidatenum \@empty
\relax
\else
Candidate \#\@candidatenum \\
\fi
\vspace{0.5in}
\fi
\ifx \@wordcount \@empty
\relax
\else
Word Count: \@wordcount \\
\vspace{0.5in}
\fi
\@date
\end{center}
\vfill
\end{titlepage}
}
\makeatother