New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancing latex embedding with plots #1766
Comments
comment:1
|
Attachment: latex_embedding.hg.gz ignore the .hg, it is outdated and i cannot upload the current one because of it's size ** use the link above to the zip file! ** |
comment:4
It might be nice to change the filenames used for plotting to .pdf instead of .png. |
comment:5
Plotting pdf's by default may have drawbacks -- at least last time I checked the pdf rendering for matplotlib was less mature than the png renderer. This could be an issue in some cases. However, of course getting vector graphics is a huge plus. |
comment:6
Replying to @wjp:
ahh okay, if this works for all types of plots (plot, matrix_plot, graphs, 3d graphs, ...) then it should be done that way. i'll try this. perhaps i'm able to make the extension customizable, then the user can select it and pdf is default. or if there are useful errors, it fallbacks from pdf to png. |
comment:7
I've updated the code to default to .pdf files now. Plots are fine and output-quality much better now! It's also possible to pass more arguments to the show command. Therefore it is possible to switch back to .png if there are problems. But plotting 3d-Graphs doesn't work (and has never) because the .show(..) command of the tachyon renderer has no filename= option. essentially, this .show() is entirely different (also docstring missing) - i'll open a ticket for this and possibly related problems. |
comment:8
Replying to @haraldschilly:
This is now #1925 |
Attachment: latex_embed_updates.hg.gz patch to current version of sagetex.{sty,py} |
patch to current version of sagetex.{sty,py} |
comment:10
Attachment: latex_embed_updates.2.hg.gz Please ignore the bundles! I'm still new to Mercurial. The patch updates sagetex.{sty,py}, but there's more to be done. The biggest issue is that when running Sage on the produced .sage file, it pops up windows with all the plots. (In Ubuntu gutsy, at least.) We need to find a way to keep Sage from doing this while processing the script. |
comment:11
I've made huge improvements to the sagetex stuff. The .sty file has been rewritten and now works much better; all the previous problems have been fixed. The source code for both the .sty and .py files are bundled into a Docstrip .dtx file, which allows much better documentation. Please try this out! I'd like to get it in soon. |
Changed keywords from none to latex, sagetex, latex_embed |
comment:12
I can't apply this cleanly...
Should I have the above-mentioned files? in latex_embed/? |
comment:13
Replying to @dfdeshom:
...
Those aren't related to the sagetex stuff; they are something that emacs makes. I deleted them since they're not directly related to sagetex (and because I'm a vim person :). At any rate, they are not important and you can ignore problems related to them. I can redo the patch if you'd like. |
comment:14
Replying to @dandrake:
Yes, could you please redo it? |
comment:15
This patch applies cleanly to 2.10.2 for me. Overall, I think this is great stuff! I give this a positive review pending addressing a few concerns:
That said, as soon as I saw this patch I immediately tested it, saw that it worked great, and sent the example pdf and tex file to a friend who was discussing the sage and tex combination just this last weekend. I know he'll be excited! |
comment:16
Replying to @jasongrout:
This can be done, but then the only way to tell that you need to run Sage is the package warning issued at the end of running latex, which I tried to make reasonably obvious but can be missed. As it is, the missing file error looks like
which, along with the package warning at the end of the run, is reasonably informative, and it behaves like If you really want latex to run without stopping, you can always use The current behavior seems more natural to me, but I can change it if that's the consensus. I can also have the behavior be toggle-able via a package option.
Yes. It's just cruft that
Ah, so you couldn't be bothered to read the text, and took the easy way out? :) I changed the readme to make that a bit more obvious. Perhaps I'm just too accustomed to
I already had some credits at the end of the documentation, but I added a line in the readme pointing to them.
Sweet! I'm glad to hear that other people think this is as cool as I do. |
comment:17
The current version of the patch only modifies files and adds them; this will avoid problems with missing cruft files. It addresses all of jason's concerns except for the first bullet point; I'm not sure what to do with that yet. I do think we need to get those files out of the repo; we are version controlling |
comment:18
I've updated the all-in-one zip file. In my opinion the README should be more detailed and there is a small problem: when just running the latex/sage/latex commands, the graphics are not included (white boxes with black border). I don't know why that's just how it does it ;) ... using pdflatex at the last step does what's now in the .zip file! The repository must be cleaned up, because there are files tracked which should not. See .zip file for all necessary files plus the prerendered .pdf docs - they could be included in the repository, because i think it's nice for a new user to instantaneously see what's possible. thx again to dan. |
comment:19
The current version of the patch addresses Jason's first bullet point: missing graphics files no longer cause an error, but they do make LaTeX issue a warning. |
comment:20
Replying to @haraldschilly:
Hrm, that's odd. I don't have that behavior. But the current version deals with graphics better, so perhaps that will work for you.
I agree. No extra cruft beyond the source files, except for PDFs of the documentation and the example file. |
comment:21
The current version of the patch fixes a misplaced brace, and adds the imagemagick option. |
comment:22
Attachment: sagetex.patch.gz |
comment:23
last words on this: sage-devel info about SageTeX@CTAN. Therefore the entire latex_embed directory should be replaced by these files. |
comment:25
I've made http://sage.math.washington.edu/home/mhansen/1766.hg which replaces the current contents of examples/latex_embed with the CTAN files. |
comment:26
Merged in Sage 3.0.alpha5 |
This is patch for the latex_embed inside the ${SAGE_BASE}/examples directory.
Now embedding plots works and makes it more usable!
Read included README.txt for more information and open the included PDF example.pdf to see the result.
Component: documentation
Keywords: latex, sagetex, latex_embed
Issue created by migration from https://trac.sagemath.org/ticket/1766
The text was updated successfully, but these errors were encountered: