On Thu, Dec 4, 2008 at 1:45 AM, Wilfried_Huss
<[EMAIL PROTECTED]> wrote:
>
> From the discussion of trac #4575:
>
> There are already at least five functions that produce jsmath output
> in the notebook, which all behave differently:
>
> show():
>
>    Produces latex in display mode. And works with graphic objects of
> course.
>
> view():
>
>    Produces latex in inline mode (which is hard to read in the
> notebook). This has many options that only work
>    on the commandline and with xdvi. For graphic objects it returns a
> string representation.
>
> typeset():
>
>    Same behaviour as view() but has no options.
>
> pretty_print():
>
>    produces latex in inline mode.
>
>    If used on the graphics objects, it shows it like show(). But it
> doesn't accept any options, as show() does.
>
> jsmath():
>
>    produces latex in display mode. For graphic objects it returns a
> string representation, but inside latex
>    math-mode.
>
>    The docstring says that there is a option mode which changes
> between display and inline mode.
>
>    Unfortunately this only works in doctest mode. In the notebook I
> get:
>
>        sage: jsmath(x^2, 'inline')
>        Traceback (click to the left for traceback)
>        ...
>        TypeError: __call__() takes exactly 2 arguments (3 given)
>
> Is there a deeper reason why Sage has all these functions? Or have
> they just accumulated over the years?
> A few of these should probably be deprecated.
>
> In my opinion show() is the best of these, because also x.show()
> works, so it is consistent. It's short and easy
> to remember. It just needs better documentation.
>
> Would a mode flag for show() like the one for jsmath() be okay? Then
> it could be extended in the future without adding additional keywords.
>
> What should be the user interface for latex output in the notebook?
>
> Greetings,
> Wilfried

I think these "accumulated over the years", and there is no deep
reason to have so many.  Here's how I see them, which should
mean something since I wrote the first versions of most of them:


   show --  a useful command that I use all the time; shows an object nicely.

   view -- pointless and should be removed.  This behavior could
maybe be an option to show.  It was useful back before jsmath or
the notebook existed when I used a "log to dvi file" mode.

   typeset -- I have no clue where this comes from or what it does, though
evidently I wrote it on July 4, 2006.

   pretty_print -- Jason Grout wrote this somewhat recently.  I'm not
sure why, but I think there was a sage-devel discussion.

   jsmath -- This is mainly so one can use %jsmath cells in a notebook
to render formulas.  I'm not sure how useful this is, but I have used
it many times.  It is also very nice in that you can do jsmath('x^n +
y^n = z^n'), say and get typeset math out.  There is no "natural" way
to do that using any of the above commands right now.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to