First time here? Check out the FAQ!

Ask Your Question
0

Huge output saved in nice format

asked 12 years ago

G-Sage gravatar image

updated 10 years ago

FrédéricC gravatar image

What I want to do: Hello, for part of a proof, I used Sage to do some calculations on 53 graphs. The output is long (I could make my program make the output shorter but it'd still be somewhat long) and I want to be able to save it and put it on a webpage. I'm thinking the format would be PDF but I'm open to other suggestions. By the way, my output will have both graph pictures and text.

What I have tried: I don't really know what to do. What I have tried is to do the calculations in Sage and then save that as a PDF using Firefox. I don't think I ever figured that out. A friend of mine helped me do the same with Safari and that "worked". But, it's not formatted nicely. If the output is long on one line, that part doesn't show up in the PDF. And, each time it changes from one page to the next, some of the output is lost. It doesn't split it up correctly.

So, does any one know a good way to do this? Any help would be greatly appreciated.

Preview: (hide)

Comments

1

Have you tried SageTeX, or is that not appropriate? Your description is somewhat vague.

kcrisman gravatar imagekcrisman ( 12 years ago )

I agree with kcrisman. Can you be more specific about what sort of format you're looking for? If you don't like the SageTeX idea, it shouldn't be hard to write some code which produces one LaTeX file (hence one PDF file) for each graph, along with an html index file linking to all of them.

John Palmieri gravatar imageJohn Palmieri ( 12 years ago )

2 Answers

Sort by » oldest newest most voted
0

answered 12 years ago

Jesustc gravatar image

LaTeX :)

For the data, you just have to generate a basic function to print matrices like LaTeX tables, and write them in a LaTeX file. Or use the LaTeX representations that are already on sage for almost every object.

For images, just one function that takes a 'plot' object, saves it in a convenient folder as e.g. pdf, and adds a '\includegraphics{}' to your latex files.

Also, you can easily generate sections, an index... Well, I guess you know LaTeX already ;)

Preview: (hide)
link

Comments

There are hundreds of graph pictures. That'd take days. It's a great idea, but I don't think it will work in this case. Thanks.

G-Sage gravatar imageG-Sage ( 12 years ago )

Then why not directly a webpage? As before: save the images to the webpage folder and insert the links to the images in the html document. With some CSS, you can make it quick and pretty.

Jesustc gravatar imageJesustc ( 12 years ago )
0

answered 12 years ago

G-Sage gravatar image

updated 12 years ago

I googled how to save Firefox output as PDF and found out you can't unless you download some sort of add-on. But, I found that you can do it easily in Google Chrome by doing Ctrl+P and then changing the destination to "Save as PDF". And, after I downloaded Chrome and tried this, I also noticed that it doesn't split up lines of output or graph pictures into two different pages. It does add large portions of white space occasionally, but I made my output much smaller on the side, so the benefits of not splitting up outputs outweighs the negative of extra white space.

I thought I would put this up in case any one else looks at this question sometime.

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

Stats

Asked: 12 years ago

Seen: 865 times

Last updated: Jan 01 '13