On Monday, December 17, 2012 8:40:18 AM UTC-8, Greg Minshall wrote:
>
> Ivan,
>
> yes, downloading and installing the two patches for trac_11795 and then 
> configuring appropriately seems to work for DVI, PDF, and PNG.  (in case it 
> isn't obvious, i'm a sage newbie, so i'm not sure how to get sage to 
> display an html file, assuming the 'browser' entry is supposed to display 
> html.)
>

sage: tutorial()

should open up the tutorial in a browser, and it should use the settings in 
the patch for #11795.
 

>
> a couple of comments about the patch (to the extent i understand it):
>
> 1.  to override the default, i seem to need to define a function, and 
> assign that function to, e.g., sage.misc.viewer.dvi_viewer.  nicer (?) 
> might be to set some variable to '/sw/bin/xdvi'.
>

You shouldn't need to *define* a function, just *import* it. I don't think 
these functions will be used frequently enough to have the function 
imported automatically for all users, so you need to do

from sage.misc.viewer import viewer
viewer.dvi_viewer('/sw/bin/xdvi')
viewer.browser('open -a /Applications/Firefox.app')
(etc.)

You can put these lines in a file "/home/username/.sage/init.sage" and they 
will be run every time you start Sage.

Running "viewer.browser(...)" (and the other similar functions) does in 
fact set an appropriate variable, and calling a function to set a parameter 
fits into Sage's way of doing things better than setting a variable, I 
think. But if you really want to, you can do

sage.misc.viewer._viewer_prefs['dvi_viewer'] = '/sw/bin/xdvi'

-- 
John

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to