├── awlc-listings.sty
├── awlc-statistics.sty
├── README.md
├── awlc-algebra.sty
├── drangsymbols.sty
└── drangreport.sty
/awlc-listings.sty:
--------------------------------------------------------------------------------
1 | \NeedsTeXFormat{LaTeX2e}[1996/06/01]
2 | \ProvidesPackage{awlc-listings}[2013/04/16 alexwlchan]
3 | \typeout{Package: `awlc-statistics'}
4 |
5 | % First we call the listings package, which is the whole point of this package
6 | \usepackage{listings}
7 |
8 | \definecolor{string}{rgb}{1,0,0}
9 | \definecolor{comment}{rgb}{0,1,0}
10 | \definecolor{keyword}{rgb}{0,1,1}
11 |
12 | % Common to all languages
13 | \lstset{
14 | basicstyle = \ttfamily,
15 | numbers = left,
16 | numberstyle = \ttfamily\small\color{gray},
17 | stepnumber = 2,
18 | numbersep = 10pt,
19 | showspaces = false,
20 | showstringspaces = false,
21 | showtabs = false,
22 | frame = single,
23 | tabsize = 2,
24 | captionpos = t,
25 | breaklines = true,
26 | breakatwhitespace = false,
27 | title = \lstname,
28 | keywordstyle = \color{keyword},
29 | commentstyle = \color{comment},
30 | stringstyle = \color{string},
31 | }
32 |
33 | \DeclareOption{R}{
34 | \lstset{
35 | language = R,
36 | }
37 | }{}
38 |
39 | \DeclareOption{Python}{
40 | \lstset{
41 | language = Python,
42 | }
43 | }{}
44 |
45 | \DeclareOption{Mathematica}{
46 | \lstset{
47 | language = Mathematica,
48 | numbers = none,
49 | }
50 | }{}
51 |
52 | \ProcessOptions
--------------------------------------------------------------------------------
/awlc-statistics.sty:
--------------------------------------------------------------------------------
1 | \NeedsTeXFormat{LaTeX2e}[1996/06/01]
2 | \ProvidesPackage{awlc-statistics}[2013/01/29 alexwlchan]
3 | \typeout{Package: `awlc-statistics'}
4 |
5 | % First we call the glossaries package, which lets us define acronyms
6 | \RequirePackage[section, numberedsection=autolabel]{glossaries}
7 |
8 | % Statistical related acronyms
9 | \newacronym{rv}{rv}{random variable}
10 | \newacronym{iid}{iid}{independent identically distributed}
11 | \newacronym{pdf}{pdf}{probability density function}
12 | \newacronym{pmf}{pmf}{probability mass function}
13 | \newacronym{cdf}{cdf}{cumulative density function}
14 | \newacronym{MLE}{MLE}{maximum likelihood estimator}
15 | \newacronym{wlln}{WLLN}{Weak Law of Large Numbers}
16 | \newacronym{slln}{SLLN}{Strong Law of Large Numbers}
17 | \newacronym{mgf}{mgf}{moment generating function}
18 | \newacronym{mse}{mse}{mean squared error}
19 | \newacronym{CI}{CI}{confidence interval}
20 | \newacronym{LR test}{LR test}{likelihood ratio test}
21 | \newacronym{NP}{NP}{Neyman-Pearson}
22 | \newacronym{LR}{LR}{likelihood ratio}
23 | \newacronym{UMP}{UMP}{universally most powerful}
24 | \newacronym{MP}{MP}{most powerful}
25 | \newacronym{BLUE}{BLUE}{best linear unbiased estimator}
26 | \newacronym{ANOVA}{ANOVA}{analysis of variance}
27 |
28 | \DeclareMathOperator{\mse}{mse}
29 | \DeclareMathOperator{\bias}{bias}
30 | \DeclareMathOperator{\serror}{s.e.}
31 |
32 | % List of common distributions
33 | \DeclareMathOperator*{\Poisson}{Poisson}
34 | \DeclareMathOperator*{\Bin}{Bin}
35 | \DeclareMathOperator*{\Gammadist}{Gamma}
36 | \DeclareMathOperator*{\Gammafn}{\Gamma}
37 | \DeclareMathOperator*{\Betadist}{Beta}
38 | \DeclareMathOperator*{\Betafn}{\Beta}
39 | \DeclareMathOperator*{\Exponential}{Exponential}
40 | \DeclareMathOperator*{\Bernouilli}{Bernouilli}
41 | \DeclareMathOperator*{\InvGamma}{Inv-Gamma}
42 | \DeclareMathOperator*{\Multinomial}{Multinomial}
43 |
44 | \newcommand{\Normal}{N}
45 | \newcommand{\Unif}{U}
46 | \newcommand{\tdist}{t}
47 | \newcommand{\Fdist}{F}
48 |
49 | % \DeclareMathOperator*{\Normal}{N}
50 | % \DeclareMathOperator*{\Unif}{U}
51 | % \DeclareMathOperator*{\tdist}{t}
52 | % \DeclareMathOperator*{\Fdist}{F}
53 |
54 |
55 |
56 | % Expectation, probability and variance
57 | \DeclareMathOperator{\E}{\bb{E}}
58 | % \newcommand{\E}{\textstyle\expectation}
59 |
60 | \let\P\relax
61 | \DeclareMathOperator{\P}{\bb{P}}
62 | % \newcommand{\P}{\textstyle\probability}
63 |
64 | \DeclareMathOperator{\Var}{\bb{V}ar}
65 | % \newcommand{\Var}{\textstyle\variation}
66 |
67 | \DeclareMathOperator{\Cov}{\bb{C}ov}
68 | % \newcommand{\Cov}{\textstyle\covariance}
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | These versions of the `drangreport.sty` and `drangsymbols.sty` are modified versions of the LaTeX style files originally written by Dr. Drang and posted at [http://www.https://github.com/drdrang/drangreport/](github.com/drdrang/drangreport/).
2 |
3 | These files are mostly used for typing lectures notes in an undergraduate mathematics course. Thus, the symbols and shortcuts are chosen primarily to allow me to write as fast as I can during lectures.
4 |
5 | I compile the files with xelatex. They should work unchanged with pdflatex, but I haven't tried it so I can't be sure.
6 |
7 | Alongside the `drangreport` and `drangsymbols` files, I provide several style files that contain subject-specific shortcuts. Currently:
8 |
9 | * `awlc-algebra` -- topics in algebra, such as groups, linear maps, and so on. Contains shortcuts for specific groups and subgroups (e.g., orbits, stabilisers, general linear group GL) and some linear operators.
10 | * `awlc-listings` -- loads the `listings` package and the particular styles that I like.
11 | * `awlc-statistics` -- topics in statistics, such as probability, Markov chains and optimisation. Include shortcuts for probability, expectation and variance. Acronyms (using the `glossaries` package) for statistical terms like random variable (rv) and maximum likelihood estimator (mle).
12 |
13 | Large sections of the original code are unchanged; these are mostly superficial edits.
14 |
15 |
16 |
17 | Dr. Drang's original README:
18 |
19 | The `drangreport.sty` file is a redacted version of the LaTeX style file for reports I discussed in these two blog posts ([first][1] and [second][2]). It includes provisions for:
20 |
21 | * Plates, as distinct from figures.
22 | * A title page.
23 | * A digitized signature.
24 | * A variety of font combinations.
25 | * The sort of paragraph spacing, margins, and heading styles I prefer.
26 |
27 | Most of the font combinations use the Mathematica fonts. You'll need both [these virtual font files][3] and the [version 4.1 PostScript files][4]. To get the fonts on a non-Windows machine, use the link at the bottom of the page to download the .exe file and unzip "by hand."
28 |
29 | unzip MathFonts_Type1_42.exe
30 |
31 | You'll need to know a fair amount about how a TeX system uses fonts to install these correctly and get your system to know they're there.
32 |
33 | The `drangsymbols.sty` file is a set of convenient commands for units and small fractions.
34 |
35 |
36 | [1]: http://www.leancrew.com/all-this/2011/04/text-files-and-me-part-3/
37 | [2]: http://www.leancrew.com/all-this/2011/04/text-files-and-me-part-3-5/
38 | [3]: http://library.wolfram.com/infocenter/MathSource/3200/
39 | [4]: http://support.wolfram.com/technotes/fonts/windows/latestfonts.html
40 |
41 |
--------------------------------------------------------------------------------
/awlc-algebra.sty:
--------------------------------------------------------------------------------
1 | \NeedsTeXFormat{LaTeX2e}[1996/06/01]
2 | \ProvidesPackage{awlc-algebra}[2013/02/03 alexwlchan]
3 | \typeout{Package: `awlc-algebra'}
4 |
5 | % Various operators and functions
6 |
7 | \DeclareMathOperator{\Tr}{tr} % trace
8 | \newcommand{\trace}{\Tr}
9 | \newcommand{\Trace}{\Tr}
10 |
11 | \DeclareMathOperator{\diag}{diag}
12 |
13 | \DeclareMathOperator*{\rank}{rank}
14 | \DeclareMathOperator*{\sgn}{sgn} % signature
15 | \DeclareMathOperator*{\hcf}{hcf}
16 | \DeclareMathOperator*{\lcm}{lcm}
17 | \DeclareMathOperator*{\adj}{adj} % adjoint
18 | \newcommand{\Trans}{T} % transpose
19 | \DeclareMathOperator{\Res}{Res} % Residue?
20 | \DeclareMathOperator*{\rk}{rk} % rank
21 | \DeclareMathOperator*{\Billio}{Bil}
22 | \newcommand{\Bil}{\textstyle\Billio} % bilinear forms
23 | \DeclareMathOperator*{\Char}{char} % characteristic
24 | \DeclareMathOperator*{\sign}{sign} % sign
25 |
26 | % Names of different groups
27 | \DeclareMathOperator{\Sym}{Sym} % symmetric group
28 | \DeclareMathOperator{\GL}{GL} % general linear
29 | \DeclareMathOperator{\SL}{SL} % special linear
30 | \DeclareMathOperator{\SO}{SO} % special orthogonal
31 | \DeclareMathOperator{\Mat}{Mat}
32 | \DeclareMathOperator{\End}{End} % endomorphisms
33 | \DeclareMathOperator{\Isom}{Isom} % Isometries
34 | \DeclareMathOperator{\Lin}{\cal{L}} % Linear maps
35 | \DeclareMathOperator{\Gr}{Gr} % Graussmanian
36 | \DeclareMathOperator{\PSL}{PSL} % Projective special linear group
37 | \DeclareMathOperator{\PGL}{PGL} % Projective general linear group
38 |
39 | % Group operators
40 | \DeclareMathOperator*{\stab}{stab}
41 | \DeclareMathOperator*{\ccl}{ccl}
42 | \DeclareMathOperator*{\orb}{orb}
43 |
44 | % The slightly hacky optional arguments for Orb and Stab are taken from
45 | % http://www.hanskalabs.net/posts/latex-newcommand-optional-argument/
46 |
47 | \def\Orb#1{\def\tempa{#1}\futurelet\next\Orb@i}% Save first argument
48 | \def\Orb@i{\ifx\next\bgroup\expandafter\Orb@ii\else\expandafter\Orb@end\fi}%Check brace
49 | \def\Orb@ii#1{\textstyle\orb_{#1}(\tempa)}%Two args
50 | \def\Orb@end{\orb(\tempa)}%Single args
51 |
52 | \def\Stab#1{\def\tempa{#1}\futurelet\next\Stab@i}% Save first argument
53 | \def\Stab@i{\ifx\next\bgroup\expandafter\Stab@ii\else\expandafter\Stab@end\fi}%Check brace
54 | \def\Stab@ii#1{\textstyle\stab_{#1}(\tempa)}%Two args
55 | \def\Stab@end{\stab(\tempa)}%Single args
56 |
57 | \def\CCL#1{\def\tempa{#1}\futurelet\next\CCL@i}% Save first argument
58 | \def\CCL@i{\ifx\next\bgroup\expandafter\CCL@ii\else\expandafter\CCL@end\fi}%Check brace
59 | \def\CCL@ii#1{\textstyle\ccl_{#1}(\tempa)}%Two args
60 | \def\CCL@end{\ccl(\tempa)}%Single args
61 |
62 | \def\Centra#1{\def\tempa{#1}\futurelet\next\Centra@i}% Save first argument
63 | \def\Centra@i{\ifx\next\bgroup\expandafter\Centra@ii\else\expandafter\Centra@end\fi}%Check brace
64 | \def\Centra@ii#1{\cal{Z}_{#1}(\tempa)}%Two args
65 | \def\Centra@end{\cal{Z}(\tempa)}%Single args
66 |
67 | % Some more group operators
68 | \newcommand{\Centre}[1]{\cal{Z}(#1)}
69 | \newcommand{\centra}{\cal{Z}}
70 |
71 | \let\cent\relax
72 | \DeclareMathOperator*{\centraliser}{C}
73 | \DeclareMathOperator*{\normaliser}{N}
74 |
75 | \DeclareMathOperator*{\centre}{Z} %\cal{Z}
--------------------------------------------------------------------------------
/drangsymbols.sty:
--------------------------------------------------------------------------------
1 | \NeedsTeXFormat{LaTeX2e}[1996/06/01]
2 |
3 | % Last edited 26 February, 2012 by A. Chan
4 |
5 | \ProvidesPackage{drangsymbols}[2012/05/12 v1.2 alexwlchan]
6 |
7 | % \begingroup
8 | % \makeatletter
9 | % \@for\theoremstyle:=definition,remark,plain\do{%
10 | % \expandafter\g@addto@macro\csname th@\theoremstyle\endcsname{%
11 | % \setlength\thm@postskip{0pt}
12 | % }%
13 | % }
14 | % \endgroup
15 | %
16 | % % \begingroup
17 | % % \makeatletter
18 | % % \@for\theoremstyle:=proof\do{%
19 | % % \expandafter\g@addto@macro\csname th@\theoremstyle\endcsname{%
20 | % % \setlength\thm@preskip{0pt}
21 | % % \setlength\thm@postskip{0pt}
22 | % % }%
23 | % % }
24 | % % \endgroup
25 | %
26 | % \begingroup
27 | % \makeatletter
28 | % \@for\theoremstyle:=remark\do{%
29 | % \expandafter\g@addto@macro\csname th@\theoremstyle\endcsname{%
30 | % \setlength\thm@preskip\parskip
31 | % }%
32 | % }
33 | % \endgroup
34 |
35 | % \RequirePackage{amsthm}
36 | % \theoremstyle{plain}
37 |
38 | \RequirePackage{mdframed,color,tikz}
39 |
40 | \definecolor{grey60}{rgb}{0.7,0.7,0.7}
41 |
42 | \newenvironment{theorem}[1][]{%
43 | \refstepcounter{equation}%
44 | \ifstrempty{#1}%
45 | {\mdfsetup{%
46 | frametitle={%
47 | \tikz[baseline=(current bounding box.east),outer sep=0pt]
48 | \node[anchor=east,rectangle,fill=grey60]
49 | {\strut Theorem~\theequation};}}
50 | }%
51 | {\mdfsetup{%
52 | frametitle={%
53 | \tikz[baseline=(current bounding box.east),outer sep=0pt]
54 | \node[anchor=east,rectangle,fill=grey60]
55 | {\strut Theorem~\theequation:~#1};}}%
56 | }%
57 | \mdfsetup{linecolor=grey60,%
58 | skipabove=1.7\parskip,skipbelow=0.5\parskip,
59 | linewidth=2pt,topline=true,
60 | frametitleaboveskip=\dimexpr-\ht\strutbox\relax,}
61 | \begin{mdframed}[]\relax%
62 | }{\end{mdframed}}
63 |
64 | \newenvironment{definition}[1][]{%
65 | % \refstepcounter{equation}
66 | \global\mdfdefinestyle{definition}{%
67 | linecolor=grey60,linewidth=5pt,%
68 | skipabove=0.4\parskip,skipbelow=0.4\parskip,
69 | topline=false,rightline=false,bottomline=false
70 | }
71 | \ifstrempty{#1}%
72 | {\begin{mdframed}[style=definition]
73 | {\bfseries{Definition.}} % Removed ~\theequation before the full stop
74 | \relax}
75 | {\begin{mdframed}[style=definition]
76 | {\bfseries{Definition}} (#1){\bfseries{.}}\relax % Removed ~\theequation before the full stop
77 | }}{\end{mdframed}}
78 |
79 | \newenvironment{axiom}[1][]{%
80 | \refstepcounter{equation}%
81 | \ifstrempty{#1}%
82 | {\begin{mdframed}[style=definition]
83 | {\bfseries{Axiom~\theequation.}}
84 | \relax}
85 | {\begin{mdframed}[style=definition]
86 | {\bfseries{Axiom~\theequation}} (#1){\bfseries{.}}\relax%
87 | }}{\end{mdframed}}
88 |
89 |
90 | \global\mdfdefinestyle{lemma}{%
91 | linecolor=grey60,linewidth=1.5pt,
92 | skipabove=0.5\parskip,skipbelow=0.5\parskip,
93 | topline=false,rightline=false,bottomline=false
94 | }
95 |
96 | % \newenvironment{lemma}[1][]{%
97 | % \refstepcounter{equation}%
98 | % \ifstrempty{#1}%
99 | % {\begin{mdframed}[style=lemma]
100 | % {\bfseries{Lemma~\theequation.}}
101 | % \relax}
102 | % {\begin{mdframed}[style=lemma]
103 | % {\bfseries{Lemma~\theequation}} (#1){\bfseries{.}}\relax%
104 | % }}{\end{mdframed}}
105 |
106 | % \newenvironment{axiom}[1][]{%
107 | % \refstepcounter{equation}%
108 | % \ifstrempty{#1}%
109 | % {\begin{mdframed}[style=lemma]
110 | % {\bfseries{Axiom~\theequation.}}
111 | % \relax}
112 | % {\begin{mdframed}[style=lemma]
113 | % {\bfseries{Axiom~\theequation}} (#1){\bfseries{.}}\relax%
114 | % }}{\end{mdframed}}
115 |
116 | \newenvironment{example}[1][]{%
117 | \refstepcounter{equation}%
118 | \ifstrempty{#1}%
119 | {\begin{mdframed}[style=lemma]
120 | {\bfseries{Example~\theequation.}}
121 | \relax}
122 | {\begin{mdframed}[style=lemma]
123 | {\bfseries{Example~\theequation}} (#1){\bfseries{.}}\relax%
124 | }}{\end{mdframed}}
125 |
126 | \newenvironment{examples}[1][]{%
127 | \refstepcounter{equation}%
128 | \ifstrempty{#1}%
129 | {\begin{mdframed}[style=lemma]
130 | {\bfseries{Examples~\theequation.}}
131 | \relax}
132 | {\begin{mdframed}[style=lemma]
133 | {\bfseries{Examples~\theequation}} (#1){\bfseries{.}}\relax%
134 | }}{\end{mdframed}}
135 |
136 | \newenvironment{exercise}[1][]{%
137 | \refstepcounter{equation}%
138 | \ifstrempty{#1}%
139 | {\begin{mdframed}[style=lemma]
140 | {\bfseries{Exercise~\theequation.}}
141 | \relax}
142 | {\begin{mdframed}[style=lemma]
143 | {\bfseries{Exercise~\theequation}} (#1){\bfseries{.}}\relax%
144 | }}{\end{mdframed}}
145 |
146 | \newenvironment{exercises}[1][]{%
147 | \refstepcounter{equation}%
148 | \ifstrempty{#1}%
149 | {\begin{mdframed}[style=lemma]
150 | {\bfseries{Exercises~\theequation.}}
151 | \relax}
152 | {\begin{mdframed}[style=lemma]
153 | {\bfseries{Exercises~\theequation}} (#1){\bfseries{.}}\relax%
154 | }}{\end{mdframed}}
155 |
156 | \newenvironment{question}[1][]{%
157 | \item #1}
158 |
159 | % \newenvironment{proposition}[1][]{%
160 | % \refstepcounter{equation}%
161 | % \ifstrempty{#1}%
162 | % {\begin{mdframed}[style=lemma]
163 | % {\bfseries{Proposition~\theequation.}}
164 | % \relax}
165 | % {\begin{mdframed}[style=lemma]
166 | % {\bfseries{Proposition~\theequation}} (#1){\bfseries{.}}\relax%
167 | % }}{\end{mdframed}}
168 |
169 |
170 | \RequirePackage{amsthm}
171 |
172 | \theoremstyle{plain}
173 | % \newtheorem{axiom}[equation]{Axiom}
174 | \newtheorem*{aim}{Aim}
175 | \newtheorem{corollary}[equation]{Corollary}
176 | \newtheorem{assertion}[equation]{Assertion}
177 | \newtheorem{lemma}[equation]{Lemma}
178 | \newtheorem{proposition}[equation]{Proposition}
179 | \newtheorem*{claim}{Claim}
180 |
181 | \theoremstyle{definition}
182 | \newtheorem{problem}[equation]{Problem}
183 |
184 | \theoremstyle{remark}
185 | \newtheorem*{remark}{Remark}
186 | \newtheorem*{proof*}{Proof}
187 | \newtheorem*{remarks}{Remarks}
188 | \newtheorem*{note}{Note}
189 | \newtheorem*{notes}{Notes}
190 |
191 | % \newtheorem{task}{Task}
192 | %
193 | % \theoremstyle{definition}
194 | % \newtheorem*{definition}{Definition}
195 | % \newtheorem*{openproblem}{Open problem}
196 | % \newtheorem{exercise}{$\blacktriangleright$
197 | % \hypertarget{Ex\theexercise}{Exercise}}[lecture]
198 | %
199 |
200 |
201 | % Solutions
202 | % \RequirePackage{answers}
203 | % \Newassociation{solution}{Solution}{exSolutions}
204 | % \renewenvironment{Solution}[1]{%\small%
205 | % \begin{trivlist} \item \textit{Solution}~#1.}{%
206 | % \hspace*{\fill} $\blacksquare$\end{trivlist}}
207 |
208 | % Warnings
209 | \newenvironment{warning}{%
210 | \vspace{-6pt}
211 | \begin{trivlist} \item[] \noindent%
212 | \begingroup\hangindent=2pc\hangafter=-2
213 | \clubpenalty=10000%
214 | \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces
215 | \textit{Warning}.}%
216 | {\endgraf\endgroup\end{trivlist}}
217 |
218 | \newenvironment{warnings}{%
219 | \vspace{-6pt}
220 | \begin{trivlist} \item[] \noindent%
221 | \begingroup\hangindent=2pc\hangafter=-2
222 | \clubpenalty=10000%
223 | \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces
224 | \textit{Warnings}.}%
225 | {\endgraf\endgroup\end{trivlist}}
226 |
227 | \newcommand{\isin}{\ensuremath{\in}}
228 | \newcommand{\inch}{\ensuremath{{}^{\prime\prime}}}
229 | \newcommand{\ft}{\ensuremath{{}^\prime}}
230 | \newcommand{\by}{\ensuremath{\!\times\!}}
231 | \newcommand{\degrees}{\ensuremath{{}^\circ}}
232 | \newcommand{\lbin}{\ensuremath{\mathrm{lb \! \cdot \! in}}}
233 | \newcommand{\inlb}{\ensuremath{\mathrm{in \! \cdot \! lb}}}
234 | \newcommand{\kin}{\ensuremath{\mathrm{k \! \cdot \! in}}}
235 | \newcommand{\ink}{\ensuremath{\mathrm{in \! \cdot \! k}}}
236 | \newcommand{\lbft}{\ensuremath{\mathrm{lb \! \cdot \! ft}}}
237 | \newcommand{\ftlb}{\ensuremath{\mathrm{ft \! \cdot \! lb}}}
238 | \newcommand{\kft}{\ensuremath{\mathrm{k \! \cdot \! ft}}}
239 | \newcommand{\ftk}{\ensuremath{\mathrm{ft \! \cdot \! k}}}
240 | \newcommand{\Nmm}{\ensuremath{\mathrm{N \! \cdot \! mm}}}
241 | \newcommand{\Nm}{\ensuremath{\mathrm{N \! \cdot \! m}}}
242 | \newcommand{\degree}{\ensuremath{^\circ}}
243 |
244 | \newcommand{\sfrac}[2]{\ensuremath{\leavevmode\kern0em\raise.5ex
245 | \hbox{\mbox{\fontsize\sf@size\z@
246 | \selectfont#1}}\kern-.05em
247 | /\kern-.1em
248 | \hbox{\mbox{\fontsize\sf@size\z@
249 | \selectfont#2}}}}
250 |
251 | \RequirePackage{amssymb,fakeMnSymbol}
252 |
253 | \newcommand{\disp}{\displaystyle}
254 |
255 | \newcommand{\dlim}{\displaystyle\lim}
256 | \newcommand{\del}{\partial}
257 | \newcommand{\Del}{\nabla}
258 |
259 | % \newcommand{\powerset}{\MNSpowerset}
260 | \newcommand{\powerset}{\wp}
261 |
262 | \renewcommand{\bf}[1]{\textbf{#1}}
263 | \renewcommand{\sf}[1]{\ensuremath{\mathsf{#1}}}
264 | \renewcommand{\rm}[1]{\ensuremath{\mathrm{#1}}}
265 | \renewcommand{\cal}[1]{\ensuremath{\mathcal{#1}}}
266 | \newcommand{\bb}[1]{\ensuremath{\mathbb{#1}}}
267 | \renewcommand{\tt}[1]{\ensuremath{\mathtt{#1}}}
268 | \newcommand{\mono}[1]{{\small\texttt{#1}}}
269 | \renewcommand{\bold}[1]{\ensuremath{\boldsymbol{#1}}}
270 | \renewcommand{\frak}[1]{\ensuremath{\mathfrak{#1}}}
271 |
272 | \renewcommand{\d}{\dif}
273 |
274 | \newcommand{\N}{\bb{N}}
275 | \newcommand{\Z}{\bb{Z}}
276 | \newcommand{\Q}{\bb{Q}}
277 | \newcommand{\R}{\bb{R}}
278 | \let\C\relax
279 | \newcommand{\C}{\bb{C}}
280 | \newcommand{\F}{\bb{F}}
281 |
282 | \newcommand{\Rm}{\R^m}
283 | \newcommand{\Rn}{\R^n}
284 | \newcommand{\Cn}{\C^n}
285 | \newcommand{\Fm}{\F^m}
286 | \newcommand{\Fn}{\F^n}
287 |
288 | \newcommand{\iN}{\in\N}
289 | \newcommand{\iZ}{\in\Z}
290 | \newcommand{\iQ}{\in\Q}
291 | \newcommand{\iR}{\in\R}
292 | \newcommand{\iRn}{\in\Rn}
293 | \newcommand{\iRm}{\in\Rm}
294 | \newcommand{\iC}{\in\C}
295 | \newcommand{\iCn}{\in\Cn}
296 | \newcommand{\iF}{\in\F}
297 |
298 | \DeclareMathOperator*{\id}{id}
299 | \DeclareMathOperator*{\Curl}{curl}
300 | \DeclareMathOperator*{\Grad}{grad}
301 | \DeclareMathOperator*{\Div}{div}
302 |
303 | \DeclareMathOperator*{\sech}{sech}
304 | \DeclareMathOperator*{\cosech}{cosech}
305 | \DeclareMathOperator*{\cosec}{cosec}
306 |
307 | \newcommand{\grad}{\bold{\nabla}}
308 | \newcommand{\cross}{\times}
309 |
310 | \newcommand{\f}[2]{\frac{#1}{#2}}
311 | \newcommand{\df}[2]{\dfrac{#1}{#2}}
312 | \newcommand{\tf}[2]{\textstyle\frac{#1}{#2}}
313 | \newcommand{\dy}[2]{\od{#1}{#2}}
314 | \newcommand{\ddy}[2]{\od[2]{#1}{#2}}
315 | \newcommand{\pa}[2]{\pd{#1}{#2}}
316 | \newcommand{\pab}[3]{\md{2}{#1}{1}{#2}{1}{#3}}
317 | \newcommand{\ppa}[2]{\pd[2]{#1}{#2}}
318 | \newcommand{\mat}[1]{\begin{pmatrix} #1 \end{pmatrix}}
319 | \newcommand{\vmat}[1]{\begin{vmatrix} #1 \end{vmatrix}}
320 |
321 | \newcommand{\wiki}[2]{\href{http://en.wikipedia.org/wiki/#1}{\emph{#2}}}
322 | \newcommand{\wikirm}[2]{\href{http://en.wikipedia.org/wiki/#1}{#2}}
323 |
324 | \newcommand{\lV}{\left\Vert}
325 | \newcommand{\rV}{\right\Vert}
326 |
327 | \newcommand{\lv}{\left\vert}
328 | \newcommand{\rv}{\right\vert}
329 |
330 | \newcommand{\vvert}[1]{\left\vert #1 \right\vert}
331 |
332 | \newcommand{\isom}{\cong}
333 | \newcommand{\isomto}{\xrightarrow{\sim}}
334 | \newcommand{\isomfrom}{\xleftarrow{\sim}}
335 |
336 | \newcommand{\surjto}{\twoheadrightarrow}
337 | \newcommand{\surjfrom}{\twoheadleftarrow}
338 |
339 | \newcommand{\injto}{\hookrightarrow}
340 | \newcommand{\injfrom}{\hookrightarrow}
341 |
342 | \renewcommand{\vec}[1]{\boldsymbol{#1}}
343 |
344 | \DeclareMathOperator*{\erf}{erf}
345 |
346 | \newcommand{\qend}{\hfill $\blacksquare$}
347 |
348 | % Setup the matha font (from mathabx.sty)
349 | \DeclareFontFamily{U}{matha}{\hyphenchar\font45}
350 | \DeclareFontShape{U}{matha}{m}{n}{
351 | <5> <6> <7> <8> <9> <10> gen * matha
352 | <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12
353 | }{}
354 | \DeclareSymbolFont{matha}{U}{matha}{m}{n}
355 |
356 | % Define a subset character from that font (from mathabx.dcl) to completely replace the \subset character, you can replace \varsubset with \subset
357 | \DeclareMathSymbol{\notdivides}{3}{matha}{"1F}
358 | \DeclareMathSymbol{\divides}{3}{matha}{"17}
359 |
360 | % Some code for the titlepage
361 | % This takes the format {%part}{%term}{%course name}{%lecturer_initials}{%lecturer_surname}
362 |
363 | \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
364 |
365 | % At some point I should roll these together
366 |
367 | % Major heading line 1
368 | % Major heading line 2
369 | % Minor heading
370 | % Title
371 | % Lectured by
372 | % Professor
373 | % Notes by
374 | % Me
375 | % Footer text
376 | \newcommand{\TitlePage}[9]
377 | {
378 | \begin{center}
379 |
380 | \thispagestyle{empty}
381 |
382 | \textsc{\textcolor{white}{AAA}}\\[1.5cm]
383 | {\large #1}\\[0.1cm]
384 | {\large #2}\\[0.5cm] % Major heading such as course name
385 | {\large #3}\\[0.5cm] % Minor heading such as course title
386 |
387 | \HRule \\[0.4cm]
388 | {\huge \sffamily\bfseries #4}\\[0.4cm] % Title of your document
389 | \HRule \\[1.5cm]
390 |
391 | \begin{minipage}{0.4\textwidth}
392 | \begin{flushleft} \large
393 | \emph{#5}\\
394 | #6 % Your name
395 | \end{flushleft}
396 | \end{minipage}
397 | ~
398 | \begin{minipage}{0.4\textwidth}
399 | \begin{flushright} \large
400 | \emph{#7} \\
401 | #8 % Supervisor's Name
402 | \end{flushright}
403 | \end{minipage}\vfill
404 |
405 | #9 \\[0.3cm] %
406 | {Printed \today.}\\[1cm] %
407 |
408 | \end{center}
409 |
410 | \pagebreak}
411 |
412 | % My custom title pages for Cambridge notes
413 |
414 | \newcommand{\NotesTitle}[6]{\TitlePage
415 | {Part #1 of the Mathematical Tripos}
416 | {of the University of Cambridge}
417 | {#2}
418 | {#3}
419 | {Lectured by:}
420 | {#4~\textsc{#5}}
421 | {Notes by:}
422 | {Alex \textsc{Chan}}
423 | {
424 | {\ Please send comments and corrections to \href{mailto:awlc2@cam.ac.uk}{awlc2@cam.ac.uk}.} \\[0.3cm]
425 | The most recent copy of these notes can be downloaded from \href{http://www.alexwlchan.net/maths}{alexwlchan.net/maths} \\[0.3cm] %
426 | {\ These notes are licensed under a \href{http://creativecommons.org/licenses/by-nc-sa/3.0/}{Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License}.} \\[0.3cm] %
427 | {\ The following resources are \emph{not} endorsed by the University of Cambridge.}
428 | }
429 |
430 | \thispagestyle{empty}
431 |
432 | #6
433 |
434 | \setcounter{page}{0}
435 |
436 | \newpage}
437 |
438 | \newcommand{\NotesSubTitle}[7]{\SubTitlePage
439 | {Part #1 of the Mathematical Tripos}
440 | {of the University of Cambridge}
441 | {#2}
442 | {{\huge \sffamily\bfseries #3}\\[0.4cm]
443 |
444 | {\large \sffamily\bfseries #7}}
445 | {Lectured by:}
446 | {#4~\textsc{#5}}
447 | {Notes by:}
448 | {Alex \textsc{Chan}}
449 | {
450 | {\ Comments and corrections should be sent to \href{mailto:awlc2@cam.ac.uk}{awlc2@cam.ac.uk}.} \\[0.5cm] %
451 | {\ This work is licensed under a \href{http://creativecommons.org/licenses/by-nc-sa/3.0/}{Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License}.} \\[0.5cm] %
452 | {\ The following resources are \emph{not} endorsed by the University of Cambridge.}
453 | }
454 |
455 | \thispagestyle{empty}
456 |
457 | #6
458 |
459 | \setcounter{page}{0}
460 |
461 | \newpage}
462 |
463 | \newcommand{\ExamplesTitle}[3]
464 | {{\LARGE\bfseries\sffamily{#1, Examples Sheet #2}}
465 |
466 | {\bfseries\sffamily{FAO: #3 \\
467 | From: Alex Chan \\
468 | Printed: \today.}}
469 |
470 | \thispagestyle{empty}}
471 |
472 | \usepackage{marginnote}
473 | \newcommand{\datemarker}[1]{\marginnote{\footnotesize{\sffamily{#1}}}}
474 | \newcommand{\lecturemarker}[2]{\marginnote{\footnotesize{\sffamily{Lecture #1}}}}
475 |
476 | \newcommand{\p}{^{\,\prime}}
477 | \newcommand{\pp}{^{\,\prime\prime}}
478 | \newcommand{\ppp}{^{\,\prime\prime\prime}}
479 |
480 | \newcommand{\drangarray}{\renewcommand{\arraystretch}{0.95}}
481 | \drangarray
482 |
483 | \DeclareMathOperator*{\RHS}{RHS}
484 | \DeclareMathOperator*{\LHS}{LHS}
485 |
486 | \DeclareMathOperator*{\Image}{Im}
487 |
488 | % These two commands came from a course in Probability
489 | \newcommand{\glstack}{\begin{array}{c} \geq \\ \leq\end{array}}
490 | \newcommand{\lgstack}{\begin{array}{c} \leq \\ \geq\end{array}}
491 |
492 | \newcommand{\intinf}{\int_{-\infty}^\infty}
493 |
494 | \newcommand{\mnewline}{\\[-5pt] &}
495 |
496 | % \newcommand{\mmaticablock}[2]{
497 | % \renewcommand{\arraystretch}{1.3}
498 | % \begin{tabular}{r p{12cm}}
499 | % \mtmc In[1]:= &
500 | % \begin{minipage}[t]{\linewidth}
501 | % \begin{verbatim}
502 | % return [offset](\%ebp)
503 | % return2
504 | % \end{verbatim}
505 | % \end{minipage}
506 | % \end{tabular}
507 | % \drangarray
508 | % }
509 |
510 | % \newcommand{\mmaticablock}[1]{
511 | % \renewcommand{\arraystretch}{1.3}
512 | % \begin{tabular}{
513 | % >{\mtmc}{r} p{0.55cm} p{12cm}}
514 | % #1
515 | % \end{tabular}
516 | % \drangarray}
517 |
518 | % \newcommand{\mmaticablock}[1]{
519 | % \renewcommand{\arraystretch}{1.3}
520 | % \begin{tabular}{>{\begin{figure}[!h]\begin{minipage}[t]{1.0\textwidth}\vspace{0pt}\mtmc}r <{\end{minipage}\end{figure}} >{\begin{minipage}{1.0\textwidth}} p{0.9\textwidth} <{\end{minipage}}}
521 | % #1
522 | % \end{tabular}
523 | % \drangarray}
524 |
525 | % {%
526 | % \refstepcounter{catamlisting}%
527 | % {{\bfseries\sffamily{Listing~\thecatamlisting.}}\relax} #1 {}}
528 |
529 | % Indicator functions
530 | \DeclareMathOperator*{\ind}{1}
531 |
532 | \usetikzlibrary{arrows, decorations.markings}
533 | \newcommand{\bigarrow}{\draw [decoration={markings,mark=at position 1 with {\arrow[scale=2]{>}}},
534 | postaction={decorate},
535 | shorten >=0.4pt]}
536 |
537 | \newcommand{\norm}[1]{\left\Vert #1 \right\Vert}
538 | \DeclareMathOperator{\Norm}{N}
539 |
540 | \newcommand{\ph}{\phantom{-}}
541 | \newcommand{\shadeblack}{black!25}
542 |
543 | \newcommand{\qqand}{\qquad \text{and} \qquad}
544 | \newcommand{\qqwhere}{\qquad \text{where} \qquad}
545 |
546 | \newcommand{\lecturenotesend}{\begin{center} \mbox{} \\[1cm] {\sffamily\bfseries{End of notes}} \end{center}}
547 | \newcommand{\lecturenotesendshort}{\begin{center} {\sffamily\bfseries{End of notes}} \end{center}}
548 |
549 | \newcommand{\TikZ}{Ti\emph{k}Z}
--------------------------------------------------------------------------------
/drangreport.sty:
--------------------------------------------------------------------------------
1 | \NeedsTeXFormat{LaTeX2e}[1996/06/01]
2 | \ProvidesPackage{drangreport}[2012/10/24 v1.2 alexwlchan]
3 | \typeout{Package: `drangreport'}
4 |
5 | % Items that must be customized for your company and computer are denoted
6 | % with a *****CUSTOMIZE***** comment.
7 |
8 | % We start by loading a large number of packages
9 |
10 | % Include some useful standard packages
11 | \RequirePackage{ifthen,graphicx,float,color,hyperref}
12 | \hypersetup{colorlinks=true}
13 | \usepackage[small]{caption}
14 |
15 | % Get the nice d-bend symbol for warnings
16 | \RequirePackage{manfnt}
17 |
18 | % Defines a counter to keep track of lecture numbers
19 | % Introduced early because it conflicts with amsmath, iirc
20 | \newcounter{lecture}
21 |
22 | % Define a set of useful symbols
23 | \RequirePackage{amsmath,drangsymbols,units,commath}
24 |
25 | % Include a package I stole from Jakob Schiotz
26 | \RequirePackage{tweaklist}
27 |
28 | % Defines the dcases environment
29 | \RequirePackage{mathtools}
30 |
31 | % Used for the boxes around theorems and similar
32 | % \RequirePackage{framed}
33 |
34 | % For annotations in draft files
35 | % \RequirePackage{todonotes}
36 |
37 | % Includes the table decorations that I like
38 | \RequirePackage{booktabs,multirow,eukdate}
39 |
40 | % Package for font handling
41 | % \RequirePackage{mathspec}
42 |
43 | % Items for handling options
44 | \newcounter{fontset}
45 | \newcommand{\titlefamily}{}
46 | \newcommand{\authorlength}{2in}
47 | \newcommand{\logolength}{1in}
48 |
49 | % This should have the full pathname to your company logo. See also the
50 | % showlogo command below. You may need to fiddle with the scale factor to
51 | % get the logo to fit in the available space.
52 | % *****CUSTOMIZE*****
53 | \newcommand{\showlogo}{%
54 | \centering\hspace{.25in}
55 | \includegraphics[scale=.65]
56 | {/Users/alexwlchan/Dropbox/BATS/bat-large.pdf}
57 | }
58 |
59 | % An option to the package determines the font set we're going to use.
60 | % The default is the Computer Modern set (fontset 0), which is like
61 | % standard LaTeX. The other three options are:
62 | %
63 | % "times" (fontset 1)
64 | % serif: Caecilia
65 | % sans serif: Proxima Nova (used for section headings and titles)
66 | % typewriter: Courier
67 | % math: Mathematica
68 | %
69 | % "palatino" (fontset 2)
70 | % serif: Lyon
71 | % san serif: Proxima Nova (used for section headings and titles)
72 | % typewriter: Consolas for BBEdit
73 | % math: The standard LaTeX set (with Lyon numerals and text)
74 | % greek: Gentium Basic
75 | %
76 | % "timesopt" (fontset 3)
77 | % sans serif: Optima (used for section headings and titles)
78 | % typewriter: Courier
79 | % math: Mathematica
80 | %
81 | % "hivizviz" (fontset 4)
82 | % sans serif: FS Me
83 | %
84 | % Obviously, these fonts must be available to your LaTeX system for these options to work.
85 | %
86 |
87 | % Another option to the package determines whether the (company) logo
88 | % appears on the title page. By default, the logo does not appear.
89 | % *****CUSTOMIZE*****
90 | \DeclareOption{logo}{%
91 | % \renewcommand{\showlogo}{%
92 | % \centering\hspace{.25in}
93 | % \includegraphics[scale=.65]
94 | % {/Users/alexwlchan/Dropbox/BATS/bat-large.pdf}
95 | % }%
96 | \renewcommand{\authorlength}{2in}%
97 | \renewcommand{\logolength}{1in}%
98 | }
99 | \DeclareOption{nologo}{%
100 | \renewcommand{\showlogo}{}%
101 | \renewcommand{\authorlength}{2.75in}%
102 | \renewcommand{\logolength}{.25in}%
103 | }
104 |
105 | % Uses roman numerals (i), (ii), (iii) for numbered lists by default,
106 | % which I prefer
107 | \renewcommand{\labelenumi}{(\roman{enumi})}
108 |
109 | % An option to make links black for printing
110 | \DeclareOption{blacklinks}{
111 | \hypersetup{colorlinks=false}
112 | }
113 |
114 | % Change the headings pagestyle to show the title if it's an article.
115 | % See Kopka & Daly C.3.2 and article.cls.
116 | \ifthenelse{\boolean{@twoside}}{%
117 | \renewcommand{\ps@headings}{%
118 | \renewcommand*{\@oddfoot}{}%
119 | \renewcommand*{\@evenfoot}{}%
120 | \renewcommand*{\@oddhead}{\hfill\footnotesize\sffamily{{{\sectitle}} $\vert$
121 | \bfseries{\thepage}}} %
122 | \renewcommand*{\@evenhead}{\footnotesize\sffamily{{\bfseries{\thepage}} $\vert$ {{\@shorttitle}} \hfill}} %
123 | % \renewcommand*{\@oddhead}{\normalfont\normalsize\hfill\thepage}%
124 | % \renewcommand*{\@evenhead}{\normalfont\normalsize\thepage\hfill{\itshape\MakeUppercase{\@shorttitle}}}%
125 | }%
126 | }{%
127 | \renewcommand{\ps@headings}{%
128 | \renewcommand*{\@oddfoot}{}%
129 | \renewcommand*{\@evenfoot}{}%
130 | % \renewcommand*{\@oddhead}{\normalfont\normalsize{\itshape\MakeUppercase{\@shorttitle}}\hfill\thepage}%
131 | \renewcommand*{\@oddhead}{\hfill\footnotesize\sffamily{{{\@shorttitle}} $\vert$ \bfseries{\thepage}}}
132 | \renewcommand*{\@evenhead}{\@oddhead}%
133 | }%
134 | }
135 |
136 | % An option for my examples sheets, which sets up slightly
137 | % different numbering styles and different page headings
138 | \DeclareOption{examples}{%
139 |
140 | % Options for the exam package
141 | % \renewcommand{\thequestion}{\em\arabic{question}}
142 | %\renewcommand{\solutiontitle}{\em}
143 | %\unframedsolutions
144 | %\renewcommand{\questionshook}{\em}
145 |
146 | \renewcommand{\labelenumi}{\bfseries\sffamily{\arabic{enumi}.}}
147 | \renewcommand{\labelenumii}{(\roman{enumii})}
148 | \renewcommand{\labelenumiii}{(\alph{enumiii})}
149 | \ifthenelse{\boolean{@twoside}}{%
150 | \renewcommand{\ps@headings}{%
151 | \renewcommand*{\@oddfoot}{}%
152 | \renewcommand*{\@evenfoot}{}%
153 | \renewcommand*{\@oddhead}{\hfill \footnotesize\sffamily{\@shorttitle~$\vert$ {\bfseries{\thepage}}}} %
154 | \renewcommand*{\@evenhead}{\footnotesize\sffamily{{\bfseries{\thepage}} $\vert$ \@shorttitle} \hfill} %
155 | % \renewcommand*{\@oddhead}{\normalfont\normalsize\hfill\thepage}%
156 | % \renewcommand*{\@evenhead}{\normalfont\normalsize\thepage\hfill{\itshape\MakeUppercase{\@shorttitle}}}%
157 | }%
158 | }{%
159 | \renewcommand{\ps@headings}{%
160 | \renewcommand*{\@oddfoot}{}%
161 | \renewcommand*{\@evenfoot}{}%
162 | % \renewcommand*{\@oddhead}{\normalfont\normalsize{\itshape\MakeUppercase{\@shorttitle}}\hfill\thepage}%
163 | \renewcommand*{\@oddhead}{\hfill\footnotesize\sffamily{\@shorttitle~$\vert$ \bfseries{\thepage}}} %
164 | \renewcommand*{\@evenhead}{\footnotesize\sffamily{{\bfseries{\thepage}}}} %
165 | }%
166 | }
167 | }
168 |
169 |
170 |
171 | \ExecuteOptions{nologo}
172 | \ProcessOptions
173 |
174 | % Handle the fontset option.
175 |
176 | % Set the side margins to 1.25 in. See Kopka & Daly C.3.1.
177 | % Placed before font options are executed to allow for wider
178 | % customisation in the font options.
179 | \newlength{\uni@sidemargin}
180 | \setlength{\uni@sidemargin}{1.25in}
181 | \setlength{\textwidth}{\paperwidth}
182 | \addtolength{\textwidth}{-2\uni@sidemargin}
183 | \setlength{\oddsidemargin}{\uni@sidemargin}
184 | \addtolength{\oddsidemargin}{-1in}% to account for TeX's automatic 1in
185 | \setlength{\evensidemargin}{\oddsidemargin}
186 |
187 |
188 | %
189 |
190 | % No extra space after sentence ends.
191 | % \frenchspacing
192 | \raggedbottom
193 | %
194 | % We're going to have a half-line space between each paragraph and
195 | % no paragraph indentation.
196 | \setlength{\parskip}{.7\baselineskip}
197 | \setlength{\parindent}{0pt}
198 | %
199 | %
200 | %
201 | % Make sure it doesn't screw up the table of contents
202 | \newcommand{\TableofContents}{
203 | \setlength{\parskip}{0pt}
204 | \setlength{\parindent}{0pt}
205 | \thispagestyle{empty}
206 | \tableofcontents
207 | \setlength{\parskip}{.5\baselineskip}
208 | \setlength{\parindent}{0pt}}
209 | %
210 | % This ensures that I don't get a page number in the central footer of the titlepage
211 | \newcommand{\MakeTitle}{
212 | \maketitle
213 | \thispagestyle{empty}}
214 | %
215 | % The spacing between list items will be the same as the spacing
216 | % between paragraphs.
217 | \renewcommand{\enumhook}{\setlength{\topsep}{0pt}%
218 | \setlength{\itemsep}{0pt}%
219 | \setlength{\parsep}{\parskip}}
220 | \renewcommand{\itemhook}{\setlength{\topsep}{0pt}%
221 | \setlength{\itemsep}{0pt}%
222 | \setlength{\parsep}{\parskip}}
223 | %
224 | % Change the chapter fonts to sans serif (if the class has chapters).
225 | \@ifundefined{@makechapterhead}{}
226 | {\renewcommand{\@makechapterhead}[1]{%
227 | \vspace*{50\p@}%
228 | {\parindent \z@ \raggedright \normalfont
229 | \ifnum \c@secnumdepth >\m@ne
230 | \normalfont\titlefamily\bfseries\LARGE \@chapapp\space \thechapter
231 | \par\nobreak
232 | \vskip 20\p@
233 | \fi
234 | \interlinepenalty\@M
235 | \LARGE \bfseries #1\par\nobreak
236 | \vskip 40\p@
237 | }}
238 | \renewcommand{\@makeschapterhead}[1]{%
239 | \vspace*{50\p@}%
240 | {\parindent \z@ \raggedright
241 | \normalfont
242 | \interlinepenalty\@M
243 | \titlefamily\LARGE\bfseries #1\par\nobreak
244 | \vskip 40\p@
245 | }}}%
246 | %
247 | % Change the (sub)section and (sub)paragraph fonts to sans serif. See
248 | % Kopka & Daly C.3.3.
249 | \renewcommand{\section}{\@startsection{section}{1}%
250 | {0pt}% indent
251 | {-3.75ex plus -1ex minus -.2ex}% pre-skip, next par not indented)
252 | {2.0ex plus .2ex}% post-skip
253 | {\normalfont\titlefamily\sffamily\bfseries\LARGE}}
254 | \renewcommand{\subsection}{\@startsection{subsection}{2}%
255 | {0pt}% indent
256 | {-2.5ex plus -1ex minus -.2ex}% pre-skip, next par not indented)
257 | {1.25ex plus .2ex}% post-skip
258 | {\normalfont\titlefamily\sffamily\bfseries\Large}}
259 | \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}%
260 | {0pt}% indent
261 | {-1.25ex plus -1ex minus -.2ex}% pre-skip, next par not indented)
262 | {.5ex plus .2ex}% post-skip
263 | {\normalfont\titlefamily\sffamily\bfseries\large}}
264 | \renewcommand{\paragraph}{\@startsection{paragraph}{4}%
265 | {0pt}% indent
266 | {-1.25ex plus -1ex minus -.2ex}% pre-skip, next par not indented)
267 | {-1em}% post-skip, run-in w/ 1 em space
268 | {\normalfont\titlefamily \bfseries\normalsize}}
269 | \renewcommand{\subparagraph}{\@startsection{subparagraph}{5}%
270 | {0pt}% indent
271 | {1.25ex plus 1ex minus .2ex}% pre-skip, next par not indented)
272 | {-1em}% post-skip, run-in w/ 1 em
273 | {\normalfont\titlefamily\itshape\normalsize}}
274 | %
275 | % Change the contents and list fonts. Use the chapter font if the
276 | % document has chapters, otherwise use the section font. These are
277 | % taken directly from the article and report classes, with only the
278 | % font stuff changed.
279 | %
280 | % Set the header .5in from top of paper, the footer .5in from bottom
281 | % of paper, and the top & bottom body margins at 1in. See Kopka &
282 | % Daly C.3.1.
283 | \newlength{\uni@hfmargin}
284 | \setlength{\uni@hfmargin}{.5in}
285 | \setlength{\headheight}{12bp}% enough for 1 line of text
286 | \setlength{\headsep}{24bp}% \headheight + \headsep = 36bp = .5in
287 | \setlength{\footskip}{36bp}% .5 in
288 | \setlength{\textheight}{\paperheight}
289 | \addtolength{\textheight}{-2in}% 1in at top + 1in at bottom
290 | \setlength{\topmargin}{\uni@hfmargin}
291 | \addtolength{\topmargin}{-1in}% to account for TeX's automatic 1in
292 | %
293 | % Create a \@shorttitle variable for the heading. If not defined by the
294 | % user, with the \shorttitle command, it will default to \@title.
295 | \newcommand{\@shorttitle}{\@title}
296 | \newcommand{\shorttitle}[1]{\renewcommand{\@shorttitle}{#1}}
297 | %
298 | % I am the default author.
299 | % *****CUSTOMIZE*****
300 | \renewcommand{\@author}{Alex Chan}
301 | %
302 | % Add a \client command that is similar to \author.
303 | \newcommand{\client}[1]{\newcommand{\@client}{#1}}
304 | %
305 | %
306 | % Use headings for most pages
307 | \pagestyle{headings}
308 | %
309 | % Redefine \maketitle to use san serif fonts, display the company logo
310 | % (when on a separate title page), and display the \@author and (when on
311 | % a separate title page) \@client as centered tables.
312 | \ifthenelse{\boolean{@titlepage}}{
313 | \renewcommand{\maketitle}{
314 | \renewcommand{\and}
315 | {\end{tabular} \begin{tabular}[t]{c}\vspace{.5ex}\\}
316 | \begin{titlepage}
317 | \begin{center}
318 | \begin{tabular}[t]{p{8cm}}
319 | \parbox[c][1in][c]{5in}{\hfill}\\
320 | \parbox[c][2in][c]{5in}
321 | {\centering\normalfont\titlefamily\bfseries\Huge\@title} \\
322 | {\centering\normalfont\titlefamily\bfseries\Large\@subtitle} \\
323 | \begin{minipage}[c][\authorlength][c]{5in}
324 | {\begin{center}%
325 | \normalfont\normalsize%
326 | a report by\par\vspace{1ex}%
327 | \begin{tabular}[t]{c}
328 | \vspace{.5ex}\\
329 | \@author
330 | \end{tabular}%
331 | \end{center}}%
332 | \end{minipage}\\
333 | \parbox[c][\logolength][c]{5in}
334 | {\showlogo}\\
335 | \begin{minipage}[c][2in][c]{5in}
336 | \@ifundefined{@client}{}
337 | {\centering\normalfont\normalsize%
338 | submitted to\\
339 | \begin{tabular}[t]{c}
340 | \vspace{.5ex}\\
341 | \@client
342 | \end{tabular}}
343 | \end{minipage}\\
344 | \parbox[c][1in][c]{5in}
345 | {\centering\normalfont\normalsize\@date}
346 | \end{tabular}
347 | \end{center}
348 | \end{titlepage}
349 | % for the first text page of an article
350 | % add .5in + 0pt space at the top of the page
351 | %\@ifundefined{@makechapterhead}{\vspace*{0pt}}{}%
352 | %\thispagestyle{plain}% no header
353 | }
354 | }{% This is for for when there is no title page
355 | \renewcommand{\maketitle}{
356 | \renewcommand{\and}
357 | {\end{tabular} \begin{tabular}[t]{c}\vspace{.5ex}\\}
358 | \begin{center}
359 | \begin{tabular}[t]{c}
360 | \parbox[c][1in][c]{5in}
361 | {\centering\normalfont\titlefamily\bfseries\Huge\@title} \\
362 | {\centering\normalfont\titlefamily\bfseries\Large\@subtitle} \\
363 | \begin{minipage}{5in}
364 | \begin{center}
365 | \normalfont\normalsize%
366 | \begin{tabular}[t]{c}
367 | \vspace{.5ex}\\
368 | \@author
369 | \end{tabular}
370 | \end{center}
371 | \end{minipage}
372 | \vspace{.25in}\\
373 | \@date\\
374 | \vspace{.125in}\\
375 | \parbox[c][\logolength][c]{5in}
376 | {\showlogo}\\
377 | \end{tabular}
378 | \end{center}
379 | \thispagestyle{empty}% no header on 1st page
380 | }
381 | }
382 | %
383 | % The \pagedrop command adds 0.5in to the top. Should be used for the
384 | % first page of text if there's a title page.
385 | % Also for first page of TOC, etc.
386 | \newcommand{\pagedrop}{%
387 | \@ifundefined{@makechapterhead}{\vspace*{0pt}}{}% 0.5in + 0pt
388 | }
389 | %
390 | % Add a \signatures command that places the authors' names after a closing
391 | % line. Provides space above the names for signatures.
392 | \newcommand{\signatures}[1]{%
393 | % make a local change to \and to provide spacing and signature lines
394 | \renewcommand{\and}{%
395 | \end{tabular*}\hspace{0pt}%
396 | \begin{tabular*}{3in}[t]{l}
397 | \vspace{.5in}\\
398 | \rule{2.5in}{.5bp}\\}
399 | \par%
400 | \vspace{.25in}% separation from the body of the text
401 | \begin{minipage}{6in}%
402 | \flushleft\normalfont\normalsize#1\par
403 | \setlength{\tabcolsep}{0pt}% to keep left side at margin
404 | \begin{tabular*}{3in}[t]{l}
405 | \vspace{.5in}\\
406 | \rule{2.5in}{.5bp}\\
407 | \@author
408 | \end{tabular*}
409 | \end{minipage}
410 | }
411 | %
412 | % Add a \mysignature command that places my signature and name after a
413 | % closing line.
414 | % *****CUSTOMIZE*****
415 | \newcommand{\mysignature}[1]{%
416 | \par%
417 | \vspace{.25in}% separation from the body of the text
418 | \flushleft\normalfont\normalsize#1\par
419 | \hspace{-.1in}\includegraphics{/Users/drang/graphics/sig.pdf}\\
420 | \vspace{-.3in}\rule{2.5in}{.5bp}\\
421 | Alex Chan
422 | }
423 | %
424 | % Define a float for plates. These are taken directly from the
425 | % article.cls and report.cls definitions for the figure environment
426 | % with the word "figure" replaced with "plate," "lof" with "lop,"
427 | % and the ftype set to 4 instead of 1.
428 | \@ifundefined{@makechapterhead}
429 | { \newcounter{plate}
430 | \renewcommand \theplate {\@arabic\c@plate}
431 | \def\fps@plate{tbp}
432 | \def\ftype@plate{4}
433 | \def\ext@plate{lop}
434 | \def\fnum@plate{\platename\nobreakspace\theplate}
435 | \newenvironment{plate}
436 | {\@float{plate}}
437 | {\end@float}
438 | \newenvironment{plate*}
439 | {\@dblfloat{plate}}
440 | {\end@dblfloat}
441 | \newcommand\listofplates{%
442 | \section*{\listplatename}%
443 | \@mkboth{\MakeUppercase\listplatename}%
444 | {\MakeUppercase\listplatename}%
445 | \@starttoc{lop}%
446 | }
447 | \newcommand*\l@plate{\@dottedtocline{1}{1.5em}{2.3em}}
448 | \newcommand\listplatename{List of Plates}
449 | \newcommand\platename{Plate}
450 | }
451 | { \newcounter{plate}[chapter]
452 | \renewcommand \theplate
453 | {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@plate}
454 | \def\fps@plate{tbp}
455 | \def\ftype@plate{4}
456 | \def\ext@plate{lop}
457 | \def\fnum@plate{\platename\nobreakspace\theplate}
458 | \newenvironment{plate}
459 | {\@float{plate}}
460 | {\end@float}
461 | \newenvironment{plate*}
462 | {\@dblfloat{plate}}
463 | {\end@dblfloat}
464 | \newcommand\listofplates{%
465 | \if@twocolumn
466 | \@restonecoltrue\onecolumn
467 | \else
468 | \@restonecolfalse
469 | \fi
470 | \chapter*{\listplatename}%
471 | \@mkboth{\MakeUppercase\listplatename}%
472 | {\MakeUppercase\listplatename}%
473 | \@starttoc{lop}%
474 | \if@restonecol\twocolumn\fi
475 | }
476 | \newcommand*\l@plate{\@dottedtocline{1}{1.5em}{2.3em}}
477 | \newcommand\listplatename{List of Plates}
478 | \newcommand\platename{Plate}
479 | }
480 | %
481 | % All of my stuff for keeping track of lectures
482 | \makeatletter
483 | \def\sektion{\@ifnextchar[{\@with}{\@without}}
484 | \def\@with[#1]#2{\cleardoublepage \section[#1]{#2} \gdef\sectitle{#1}
485 | \setcounter{footnote}{0}}
486 | \def\@without#1{\cleardoublepage \section{#1} \gdef\sectitle{#1}
487 | \setcounter{footnote}{0}}
488 | \makeatother
489 |
490 | \newcommand{\sektionu}[1]{\cleardoublepage \section*{#1} \gdef\sectitle{#1}
491 | \addcontentsline{toc}{section}{#1}
492 | \setcounter{footnote}{0}}
493 | \newcommand{\subsektion}[1]{\subsection*{#1}
494 | \addcontentsline{toc}{subsection}{#1}}
495 | \newcommand{\subsekktion}[2]{\subsection*{#2}
496 | \addcontentsline{toc}{subsection}{#1}}
497 | \newcommand\sectitle{} % This is the empty section title, before any section title is set
498 | \setcounter{lecture}{0}
499 | %
500 | \renewcommand{\thelecture}{\arabic{lecture}}
501 | \renewcommand{\theequation}{\thelecture.\arabic{equation}}
502 | %
503 | % Make the equation counter reset each lecture
504 | \makeatletter
505 | \@addtoreset{equation}{lecture}
506 | \makeatother
507 | %
508 | % drangreport gets all upset if I don't put this right at the end
509 | %
510 | \RequirePackage[color,all]{xy} % Include XY-pic
511 | \SelectTips{cm}{10} % Use the nicer arrowheads
512 | \everyxy={<2.5em,0em>:} % Sets the scale I like
513 | \xyoption{web} % Include the lattice feature, I don't know why it isn't loaded already
514 | %
515 |
516 | %
517 | % \RequirePackage{pgf,tikz}
518 | % \usetikzlibrary{arrows,
519 | % automata,
520 | % positioning,
521 | % decorations.markings,
522 | % shapes.arrows,
523 | % patterns,
524 | % decorations.pathmorphing,
525 | % calc}
526 | % \tikzset{
527 | % state/.style={
528 | % rectangle,
529 | % rounded corners,
530 | % draw=black, very thick,
531 | % minimum height=2em,
532 | % inner sep=2pt,
533 | % text centered,
534 | % },
535 | % }
536 |
537 | \newcommand{\shortskip}{\setlength{\parskip}{2pt}}
--------------------------------------------------------------------------------