Created
January 18, 2023 09:22
-
-
Save 34j/0da0808be2d1cea156665722476d51bd to your computer and use it in GitHub Desktop.
physics-materialderivative.sty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \RequirePackage{xparse} | |
| \DeclareDocumentCommand\materialderivative{ s o g d() } | |
| { % Total materialderivative | |
| % s: star for \flatfrac flat materialderivative | |
| % o: optional n for nth materialderivative | |
| % g: optional (f in df/dx) | |
| % d: long-form d/dx(...) | |
| \IfBooleanTF{#1} | |
| {\let\fractype\flatfrac} | |
| {\let\fractype\frac} | |
| \IfNoValueTF{#3} | |
| { | |
| \IfNoValueTF{#4} | |
| {\fractype{\mathrm{D} \IfNoValueTF{#2}{}{^{#2}}}{\mathrm{D} t\IfNoValueTF{#2}{}{^{#2}}}} | |
| {\fractype{\mathrm{D} \IfNoValueTF{#2}{}{^{#2}}}{\mathrm{D} t\IfNoValueTF{#2}{}{^{#2}}} \argopen(#4\argclose)} | |
| } | |
| {\fractype{\mathrm{D} \IfNoValueTF{#2}{}{^{#2}} #3}{\mathrm{D} t\IfNoValueTF{#2}{}{^{#2}}}} | |
| } | |
| \DeclareDocumentCommand\mdv{}{\materialderivative} % Shorthand for \materialderivative |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.