Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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!