I was playing with sageexample environment, didn't quite like what I
was getting (compared to what I planned), and while I was figuring out
a way to suggest a new environment, I found out that Volker has
already timely produced sagecommandline, which made me very happy.

However, after seeing what sageexample does, I want to propose yet
another version, behaving like a "session in Sage notebook." Say, I
write something like this:

\begin{sagenotebook}
1 + 1
3^2

x^2

print x^2

show(x^2)
\end{sagenotebook}

with empty lines indicating cell boundaries (perhaps there is a better
way to indicate them), and it produces

-----------
| 1 + 1
| 3^2
-----------
9
-----------
| x^2
-----------
x^2 (typeset as inline, flushed to the left, no extra vertical space
before/after)
-----------
| print x^2
-----------
x^2 (as text, no typesetting)
-----------
| show(x^2)
-----------
x^2 (typeset as displayed, centered, some extra vertical space)

i.e. input is typeset as code in framed boxes of "pagewidth minus
indents" width and the output is typeset like in the notebook with
"typeset" checkbox on. Or better yet, choose the default output style
using some option, but still allowing one to explicitly use print/view/
show to get text/inline/displayed. I don't know how difficult it is to
implement, but I think it would be awesome for giving Sage examples in
papers and books!

Thank you,
Andrey

-- 
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