-
-
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 derivatives, incl. high-order and mixed partial, using macros #3703
base: main
Are you sure you want to change the base?
Conversation
Looking at the failed screenshotter test on Safari (link) it seems like a fleeting issue in the testing infra, not the code:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3703 +/- ##
==========================================
+ Coverage 92.97% 93.04% +0.06%
==========================================
Files 91 92 +1
Lines 6765 6826 +61
Branches 1571 1586 +15
==========================================
+ Hits 6290 6351 +61
Misses 437 437
Partials 38 38
Continue to review full report in Codecov by Sentry.
|
Ping reviewers.. 🙂 |
Ping reviewers..🙂 (2nd week) |
Ping reviewers..🙂 (3rd week) |
Ping reviewers...🙂 (4th week) |
Ping reviewers...🙂 (5th week) |
Ping reviewers... (7th week) |
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.
Sorry for the delay. (And it'd be better to limit the number of pings you do.) I had some time today to do a high-level review, and have a few comments that we should discuss before a more thorough review.
## Derivatives | ||
|
||
The syntax closely emulates popular $LaTeX$ packages that provide derivatives, | ||
such as `physics`, `diffcoef`, and `derivative`. |
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'd rather see this follow one spec. Or perhaps it already does, and this sentence just needs rewording? Fine to link to other packages, but which one should be considered "correct" for this PR? We don't want to implement a brand new derivative behavior. Stated another way, if someone was to copy KaTeX code over to LaTeX, which \usepackage
should they include? (This will also help review this PR; I'd rather not read the documentation of three different packages, though I've already spent some time skimming them all.)
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.
Yes, this follows one spec. Let me reword..
return {func, vars, totalOrders, varOrders}; | ||
} | ||
|
||
const PLACEHOLDER = "\\square"; |
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.
Is this placeholder behavior implemented in any of the existing LaTeX packages? I didn't see it anywhere, but I may have missed it in one of them.
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.
No it's not implemented in any existing LaTeX package. That said, I think it's a useful improvement, so that users won't be puzzled by blankness.
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.
The square is a meaningful operator in many contexts and that might confuse more than it helps. I suppose if someone leaves the [options] blank they should expect that location in fact to be blank.
"\\odv", (context) => assembleDerivativeExpr("\\textnormal{d}", context)); | ||
defineMacro( | ||
"\\pdv", (context) => assembleDerivativeExpr("\\partial", context)); | ||
|
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 think it would make more sense to move these side-effects into src/macros/derivatives.js
, which would then import defineMacro from "./defineMacro"
.
However, we haven't decided to make a src/macros
directory. Perhaps you could provide your input on #2994? What do you think of putting your code in src/functions/derivatives.js
, and possibly renaming functions
to commands
?
I'm very excited to see this implemented, and I can't wait to use that! Is there an estimate on the timeline to release that? |
@visika Hi I lost access to my Linux cloud machine a while ago but I can't get Dorker (needed for tests) working properly on my mac. Would love you -- or anyone else interested -- to take over this PR. 🙂 |
Support ordinary derivatives
\odv
and partial derivatives\pdv
.It supports high-order mixed partial derivatives. The syntax emulates popular$\LaTeX$ packages that provide this sought-after feature.