Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \DeclareDocumentCommand\partialderivative{ s o m g g d() }
- { % Partial derivative
- % s: star for \flatfrac flat derivative
- % o: optional n for nth derivative
- % m: mandatory (x in df/dx)
- % g: optional (f in df/dx)
- % g: optional (y in d^2f/dxdy)
- % d: long-form d/dx(...)
- \IfBooleanTF{#1}
- {\let\fractype\flatfrac}
- {\let\fractype\frac}
- \IfNoValueTF{#4}
- {
- \IfNoValueTF{#6}
- {\fractype{\partial \IfNoValueTF{#2}{}{^{#2}}}{\partial #3\IfNoValueTF{#2}{}{^{#2}}}}
- {\fractype{\partial \IfNoValueTF{#2}{}{^{#2}}}{\partial #3\IfNoValueTF{#2}{}{^{#2}}} \argopen(#6\argclose)}
- }
- {
- \IfNoValueTF{#5}
- {
- \fractype{\partial \IfNoValueTF{#2}{}{^{#2}} #3}{\partial #4\IfNoValueTF{#2}{}{^{#2}}}
- \IfValueT{#6}{\argopen(#6\argclose)}
- }
- {
- \fractype{\partial^2 #3}{\partial #4 \partial #5}
- \IfValueT{#6}{\argopen(#6\argclose)}
- }
- }
- }
- \DeclareDocumentCommand\pderivative{}{\partialderivative} % Shorthand for \partialderivative
- \DeclareDocumentCommand\pdv{}{\partialderivative} % Shorthand for \partialderivative
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement