-
Notifications
You must be signed in to change notification settings - Fork 4
/
jmwhw.cls
115 lines (83 loc) · 3.25 KB
/
jmwhw.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
%=====================================================================
% jmwhw.cls
% Provide jmwhw.cls class
%=====================================================================
%=====================================================================
% Identification
%=====================================================================
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{jmwhw}
\LoadClass[letterpaper, 12pt]{report}
%\RequirePackage{jhwmath} Personal style file I use.
\RequirePackage{fancyhdr}
\RequirePackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
\RequirePackage{graphicx}
\RequirePackage{empheq}
\RequirePackage{ifthen}
%\RequirePackage{jhwgraphics} Another personal style file I use.
%=====================================================================
% Commands
%=====================================================================
\setlength{\headheight}{15pt}
\lhead{\@author}\chead{\@title}\rhead{\today}
\lfoot{}\cfoot{\thepage}\rfoot{}
\pagestyle{fancy}
\ifx\pdfoutput\undefined %LaTeX
\RequirePackage[ps2pdf,bookmarks=true]{hyperref}
\hypersetup{ %
pdfauthor = {\@author},
pdftitle = {\@title},
pdfcreator = {LaTeX with hyperref package},
pdfproducer = {dvips + ps2pdf}
}
\else %PDFLaTeX
\RequirePackage[pdftex,bookmarks=true]{hyperref}
\hypersetup{ %
pdfauthor = {\@author},
pdftitle = {\@title},
pdfcreator = {LaTeX with hyperref package},
pdfproducer = {dvips + ps2pdf}
}
\pdfadjustspacing=1
\fi
% Set up counters for problems and subsections
\newcounter{ProblemNum}
\newcounter{SubProblemNum}[ProblemNum]
\renewcommand{\theProblemNum}{\arabic{ProblemNum}}
\renewcommand{\theSubProblemNum}{\alph{SubProblemNum}}
\newcommand*{\soln}[1]{\subsubsection*{#1}}
\newcommand*{\solution}{\soln{Solution}}
\renewcommand*{\part}{\stepcounter{SubProblemNum} %
\soln{Part (\theSubProblemNum)}}
\renewcommand{\theenumi}{(\alph{enumi})}
\renewcommand{\labelenumi}{\theenumi}
\renewcommand{\theenumii}{\roman{enumii}}
\newcommand*{\anyproblem}[1]{\newpage\section*{#1} \addcontentsline{toc}{chapter}{#1}}
\newcommand*{\problem}[1]{\stepcounter{ProblemNum} %
\anyproblem{Problem \theProblemNum. #1}}
\newcommand*{\subproblem}{
\stepcounter{SubProblemNum}
\newpage
\subsection*{Problem \theProblemNum (\theSubProblemNum)}
\addcontentsline{toc}{section}{Part (\theSubProblemNum)}
}
\makeatletter
\newcommand*{\toccontents}{\@starttoc{toc}}
\makeatother
%\newcommand*{\subproblem}[0]{\stepcounter{SubProblemNum} %
%\subsection*{Part \SubProblemNum}
%\addcontentsline{toc}{section}{Part \SubProblemNum}
%}
% \def\problemmark{}
% % Typesetting problems
% % \newcommand*{\prob}[1]{\newpage \noindent \textbf{\Large #1}}
% % \newcommand*{\problem}[1]{\stepcounter{ProblemNum} \prob{Problem %
% % \theProblemNum.}}
% % \newcommand*{\soln}[1]{\\ \noindent \textbf{\Large #1}}
% % \newcommand*{\solution}{\soln{Solution}}
% % \renewcommand*{\part}{\\ \noindent \stepcounter{SubProblemNum} %
% % \textbf{\Large Part (\theSubProblemNum)}}
% \newcommand\problem{\@startsection{problem}{1}{\z@}%
% {-3.25ex \@plus -1ex \@minus -.2ex}%
% {1.5ex \@plus .2ex}%
% {\normalfont\large\bfseries}}