-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhw.sty
96 lines (83 loc) · 1.92 KB
/
hw.sty
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
\ProvidesPackage{hw}
%% Loading packages
\RequirePackage[margin=2.5cm]{geometry}
\RequirePackage{fancyhdr}
\RequirePackage{amsmath}
\RequirePackage{lastpage}
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage{microtype}
\RequirePackage{tikz}
\usetikzlibrary{shadows}
\usepackage{xifthen}
%%Macros
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@} %% Convert to roman numerals
%%Variables
\newcommand{\classname}{Class name}
\newcommand{\studentname}{Student name}
\newcommand{\teachername}{Teacher name}
\newcommand{\chapternumber}{Chapter \rom{1}}
%% \newcommand{\chapternumber}{1}
%%Counters
\setcounter{secnumdepth}{0} %% No numbers on sections
\newcounter{problemCounter}
%%Environments
\newenvironment{problem}[1][]
{
\addtocounter{problemCounter}{1}
\ifthenelse{\isempty{#1}}
{}
{\setcounter{problemCounter}{#1}}
\section{Problem \theproblemCounter}
}
{}
%%Commands
\renewcommand{\maketitle}{
\thispagestyle{firstpage}
\vspace{5em}
\begin{center}
\begin{Huge}
Homework \\ \vspace{1em}
\textbf{\classname}
\end{Huge} \\ \vspace{1em}
\begin{Large}
\textbf{\studentname}
\end{Large}
\end{center}
}
\newcommand{\chapter}{
\begin{center}
\begin{Large}
\hrule
\vspace{0.5em}
\textbf{Chapter \chapternumber}
\vspace{0.5em}
\hrule
\end{Large}
\end{center}
}
%% Document settings
\linespread{1.5}
\setlength{\headheight}{15pt}
%%%% Header / footer
\fancypagestyle{firstpage}{ %% Only the footer for the first page
%%%%%% Header
\renewcommand{\headrulewidth}{0mm}
\lhead{}
\chead{}
\rhead{}
%%%%%% Footer
\lfoot{\today}
\cfoot{}
\rfoot{Page \thepage\ / \pageref{LastPage}}
}
\pagestyle{fancy}
%%%%%% Header
\lhead{\studentname}
\chead{\textbf{\classname}}
\rhead{\teachername}
%%%%%% Footer
\lfoot{\today}
\cfoot{}
\rfoot{Page \thepage\ / \pageref{LastPage}}
\renewcommand{\footrulewidth}{0.1mm}