Ask Your Question
1

custom viewer for view(), plot(), ...

asked 4 years ago

jbirnick gravatar image

Hey,

when you view some object or plot some graph, then sage will start your system pdf viewer or image viewer.

My problem: I use a tiling window manager (bspwm) and I want my pdf viewer and image viewer to start in floating mode if started by sage.

So is there a way of changing the commands of the execution of the pdf- and image-viewer? (Or do you know any solution to my problem?)

Big thanks! Johann

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 4 years ago

tmonteil gravatar image

updated 4 years ago

For changing the default pdf viewer command to command --option=foobar, you can do:

from sage.misc.viewer import viewer
viewer.pdf_viewer("command --option=foobar")

Similarly use viewer.png_viewer for images.

Preview: (hide)
link
0

answered 4 years ago

jbirnick gravatar image

Thanks a lot, this works perfectly!

Let me ask something on top: Is is possible to view plot as SVG instead of PNG? I know you can save them as SVG, but can you also configure that they are viewed by default as SVG?

Thanks again for your quick and perfect answer!

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 860 times

Last updated: May 24 '20