Opened 4 years ago
Closed 3 years ago
#25629 closed enhancement (fixed)
Bad latex translation of output
Reported by:  ghnasser1  Owned by:  

Priority:  minor  Milestone:  sage8.7 
Component:  user interface  Keywords:  latex, beginner 
Cc:  rws, tscrim, alexjbest  Merged in:  
Authors:  Durgesh Agrawal  Reviewers:  Alex J. Best 
Report Upstream:  N/A  Work issues:  
Branch:  97e08e2 (Commits, GitHub, GitLab)  Commit:  97e08e277bfe1fd1b600fce511803073e15e31d5 
Dependencies:  Stopgaps: 
Description
sage 8.3 beta 6.
sage: var('t') sage: anti=integrate(exp(t)*log(1+t),t) sage: anti e^(1)*exp_integral_e(1, t  1) + e^t*log(t + 1) sage: latex(anti) e^{\left(1\right)} exp_integral_e\left(1, t  1\right) + e^{t} \log\left(t + 1\right)
The latex above is not good at all. It renders as (do not know how to inser images here).
Which is not good. May be sage needs to use a \DeclareMathOperator
on exp_integral_e
Change History (17)
comment:1 Changed 4 years ago by
 Type changed from PLEASE CHANGE to enhancement
comment:2 Changed 4 years ago by
 Component changed from PLEASE CHANGE to user interface
 Keywords beginner added
comment:3 Changed 3 years ago by
 Branch set to u/ghdurgeshra/bad_latex_translation_of_output
comment:4 Changed 3 years ago by
 Commit set to cf9ed20c7b4ec3a58a5cd9b9dcdda78c39f062bc
 Status changed from new to needs_review
New commits:
cf9ed20  Add custom _print_latex_ methods to exp_integral

comment:5 Changed 3 years ago by
comment:6 Changed 3 years ago by
 Cc rws added
 Milestone changed from sage8.3 to sage8.6
The patchbot says there are 3 failing doctests:
sage t long src/sage/functions/other.py # 3 doctests failed
Ralf, I was wondering if you could quickly confirm that this is the correct thing to do.
comment:7 Changed 3 years ago by
 Commit changed from cf9ed20c7b4ec3a58a5cd9b9dcdda78c39f062bc to 45483912e352ca9d9855d02a9ec65d8b9942bf0f
Branch pushed to git repo; I updated commit sha1. New commits:
4548391  Fix failing doctests

comment:8 Changed 3 years ago by
@tscrim The doctest failures were due to change in LaTeX translation. I have fixed them and they work fine now. :)
comment:9 Changed 3 years ago by
 Cc tscrim added
comment:10 Changed 3 years ago by
@tscrim @rws Any reviews on the commit, please?
comment:11 followup: ↓ 12 Changed 3 years ago by
Some of these look good, but others seem like the code has been made more complicated and the output worse looking, for example before this patch
sage: latex(sin_integral(x)) \operatorname{Si}\left(x\right)
which renders in latex with roman Si which looks better than without the operatorname
.
comment:12 in reply to: ↑ 11 Changed 3 years ago by
Replying to alexjbest:
Then is it okay if I change the first two classes only (the ones whose LaTeX output is not rendered properly at all without the patch)?
Some of these look good, but others seem like the code has been made more complicated and the output worse looking, for example before this patch
sage: latex(sin_integral(x)) \operatorname{Si}\left(x\right)which renders in latex with roman Si which looks better than without the
operatorname
.
comment:13 Changed 3 years ago by
 Commit changed from 45483912e352ca9d9855d02a9ec65d8b9942bf0f to 97e08e277bfe1fd1b600fce511803073e15e31d5
Branch pushed to git repo; I updated commit sha1. New commits:
97e08e2  Revert back the previous latex output in some classes

comment:14 Changed 3 years ago by
 Cc alexjbest added
@alexjbest Now, the present diff improves the latex output of exp_integral_e
and exp_integral_e1
without affecting the rest. :)
comment:15 Changed 3 years ago by
 Reviewers set to Alex J. Best
 Status changed from needs_review to positive_review
Okay this looks good to me now. Thanks.
comment:16 Changed 3 years ago by
 Milestone changed from sage8.6 to sage8.7
Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sagepending or sagewishlist.
comment:17 Changed 3 years ago by
 Branch changed from u/ghdurgeshra/bad_latex_translation_of_output to 97e08e277bfe1fd1b600fce511803073e15e31d5
 Resolution set to fixed
 Status changed from positive_review to closed
It seems this can be accomplished by adding a custom
_print_latex_
method such as this one from Bessel to the classes insrc/sage/functions/exp_integral.pyc
, it looks likeE_n
is a pretty accepted notation for it.Possibly the arguments like
latex_name=r'exp_integral_e',
should also be removed in the same file then.