File: dsdshorthand.sty

package info (click to toggle)
sdpb 1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,580 kB
  • sloc: cpp: 12,762; makefile: 74; xml: 44; sh: 20
file content (250 lines) | stat: -rw-r--r-- 8,350 bytes parent folder | download | duplicates (2)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
%%
%%  `dsdshorthand.sty' -- Macros for everyday use, generally to improve
%%  code readability with a consistent shorthand.  Macro names are
%%  usually based more on the appearance of the symbol rather than the
%%  meaning (e.g. \Z for \mathbb{Z}, instead of \Integers, or \cA for
%%  \mathcal{A}).  Choices are geared towards mathematical physics,
%%  sort of.
%%
%%  David Simmons-Duffin <davidsd@gmail.com>
%%  Last modified May 17, 2006
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{dsdshorthand}[2006/05/17 David Simmons-Duffin's macros]
\RequirePackage{amsmath, amssymb, amsthm}
\RequirePackage{ifthen}  % LaTeX logic

%%%%%%% Not Required, but Oft-Used Packages %%%%%%%
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{ifthen}
\usepackage{graphicx}   % \includegraphics
\usepackage{epstopdf}   % allow inclusion of eps files
\usepackage{bm}         % access to bold math fonts, via \bm
\usepackage{xspace}     % \xspace puts space where needed
\usepackage{mathrsfs}   % fancy script: \mathscr

\DeclareGraphicsRule{*}{mps}{*}{}  % not sure what this does, but it's
                                % necessary to make feynmp work correctly

%%%%%%% Argument-taking Macros, Size Control %%%%%%%
\newcommand   \pdr  [2] {\frac{\partial #1}{\partial #2}}
\newcommand   \pddr [3] {
  \ifthenelse{\equal{#3}{}}
    { \frac{\partial^2 #1}{\partial #2^2}           }
    { \frac{\partial^2 #1}{\partial #2 \partial #3} }
}
\newcommand   \rdr  [2] {\frac{d #1}{d #2}}
\newcommand   \rddr [3] {
  \ifthenelse{\equal{#3}{}}
    { \frac{d^2 #1}{d #2^2}    }
    { \frac{d^2 #1}{d #2 d #3} }
}

\newcommand   \lr  [3] {\left #1 #2 \right #3}
\newcommand   \p   [1] {\lr({#1})}
\newcommand   \tl  [1] {\widetilde{#1}}
\renewcommand \bar [1] {\overline{#1}}
%\let \smallbar = \bar
%\let \bar      = \overline
%\let \smallhat = \hat
%\let \hat      = \widehat

%%%%%%% Notation Shortcuts %%%%%%%
\newcommand   \<   {\langle}
\renewcommand \>   {\rangle}
\newcommand   \bra [1] {\< #1 |}
\newcommand   \ket [1] {| #1 \>}
\renewcommand \.   {\cdot}
\newcommand   \inv {^{-1}}
\newcommand   \x   {\times}
\newcommand   \we  {\wedge}
\newcommand   \oo  {\infty}
\newcommand   \aeq {\thickapprox}
\newcommand   \ptl {\partial}
\newcommand   \grad {\nabla}
\newcommand   \mto {\mapsto}
\newcommand   \hc  {\mathrm{h.c.}}
\newcommand   \half{\frac 1 2}
\newcommand   \Id  {\mathbf{1}}
\newcommand   \Dslash {\!\not\!\! D}
\newcommand   \dslash {\!\not\! \ptl}
\newcommand   \pslash {\!\not\! p}
\newcommand   \qslash {\!\not\! q}
\newcommand   \kslash {\!\not\! k}

%%%%%%% Greek %%%%%%%
\renewcommand \a  {\alpha}
\renewcommand \b  {\beta}
\newcommand   \g  {\gamma}
\newcommand   \G  {\Gamma}
\newcommand   \de {\delta}
\newcommand   \De {\Delta}
\newcommand   \e  {\epsilon}
\renewcommand \l  {\lambda}
\renewcommand \L  {\Lambda}
\renewcommand \r  {\rho}
\newcommand   \f  {\phi}
\newcommand   \vf {\varphi}
\newcommand   \s  {\sigma}
\newcommand   \w  {\omega}
\renewcommand \O  {\Omega}
\renewcommand \th {\theta}
\newcommand   \ka {\kappa}
\newcommand   \z  {\zeta}

%%%%%%% Spaces and Fields %%%%%%%
\newcommand   \R  {\mathbb{R}}
\newcommand   \Z  {\mathbb{Z}}
\newcommand   \N  {\mathbb{N}}
\newcommand   \C  {\mathbb{C}}
\newcommand   \Q  {\mathbb{Q}}
\newcommand   \Qp {\mathbb{Q}_p}
\renewcommand \P  {\mathbb{P}}
\newcommand   \A  {\mathbb{A}}

%%%%%%% Multi-letter Functors/Functions %%%%%%%
% how many of these should be mathops?
\newcommand   \SU    {\mathrm{SU}}
\newcommand   \SO    {\mathrm{SO}}
\newcommand   \GL    {\mathrm{GL}}
\newcommand   \SL    {\mathrm{SL}}
\newcommand   \PSL   {\mathrm{PSL}}
\newcommand   \PGL   {\mathrm{PGL}}
\newcommand   \Sp    {\mathrm{Sp}}
\newcommand   \Span  {\mathrm{Span}}
\newcommand   \Aut   {\mathrm{Aut}}
\newcommand   \Res   {\mathop{\mathrm{Res}}}
\renewcommand \Re    {\mathop{\mathrm{Re}}}
\renewcommand \Im    {\mathop{\mathrm{Im}}}
\newcommand   \Tr    {\mathrm{Tr}}
\newcommand   \Pf    {\mathrm{Pf}}
\newcommand   \Ker   {\mathop{\mathrm{Ker}}}
\newcommand   \Coker {\mathop{\mathrm{Coker}}}
\newcommand   \Hom   {\mathrm{Hom}}
\newcommand   \Mor   {\mathrm{Mor}}
\newcommand   \Gal   {\mathrm{Gal}}
\newcommand   \Sym   {\mathrm{Sym}}
\newcommand   \codim {\mathop{\mathrm{codim}}}
\newcommand   \ind   {\mathop{\mathrm{ind}}}

%%%%%%% Single-letter Shortcuts %%%%%%%
%% note: I've defined bold and caligraphed shortcuts only for the
%% letters I used most often.  This is not the whole alphabet (and nor
%% can it be -- consider, e.g., {\bf...})

%%%%%%% Bold Letters %%%%%%%
%% lowercase
\newcommand   \ba {\mathbf{a}}
\newcommand   \bi {\mathbf{i}}
\newcommand   \bj {\mathbf{j}}
\newcommand   \bk {\mathbf{k}}
\newcommand   \bl {\mathbf{l}}
\newcommand   \bn {\mathbf{n}}
\newcommand   \bp {\mathbf{p}}
\newcommand   \bq {\mathbf{q}}
\newcommand   \br {\mathbf{r}}
\newcommand   \bs {\mathbf{s}}
\newcommand   \bt {\mathbf{t}}
\newcommand   \bu {\mathbf{u}}
\newcommand   \bv {\mathbf{v}}
\newcommand   \bw {\mathbf{w}}
\newcommand   \bx {\mathbf{x}}
\newcommand   \by {\mathbf{y}}
\newcommand   \bz {\mathbf{z}}
%% Uppercase
\newcommand   \bA {\mathbf{A}}
\newcommand   \bB {\mathbf{B}}
\newcommand   \bE {\mathbf{E}}
\newcommand   \bF {\mathbf{F}}
\newcommand   \bG {\mathbf{G}}
\newcommand   \bH {\mathbf{H}}
\newcommand   \bI {\mathbf{I}}
\newcommand   \bJ {\mathbf{J}}
\newcommand   \bK {\mathbf{K}}
\newcommand   \bL {\mathbf{L}}
\newcommand   \bP {\mathbf{P}}
\newcommand   \bQ {\mathbf{Q}}
\newcommand   \bR {\mathbf{R}}
\newcommand   \bS {\mathbf{S}}

%%%%%%% Caligraphic Letters %%%%%%%
\newcommand   \cA {\mathcal{A}}
\newcommand   \cB {\mathcal{B}}
\newcommand   \cC {\mathcal{C}}
\newcommand   \cD {\mathcal{D}}
\newcommand   \cE {\mathcal{E}}
\newcommand   \cF {\mathcal{F}}
\newcommand   \cG {\mathcal{G}}
\newcommand   \cH {\mathcal{H}}
\newcommand   \cL {\mathcal{L}}
\newcommand   \cM {\mathcal{M}}
\newcommand   \cO {\mathcal{O}}
\newcommand   \cP {\mathcal{P}}
\newcommand   \cT {\mathcal{T}}
\newcommand   \cZ {\mathcal{Z}}

%%%%%%% Unit Vectors %%%%%%%
\newcommand   \xhat {\hat{\bx}}
\newcommand   \yhat {\hat{\by}}
\newcommand   \zhat {\hat{\bz}}
\newcommand   \rhat {\hat{\br}}
\newcommand   \nhat {\hat{\bn}} 

%%%%%%% General Environment Shortcuts %%%%%%%
%\newcommand   \be     {\begin{align*}} % These are broken -- macros
%\newcommand   \ee     {\end  {align*}} % for \end{..} don't work in align
%\newcommand   \ben    {\begin{align}}
%\newcommand   \een    {\end  {align}}
\newcommand   \be     {\begin{eqnarray*}} % these should be replaced
\newcommand   \ee     {\end  {eqnarray*}} % by align, but can't be...
\newcommand   \ben    {\begin{eqnarray}}
\newcommand   \een    {\end  {eqnarray}}
\newcommand   \bitem  {\begin{itemize}}
\newcommand   \eitem  {\end  {itemize}}
\newcommand   \benum  {\begin{enumerate}}
\newcommand   \eenum  {\end  {enumerate}}


%%%%%%%% Theorem Types %%%%%%%%
% last arg means number by sections (e.g. Theorem 2.3)
\newtheorem  {theorem} {Theorem} [section]
% the second arg means share the same counter with 'theorem'
\newtheorem  {lemma}       [theorem] {Lemma}
\newtheorem  {corollary}   [theorem] {Corollary}
\newtheorem  {proposition} [theorem] {Proposition}
% individually counted, for use in problem sets
\newtheorem  {lemma*} {Lemma}

% not numbered
\newtheorem* {definition} {Definition}
\newtheorem* {claim}      {Claim}
\newtheorem* {remark}     {Remark}

%%%%%%% Theorem Environment Shortcuts %%%%%%%
\newcommand   \blem    {\begin{lemma}}
\newcommand   \elem    {\end  {lemma}}
\newcommand   \bpf     {\begin{proof}}
\newcommand   \epf     {\end  {proof}}
\newcommand   \bprop   {\begin{proposition}}
\newcommand   \eprop   {\end  {proposition}}
\newcommand   \bthm    {\begin{theorem}}
\newcommand   \ethm    {\end  {theorem}}
\newcommand   \bedef   {\begin{definition}}
\newcommand   \stopdef {\end  {definition}}
\newcommand   \bclaim  {\begin{claim}}
\newcommand   \eclaim  {\end  {claim}}
\newcommand   \bcor    {\begin{corollary}}
\newcommand   \ecor    {\end  {corollary}}
\newcommand   \brmk    {\begin{remark}}
\newcommand   \ermk    {\end  {remark}}

%%%%%%%%% new maketitle for problem sets %%%%%%%%%%%%
\newcommand \makepsettitle {
  \begin{center}
    {\sc \@title } \\
    \@date
  \end{center}
  \markright{ {\rm \@author} } % should probably be shipped out of this macro
}