Hi!

On Fri, Dec 23, 2011 at 04:54:53PM -0800, Travis Scrimshaw wrote:
>    Here's the results of the tests I have done and my interpretations.
> Calling view() (from the notebook) calls the underlying OS's latex
> compiler, and then I believe the notebook displays the resulting pdf
> in the output window. So by doing ctrl-C twice to get to the shell,
> then running "sudo yum install dot2tex" (the root password is "sage"),
> and finally running "./sage -i dot2tex" . This installs dot2tex on the
> underlying Fedora OS, then in sage specifically. From here I was able
> to generate the latex output in the notebook without errors on the
> first time, and you can copy this over to your external latex compiler
> and pdf viewer.
> 
>    I copied the latest version of TikZ / PGF (using a shared folder)
> to the VM and installed it. I was able to compile the .tex file using
> the VM's latex compiler and view the output .pdf from my host OS
> (Windows Vista) in the shared folder, but I could not get it to
> display in the notebook. (See http://wiki.sagemath.org/SageAppliance
> on the shared folders.) The error I got was `Unknown environment
> "tikzpicture"` and I also can compile the pdf on my host OS, so
> somehow there is a disconnect between the notebook and the VM's OS.

Thanks Travis for the detailed analysis!

Just one more piece of information: inside the notebook, latex
formulas are rendered by default by the browser through jsmath (which
interprets directly the latex). It turns out that jsmath does not
(yet?)  support tikz. The notebook is aware of this, and triggers the
`Unknown environment "tikzpicture"`. The other option is to have the
Sage run a latex compilation, and display the pdf. This can currently
be done in two ways:

 - Converting to png, and embedding the image in the notebook
 - Displaying the pdf in a separate window

The question is whether the notebook can open such a separate window
when running within the VM. Looking at sage.misc.latex and
sage.misc.viewer it seems that Sage can only spawn an external pdf
viewer on the server; but that can only work when using Sage locally.

To summarize, there are two potential issues to be investigated:

 - Making sure that the Sage virtual machine image includes pgf, tikz,
   as well as tkz-arith tkz-berge tkz-graph by default.

 - Making sure that the Sage notebook can open an external window by
   having the notebook server send the pdf document as such to the web
   browser, and letting it handle it. This would have the advantage to
   work both for Sage in a virtual machine (e.g. on windows), and when
   using Sage remotely.

Travis: would you volunteer to push some/all those issues forward?
I.e. discussing them on sage-devel/trac, and making sure whatever is
needed gets done?

By the way, there is a patch in the queue which added support for the
tightpage option even when the latex picture is embedded in the
notebook using a conversion to png:

 - trac_6618_view_viewer_tightpage-followup-nt.patch

This patch has rotten away, but it should be easy to restore and
finalize it.

With my best wishes for the end of the year,

                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

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

Reply via email to