-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add commonly used physics macros #3700
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -961,6 +961,29 @@ defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"); | |
// actuarialangle.dtx | ||
defineMacro("\\angln", "{\\angl n}"); | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// physics.sty | ||
|
||
// This package contains some macros widely useful in physics. | ||
// https://ctan.math.washington.edu/tex-archive/macros/latex/contrib/physics/physics.pdf | ||
|
||
defineMacro("\\abs", "\\lvert{#1}\\rvert"); | ||
defineMacro("\\Abs", "\\Big\\lvert{#1}\\Big\\rvert"); | ||
defineMacro("\\norm", "\\lVert{#1}\\rVert"); | ||
defineMacro("\\Norm", "\\Big\\lVert{#1}\\Big\\rVert"); | ||
defineMacro("\\eval", "\\Big\\vert_{#1}^{#2}"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this matches |
||
defineMacro("\\vb", "\\bold{#1}"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
defineMacro("\\vectorbold", "\\vb{#1}"); | ||
defineMacro("\\vectorarrow", "\\overrightarrow{\\vb{#1}}"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
defineMacro("\\vectorunit", "\\widehat{\\vb{#1}}"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
defineMacro("\\dotproduct", "\\cdot"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
defineMacro("\\crossproduct", "\\times"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
defineMacro("\\dd", "\\textnormal{d}"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a comment that this does not support the optional power argument. |
||
defineMacro("\\gradient", "\\mathinner{\\nabla{#1}}"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add the |
||
defineMacro("\\laplacian", "\\mathinner{\\nabla^2{#1}}"); | ||
defineMacro("\\divergence", "\\mathinner{\\nabla\\dotproduct{#1}}"); | ||
defineMacro("\\curl", "\\mathinner{\\nabla\\crossproduct{#1}}"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a comment that this doesn't support the |
||
|
||
// Custom Khan Academy colors, should be moved to an optional package | ||
defineMacro("\\blue", "\\textcolor{##6495ed}{#1}"); | ||
defineMacro("\\orange", "\\textcolor{##ffa500}{#1}"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see
\Abs
or\Norm
inphysics.sty
. Also, it seems that\abs
and\norm
generally use\left
and\right
, with the ability to customize size via a second argument as in\abs\Big
. I could see skipping the latter feature in a first version, but I don't think the current definitions match any partial feature fromphysics.sty
.