From: William Trevor King Date: Thu, 6 Aug 2009 13:05:15 +0000 (-0400) Subject: Added my personal commands and formatting. X-Git-Url: http://git.tremily.us/?p=problempack.git;a=commitdiff_plain;h=b0bdb220fe881f30d0da51c712ac0a6c9720e7ba Added my personal commands and formatting. --- diff --git a/wtk_cmmds.sty b/wtk_cmmds.sty new file mode 100644 index 0000000..3b741c1 --- /dev/null +++ b/wtk_cmmds.sty @@ -0,0 +1,75 @@ +\RequirePackage{relsize} % for \smaller +\RequirePackage{amsmath} % for \text{} + +% Author, Copyright junk +\newcommand{\copytitle}{ + \begin{center} + Copyright \copyright\ \today\ by W.\ Trevor King\\ + \smaller{This document is distributed under the GNU Free Documentation License.} + \end{center} +} + +% define theorem environments +\newtheorem{thm}{Theorem} +\newtheorem{cor}[thm]{Corollary} +\newtheorem{lem}{Lemma} + +\newcommand{\U}[1]{\text{ #1}} % units shortcut +\newcommand{\E}[1]{\ensuremath{\cdot 10 ^{#1}}} % exponent shortcut +\newcommand{\dg}{\ensuremath{^{\circ}}} % degree symbol ^o +\newcommand{\vect}[1]{\ensuremath{\mathbf{#1}}} % make vectors bold + +\newcommand{\Ohm}{\ensuremath{\Omega}} % units of resistance +\newcommand{\EMF}{\ensuremath{\mathcal{E}}} % electro-motive force + +\newcommand{\ihat}{\vect{\hat{i}}} +\newcommand{\jhat}{\vect{\hat{j}}} +\newcommand{\khat}{\vect{\hat{k}}} +\newcommand{\rhat}{\vect{\hat{r}}} + +\newcommand{\avg}[1]{\ensuremath{\left\langle {#1} \right\rangle}} % average +\newcommand{\dt}[1]{\ensuremath{\dot{#1}}} % first deriv with respect to time +\newcommand{\ddt}[1]{\ensuremath{\ddot{#1}}} % 2nd deriv with respect to time +% the proper d to be used in derivatives and integrals +\newcommand{\dd}{\ensuremath{\mathrm d}} +% derivative of #2 with respect to #1 +\newcommand{\deriv}[2]{\ensuremath{\frac{\dd{#2}}{\dd{#1}}}} +% #1th order derivative of #3 with respect to #2 +\newcommand{\nderiv}[3]{\ensuremath{\frac{\dd^{#1}{#3}}{\dd{#2}^{#1}}}} +% partial derivative of #2 with respect to #1 +\newcommand{\pderiv}[2]{\ensuremath{\frac{\partial#2}{\partial#1}}} +% #1th order partial derivative of #3 with respect to #2 +\newcommand{\npderiv}[3]{\ensuremath{\frac{\partial^{#1}{#3}}{\partial{#2}^{#1}}}} + +% parenthesis, for example (some stuff] would be \p({some stuff}] +\newcommand{\p}[3]{\left#1 #2 \right#3} + +% parts for multi-part problems and solutions (use problempack.sty instead) +%\newcommand{\Part}[1]{\textcolor{Red}{(#1)}} +% highlight answers in solutions +%\newcommand{\ans}[1]{\textcolor{Red}{#1}} + +% struts for table spacing +\newcommand{\Tstrut}{\rule{0pt}{2.6ex}} +\newcommand{\Bstrut}{\rule[-1.2ex]{0pt}{0pt}} + +% \numberwithin{equation}{section}% number equations by section +% \setcounter{secnumdepth}{0} % turn off section numbering below this level + + +% tighter lists, a la alvin alexander +% http://www.devdaily.com/blog/post/latex/control-line-spacing-in-itemize-enumerate-tags/ + +\newenvironment{packed_enum}{ +\begin{enumerate} + \setlength{\itemsep}{1pt} + \setlength{\parskip}{0pt} + \setlength{\parsep}{0pt} +}{\end{enumerate}} + +\newenvironment{packed_item}{ +\begin{itemize} + \setlength{\itemsep}{1pt} + \setlength{\parskip}{0pt} + \setlength{\parsep}{0pt} +}{\end{itemize}} diff --git a/wtk_format.sty b/wtk_format.sty new file mode 100644 index 0000000..62d1746 --- /dev/null +++ b/wtk_format.sty @@ -0,0 +1,8 @@ +% general layout for the document + +\topmargin -0.5in +\headheight 0.0in +\headsep 0.0in +\textheight 9.5in % leave a bit of extra room for page numbers +\oddsidemargin -0.5in +\textwidth 7.5in