Ask Your Question

SagExchange's profile - activity

2023-03-21 08:00:54 +0200 received badge  Famous Question (source)
2018-08-29 04:59:06 +0200 received badge  Notable Question (source)
2016-11-19 21:02:56 +0200 received badge  Popular Question (source)
2015-07-07 22:43:38 +0200 commented question sagetex with breqn ? break line sagetex equations

Hi again,

I know now that the reason is that the generated latex code from sage contains a lot of {\left and \right)} that should be deleted. But I cant write any macro in Latex that removes { or } because they are themselves trigger parameters... So the deletion of { and } should come from sage before handing the code to latex. Any suggestions on how to do that?

2015-07-04 19:31:55 +0200 received badge  Student (source)
2015-07-04 13:09:25 +0200 asked a question sagetex with breqn ? break line sagetex equations

Hi everyone,

When using sagetex, it often produces very long equations that are not visible anymore because they go over the page width.

How to fix that?

I could work around it by loading the .sagetex.sage into a sage session, then produce latex code with latex(functionname) and then break this code manually but it would be against the spirit of sagetex.

I tried the breqn environment but it does not work, e.g.

\documentclass{article}
\usepackage{sagetex} 
\usepackage{breqn}

\begin{document}

\begin{sagesilent}
var('d,epsilon,mu,z,M,e,m')
delta =  (1-z)*( gamma(2-d/2)/( (1-z)^2*m^2+z*M^2 )^(2-d/2) *(2-epsilon)^2/2 + gamma(3-d/2)/( (1-z)^2*m^2+z*M^2 )^(3-d/2) * ( 2*(1-4*z+z^2)-epsilon*(1-z)^2 )*m^2  )
\end{sagesilent}

\begin{dmath}
\sage{delta.diff(m).subs(m==mu)}
\end{dmath}

\end{document}

produces an equation that has no line breaks. I cannot use environments like split or align to fix it because I cannot directly modify the latex code, or, if I would via sage, it would not be convenient anymore to use sagetex.

Any help would be appreciated. Thank you!