ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 16 Aug 2020 07:11:31 -0500sagetex linebreakhttps://ask.sagemath.org/question/53064/sagetex-linebreak/When using the environment sagecommandline of sagetex with long number output, how can I get automatic line breaks? I already tried to change sagetex.sty (putting breaklines=true at several places), but nothing changed. Here is my minimal example: (p.s. I asked the same question also on tex.stackexchange)
\documentclass[
a6paper, 11pt, oneside,
english,ngerman]{scrartcl}
% !TEX TS-program = sage
% !TEX encoding = UTF-8 Unicode
\usepackage[headsep=0cm,footskip=1.5em,includeheadfoot=true,
top=0cm,bottom=0cm,left=.5cm,right=.5cm,]{geometry}
\usepackage{sagetex}
\lstdefinestyle{SageOutput}{style=DefaultSageOutput,breaklines=true}
\begin{document}
\begin{sagecommandline}
sage: factorial(100)+1
sage: factorial(50)+1
sage: factorial(10)
\end{sagecommandline}
\end{document}
dantetanteSun, 16 Aug 2020 07:11:31 -0500https://ask.sagemath.org/question/53064/sagetex with breqn ? break line sagetex equationshttps://ask.sagemath.org/question/27259/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!SagExchangeSat, 04 Jul 2015 06:09:25 -0500https://ask.sagemath.org/question/27259/