Debian Codegraph @

texmf-dist/doc/latex/quickderivs/quickderivs-doc.tex

raw
1 % quickderivs-doc.tex
2 %
3 % Copyright (C) 2026 James Petersen <[email protected]>
4 % Licensed under MIT. See LICENSE.
5 \documentclass{article}
6 \usepackage[utf8]{inputenc}
7
8 \usepackage[upright]{quickderivs}
9 \dvsetnormal
10 \usepackage[margin=1.5in]{geometry}
11 \usepackage{verbatim}
12
13 \title{Derivatives using the {\tt quickderivs} package}
14 \author{James Petersen}
15 \date{March 2026}
16
17 \begin{document}
18
19 \maketitle
20
21 This package contains commands to typeset mathematical derivatives more
22 efficiently.
23
24 \section{Options}
25 \begin{itemize}
26 \item \verb|upright|: enables support for upright derivative symbols,
27 such as
28 \makeatletter\(\quickderivs@unslant{\partial}\)\makeatother,
29 as compared to \(\partial\). These can be toggled
30 using the \verb|\dvsetupright| and \verb|\dvsetnormal| commands.
31 If \verb|upright| is passed, then the style is set
32 to upright by default.
33
34 \item \verb|partial|: the \verb|\dv| and \verb|\df| commands now
35 default partial derivative symbols. The last star argument
36 now switches to normal derivative symbols.
37 \end{itemize}
38
39 \section{Commands}
40 \begin{itemize}
41 \item \verb|\dv[*][|\(\langle\)\textit{upper value}\(\rangle\)%
42 \verb|][|\(\langle\)\textit{upper power}\(\rangle\)\verb|]{|%
43 \(\langle\)\textit{lower variable(s)}\(\rangle\)\verb|}[|%
44 \(\langle\)\textit{differential symbol}\(\rangle\)\verb|][*]|
45
46 This is the main command of the package. It typesets derivatives in general.
47 The only mandatory parameter is the lower variables. With a single
48 variable, it typesets a normal derivative: \verb|\dv{x}| becomes
49 \[
50 \dv x.
51 \]
52
53 The differential symbol parameter changes the differential symbol,
54 with the following supported parameters:
55 \verb|d D e E p|. They produce the following outputs.
56 \begin{center}
57 \begin{tabular}{cccccc}
58 &\verb|d|&\verb|D|&\verb|e|&\verb|E|&\verb|p|\\[1em]
59 \dvsetupright
60 upright
61 &\(\displaystyle\dv x[d]\)
62 &\(\displaystyle\dv x[D]\)
63 &\(\displaystyle\dv x[e]\)
64 &\(\displaystyle\dv x[E]\)
65 &\(\displaystyle\dv x[p]\)\\[2em]
66 normal
67 \dvsetnormal
68 &\(\displaystyle\dv x[d]\)
69 &\(\displaystyle\dv x[D]\)
70 &\(\displaystyle\dv x[e]\)
71 &\(\displaystyle\dv x[E]\)
72 &\(\displaystyle\dv x[p]\)
73 \end{tabular}
74 \end{center}
75 Additional symbol can be added by defining the command
76 \verb|\quickderivs@chrs@|\(\langle\)\textit{new char}\(\rangle\)
77 to the desired symbol and
78 \verb|\quickderivs@chrsspac@|\(\langle\)\textit{new char}\(\rangle\)
79 to the spacing this character should have between it and a superscript.
80
81 The last star parameter toggles between regular and partial derivatives.
82 It takes priority over the differential symbol parameter.
83 Setting the \verb|partial| parameter of the package makes
84 derivatives default to partial derivatives, and switch to regular
85 derivatives with the star.
86
87 The lower variable(s) parameter can take many variables in a row,
88 delimited by commas: \verb|\dv{x,y}*| becomes
89 \[
90 \dv{x,y}*.
91 \]
92 Simply specifying a number will make that the power of the preceding
93 variable: \verb|\dv{x2}| becomes
94 \[
95 \dv{x2}.
96 \]
97 Numbers can be used as separators between multiple variables as well:
98 \verb|\dv{x2y3}*| becomes
99 \[
100 \dv{x2y3}*.
101 \]
102 To instead have the number as a part of the derivative, or any
103 other complex command, enclose it in square brackets:
104 \verb|\dv{{(2x)},{\bar{y}}}*| becomes
105 \[
106 \dv{{(2x)},{\bar y}}*.
107 \]
108 To specify a nonstandard superscript, use a semicolon:
109 \verb|\dv{x;r,y;s}*| becomes
110 \[
111 \dv{x;r,y;s}*.
112 \]
113
114 The upper value is self-explanatory: \verb|\dv[f]{x}| becomes
115 \[
116 \dv[f]x.
117 \]
118 The upper power is also simple. Expanding on an earlier example,
119 \verb|\dv[][r+s]{x;r,y;s}*| becomes
120 \[
121 \dv[][r+s]{x;r,y;s}*.
122 \]
123 Finally, the first star writes the fractions inline:
124 \verb|\dv*[f]{x}| becomes \(\dv*[f]x\).
125
126 \item \verb|\df[*]{|\(\langle\)\textit{lower variable(s)}\(\rangle\)%
127 \verb|}[|\(\langle\)\textit{differential symbol}\verb|][*]|
128
129 The latter three parameters are identical to those in the \verb|\dv|
130 command. The first star controls the spacing between the differentials:
131
132 \begin{center}
133 \begin{tabular}{cc}
134 with star&without star\\
135 \df{x,y,z}&\df*{x,y,z}
136 \end{tabular}
137 \end{center}
138
139 \item \verb|\dvsetupright| and \verb|\dvsetnormal|
140
141 These commands switch between upright and normal characters for the package.
142 \verb|\dvsetupright| is only defined if the \verb|upright| parameter
143 is supplied to the package.
144 \end{itemize}
145
146 \end{document}