-
Notifications
You must be signed in to change notification settings - Fork 0
/
commandes.sty
116 lines (89 loc) · 4.26 KB
/
commandes.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%% Commandes personnalisées %%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{commandes}[2015/05/04]
%Dérivées
\newcommand{\dd}{\, \mathrm{d}}
\newcommand{\ddv}[1]{\, \mathrm{d} \vec{#1}}
\newcommand{\derivee}[2]{\frac{\mathrm{d} #1}{\mathrm{d} #2}}
\newcommand{\deriveeb}[1]{\frac{\mathrm{d}}{\mathrm{d} #1}}
\newcommand{\deriveen}[3]{\frac{\mathrm{d}^{#3} #1}{\mathrm{d} {#2}^{#3}}}
\newcommand{\dpartielle}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\dpartiellen}[3]{\frac{\partial^{#3} #1}{\partial {#2}^{#3}}}
\newcommand{\rot}[1]{\nabla \times \vec{#1}}
\newcommand{\diver}[1]{\nabla \cdot \mathbf{#1}}
\newcommand{\lapl}[1]{\nabla^2 {#1}}
\newcommand{\grad}[1]{\nabla #1}
%Intégrales
\newcommand{\intg}[2]{\int #1 \dd #2}
\newcommand{\intgd}[4]{\int_{#3}^{#4} #1 \dd #2}
\newcommand{\intsuro}[1]{\varoiint_S \vec{#1} \cdot \dd \vec{S}}
\newcommand{\intsur}[2]{\iint_{S #2} \vec{#1} \cdot \dd \vec{S}_{#2}}
%Caractères
\newcommand{\cte}{\mathrm{cte}}
\newcommand{\petito}[1]{\ensuremath{\mathrm{o}\left( #1 \right)}}
\newcommand{\epz}{{\varepsilon}_0}
\newcommand{\CQFD}{\quad_\square}
%Parenthèses
\newcommand{\p}[1]{\left( #1 \right)}
\newcommand{\pc}[1]{\left[ #1 \right]}
\newcommand{\pa}[1]{\{ #1 \}}
\newcommand{\lpt}{\left( }
\newcommand{\rpt}{\right) }
\newcommand{\nor}[1]{\left| #1 \right| }
%Mécanique quantique
\newcommand{\moy}[1]{\langle #1 \rangle}
\newcommand{\ket}[1]{|#1 \rangle}
\newcommand{\bra}[1]{\langle #1 |}
\newcommand{\ketbra}[2]{\ket{#1}\bra{#2}}
\newcommand{\braket}[2]{\langle #1 | #2 \rangle}
\newcommand{\commut}[2]{\left[ #1 \, , #2 \right]}
\newcommand{\tracep}[2]{\mathrm{Tr}_{#1} \left\{ #2 \right\} }
\newcommand{\trace}[1]{\ensuremath{\mathrm{Tr} \left\{#1 \right\}}}
\newcommand{\identity}{\ensuremath{\mathbb{1}}}
%Vecteurs
\newcommand{\hi}{\hat{\imath}}
\newcommand{\hj}{\hat{\jmath}}
\newcommand{\hk}{\hat{k}}
\newcommand{\vunit}[1]{\mathbf{\hat{#1}}}
\newcommand{\vbf}[1]{\mathbf{#1}}
\newcommand{\scal}[2]{\mathbf{#1} \cdot \mathbf{#2}}
%Marqueurs de relation
\newcommand{\donc}{\quad \text{donc} \quad}
\newcommand{\et}{\qquad \text{et} \qquad}
\newcommand{\si}{\text{si}\quad}
\newcommand{\andm}{\qquad \text{and} \qquad}
%Autres
\newcommand{\oldexp}[1]{\mathrm{exp} {#1}}
\newcommand{\e}[1]{\, \mathrm{e}^{#1}}
\newcommand{\eval}[2]{\bigg|_{#1}^{#2}}
\newcommand{\dix}[1]{\, \times 10^{#1}}
\newcommand{\E}[1]{\,\times 10^{#1}}
\newcommand{\es}{\nonumber \\}
% Calcul d'incertitude
\newcommand{\incertitudeII}[3]{\lpt \dpartielle{#1}{#2} \cdot \Delta #2 \rpt^2 + \lpt \dpartielle{#1}{#3} \cdot \Delta #3 \rpt^2}
\newcommand{\incertitudeIII}[4]{\lpt \dpartielle{#1}{#2} \cdot \Delta #2 \rpt^2 + \lpt \dpartielle{#1}{#3} \cdot \Delta #3 \rpt^2 + \lpt \dpartielle{#1}{#4} \cdot \Delta #4 \rpt^2}
\newcommand{\incertitudeIV}[5]{\lpt \dpartielle{#1}{#2} \cdot \Delta #2 \rpt^2 + \lpt \dpartielle{#1}{#3} \cdot \Delta #3 \rpt^2 + \lpt \dpartielle{#1}{#4} \cdot \Delta #4 \rpt^2 + \lpt \dpartielle{#1}{#5} \cdot \Delta #5 \rpt^2}
% Exposants et indices en mode texte
\newcommand{\tsub}[1]{\textsubscript{#1}}
\newcommand{\tsup}[1]{\textsuperscript{#1}}
% Références textuelles
\newcommand{\figref}[1]{figure~\ref{#1}}
% Permets de définir des commandes ayant un sub/superscript
% qui peuvent recevoirn un autre sub/superscript. e.g. \hadag^2
\makeatletter
\newcommand\newsupcommand[3]{\newcommand#1{#2\sc@sup{#3}}}
\def\sc@sup#1{\def\sc@thesup{#1}\@ifnextchar^{\sc@mergesups}{^{\sc@thesup}}}
\def\sc@mergesups^#1{^{\sc@thesup#1}}
\newcommand\renewsupcommand[3]{\renewcommand#1{#2\sc@sup{#3}}}
\def\sc@sup#1{\def\sc@thesup{#1}\@ifnextchar^{\sc@mergesups}{^{\sc@thesup}}}
\def\sc@mergesups^#1{^{\sc@thesup#1}}
\newcommand\newsubcommand[3]{\newcommand#1{#2\sc@sub{#3}}}
\def\sc@sub#1{\def\sc@thesub{#1}\@ifnextchar_{\sc@mergesubs}{_{\sc@thesub}}}
\def\sc@mergesubs_#1{_{\sc@thesub#1}}
\newcommand\renewsubcommand[3]{\renewcommand#1{#2\sc@sub{#3}}}
\def\sc@sub#1{\def\sc@thesub{#1}\@ifnextchar_{\sc@mergesubs}{_{\sc@thesub}}}
\def\sc@mergesubs_#1{_{\sc@thesub#1}}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%