Hi Minh, I probably was not very clear. I know how to change printed and typeset version of a particular object that I create. What I don't like is how just plain strings are typeset: if I put "123\n 23" in a notebook cell in typeset mode and hit Shift-Enter, I will see "123 23" in a pretty font, but on a single line. And as I understand, all objects that don't have _latex_ will be typeset from _repr_ in the same way - all newlines and indentations are gone. There are such output examples in attachment to http://trac.sagemath.org/sage_trac/ticket/8694, where I have fixed it for schemes by implementing _latex_. My point is that if the default handling was a little bit more sophisticated, the output of ALL objects without _latex_ would look better. And if a user tries to output "123\n 23", then (s)he probably wants to have two lines, no matter if the output is printed or typeset.
Hope this makes more sense ;-) Andrey On May 22, 10:07 pm, Minh Nguyen <nguyenmi...@gmail.com> wrote: > Hi Andrey, > > On Sun, May 23, 2010 at 8:06 AM, Andrey Novoseltsev <novos...@gmail.com> > wrote: > > Hello, > > Just so that we are clear... > > > When strings or objects with only _repr_ are typeset, they are just > > wrapped as a chunk of text. The main problem with it is removing line > > breaks. Another one - removing indentation. For example, if "123\n 23" > > is printed, we get > > > 123 > > 23 > > ... the printed version is done handled by how __repr__ is defined to > handle string representation of an object. > > > with 23 right under 23. The typeset version gives > > > 123 23 > > And the LaTeX typeset version is handled by how _latex_ is defined to > handle LaTeX typeset version of an object. But you might know this > already. > > -- > Regards > Minh Van Nguyen > > -- > 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