Skip to content

Conversation

eagleoflqj
Copy link
Member

References to other Issues or PRs

Closes #23226
Similar to #15936, so maybe @oscargus could review it.

Brief description of what is fixed or changed

Allow passing diff_operator to latex printer. The default behavior (italic d) is not changed. Shortcuts 'rd' and 'td' are added for convenience.

Other comments

Release Notes

  • printing
    • Allow to configure differential operator in latex printer. Default is "d".

@sympy-bot
Copy link

sympy-bot commented Mar 14, 2022

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

Your release notes are in good order.

Here is what the release notes will look like:

  • printing
    • Allow to configure differential operator in latex printer. Default is "d". (#23239 by @eagleoflqj)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.11.

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

Closes #23226 
Similar to #15936, so maybe @oscargus could review it.
#### Brief description of what is fixed or changed

Allow passing `diff_operator` to latex printer. The default behavior (italic d) is not changed. Shortcuts `'rd'` and `'td'` are added for convenience.

#### Other comments

#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* printing
  * Allow to configure differential operator in latex printer. Default is "d".
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@github-actions
Copy link

github-actions bot commented Mar 14, 2022

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [907895ac]       [ebda8eb8]
-         243±1ms          150±2ms     0.61  large_exprs.TimeLargeExpressionOperations.time_subs
-       257±0.9μs          121±2μs     0.47  matrices.TimeMatrixExpression.time_MatMul
-     16.2±0.03ms       8.57±0.3ms     0.53  matrices.TimeMatrixExpression.time_MatMul_doit
-      4.84±0.01s          355±4ms     0.07  polygon.PolygonArbitraryPoint.time_bench01
+     3.78±0.02ms      6.47±0.07ms     1.71  solve.TimeMatrixOperations.time_det(4, 2)
+     3.84±0.04ms       6.60±0.1ms     1.72  solve.TimeMatrixOperations.time_det_bareiss(4, 2)
+      43.4±0.2ms       75.2±0.8ms     1.73  solve.TimeMatrixSolvePyDySlow.time_linsolve(1)
+      44.0±0.3ms       77.0±0.9ms     1.75  solve.TimeMatrixSolvePyDySlow.time_solve(1)

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).


# Only up to \iiiint exists
if len(expr.limits) <= 4 and all(len(lim) == 1 for lim in expr.limits):
# Use len(expr.limits)-1 so that syntax highlighters don't think
# \" is an escaped quote
tex = r"\i" + "i"*(len(expr.limits) - 1) + "nt"
symbols = [r"\, d%s" % self._print(symbol[0])
symbols = [r"\, %s%s" % (diff_symbol, self._print(symbol[0]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good that you also considered Integral.

@eagleoflqj eagleoflqj force-pushed the latex_diff_operator branch from e499990 to d7ed287 Compare March 15, 2022 02:11
@oscargus
Copy link
Contributor

Looks good! Thanks!

@oscargus oscargus merged commit 0ea93e2 into sympy:master Mar 15, 2022
@eagleoflqj eagleoflqj deleted the latex_diff_operator branch March 15, 2022 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Differential operator in latex printer
3 participants