Ask Your Question
1

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

asked 2020-05-23 20:55:38 +0100

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

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2020-05-23 21:16:01 +0100

tmonteil gravatar image

updated 2020-05-23 21:20:51 +0100

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.

edit flag offensive delete link more
0

answered 2020-05-24 15:10:29 +0100

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!

edit flag offensive delete link more

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: 2020-05-23 20:55:38 +0100

Seen: 795 times

Last updated: May 24 '20