You're right ! It doesn't work with the view() function. On the other
hand, when I select latex instead of sage and I enter the command

\sage{A()}

it displays 123 on the first line and 23 on the second line, with the
2's aligned properly, i.e. it handles the newlines and indentation as
desired. That said, I guess it's not a clean solution...

Alex

On 24 mai, 18:01, John H Palmieri <jhpalmier...@gmail.com> wrote:
> On May 24, 2:17 pm, ablondin <alexandre.blondin.ma...@gmail.com>
> wrote:
>
>
>
> > What about using the verbatim environment of Latex ?
>
> > class A(SageObject):
>
> >     def _latex_(self):
> >         from sage.misc.latex import LatexExpr
> >         return '\\begin{verbatim}\n123\n 23\n\\end{verbatim}'
>
> > sage: attach latex.sage
> > sage: latex(A())
> > \begin{verbatim}
> > 123
> >  23
> > \end{verbatim}
>
> > In the notebook, it works fine for me.
>
> From the notebook, try executing
>
>   view(A())
>
> I bet you'll see a box saying
>
>   Unknown environment "verbatim"
>
> This is because jsMath doesn't know about the verbatim environment.
> The extension
>
>   <http://www.math.union.edu/~dpvc/jsMath/authors/verb.html>
>
> might be an option here, but that doesn't seem to deal with newlines
> very well.
>
> --
> John
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to 
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/sage-devel
> URL:http://www.sagemath.org

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to