Skip to content

Fix Lark LaTeX derivative fraction parsing - #30503

Open
krishjangra wants to merge 2 commits into
sympy:masterfrom
krishjangra:fix-lark-frac-derivative
Open

krishjangra wants to merge 2 commits into
sympy:masterfrom
krishjangra:fix-lark-frac-derivative

Conversation

@krishjangra

@krishjangra krishjangra commented Sep 13, 2026

Copy link
Copy Markdown

References to other Issues or PRs

Fixes part of #30486.

Brief description of what is fixed or changed

The Lark LaTeX parser returned a raw tuple for derivative fractions such as \frac{dy}{dx}. This changes the transformer to return a SymPy Derivative(y, x) instead.

Added regression tests for \frac{dy}{dx} and \frac{d y}{d x}.

Other comments

Tested with:

python -m pytest sympy/parsing/tests/test_latex_lark.py -k differential_fraction_derivative

Result: 1 passed.

Release Notes

NO ENTRY

@sympy-bot

sympy-bot commented Sep 13, 2026

Copy link
Copy Markdown

Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

  • No release notes entry will be added for this pull request.
Click here to see the pull request description that was parsed.
#### References to other Issues or PRs

Fixes part of #30486.

#### Brief description of what is fixed or changed

The Lark LaTeX parser returned a raw tuple for derivative fractions such as `\frac{dy}{dx}`. This changes the transformer to return a SymPy `Derivative(y, x)` instead.

Added regression tests for `\frac{dy}{dx}` and `\frac{d y}{d x}`.

#### Other comments

Tested with:

```bash
python -m pytest sympy/parsing/tests/test_latex_lark.py -k differential_fraction_derivative
```
Result: `1 passed`.

#### Release Notes
<!-- BEGIN RELEASE NOTES -->
NO ENTRY
<!-- END RELEASE NOTES -->

@krishjangra
krishjangra force-pushed the fix-lark-frac-derivative branch from 6403787 to d6f383c Compare September 16, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants