-
Notifications
You must be signed in to change notification settings - Fork 0
/
myCompactDoc.cls
124 lines (90 loc) · 3.3 KB
/
myCompactDoc.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
% \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large, \LARGE, \huge, \Huge
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myCompactDoc}
% --------------------------------------------------------------
% Base class
% --------------------------------------------------------------
\LoadClass[10pt]{article}
% \LoadClass[11pt]{article}
% --------------------------------------------------------------
% Some Packages
% --------------------------------------------------------------
\RequirePackage{ifthen}
% --------------------------------------------------------------
% Style
% --------------------------------------------------------------
\RequirePackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
% \RequirePackage[top=1.5in, bottom=1.5in, left=1in, right=1in]{geometry}
% \RequirePackage[margin=0.5in]{geometry}
% --------------------------------------------------------------
% User Input
% --------------------------------------------------------------
% title & short title (Defaults to full title)
\renewcommand{\title}[2][]{
\def\@title{#2}
\def\@shorttitle{
\ifthenelse{\equal{#1}{}} {#2} {#1}
}
}
% subtitle (w/ default empty value)
\def\@subtitle{}
\def\subtitle#1{\def\@subtitle{#1}}
% author
\def\author#1{\def\@author{#1}}
% date
\def\date#1{\def\@date{#1}}
% --------------------------------------------------------------
% Header and Footer
% --------------------------------------------------------------
%specifying header stuff
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
%%% style
\pagestyle{fancy}
%%% header
\lhead{\ifthenelse{\value{page}=1} {} {\@author}}
\chead{\ifthenelse{\value{page}=1} {} {\textbf{\@shorttitle}}}
\rhead{\ifthenelse{\value{page}=1} {} {\@date}}
% \renewcommand{\headrulewidth}{\ifthenelse{\value{page}=1} {0pt} {0.8pt}}
\renewcommand{\headrulewidth}{0.8pt}
%%% footer
\lfoot{}
\cfoot{}
\rfoot{Page \textbf{\thepage} of \textbf{\pageref*{LastPage}}}
\renewcommand{\footrulewidth}{0.8pt}
% --------------------------------------------------------------
% Title
% --------------------------------------------------------------
\def\makeTitle{
\begin{center}
\textbf{\Large \@title}
\ifthenelse{\equal{\@subtitle}{}} {} {{\footnotesize \@subtitle}}
\vspace*{1.5em}
{\large \@author}
\vspace*{0.25em}
{\normalsize \@date}
\vspace*{2em}
\hrule
\end{center}
}
% --------------------------------------------------------------
% Hyperref
% --------------------------------------------------------------
\ifx\pdfoutput\undefined %LaTeX
\RequirePackage[ps2pdf,bookmarks=true]{hyperref}
\else %PDFLaTeX
\RequirePackage[pdftex,bookmarks=true]{hyperref}
\pdfadjustspacing=1
\fi
\hypersetup{ %
pdfauthor = {\@author},
pdftitle = {\@title},
pdfcreator = {LaTeX with hyperref package},
pdfproducer = {dvips + ps2pdf},
colorlinks = true,
citecolor = blue
}
% --------------------------------------------------------------
% End
% --------------------------------------------------------------
\endinput