#5975: [with patch, needs work] Implement latex output for (combinatorial)
graphs
--------------------------+-------------------------------------------------
Reporter: rbeezer | Owner: rbeezer
Type: enhancement | Status: new
Priority: major | Milestone: sage-feature
Component: graph theory | Keywords:
Reviewer: | Author: Robert Beezer, Fidel Barrera Cruz
Merged: |
--------------------------+-------------------------------------------------
Comment(by jhpalmieri):
I think this is almost ready to go. I'm attaching a patch with a bunch of
trivial fixes (changing "EXAMPLE::" to "EXAMPLES::" lots of places, for
instance), one medium fix (since methods beginning with underscore are not
included in the reference manual, I moved the docstring from the init
method for {{{GraphLatex}}} to the class itself), and one more major fix:
why not add to the LaTeX preamble when the graph itself is initialized?
My patch does this, but it's easy enough to take out if you think it's a
bad idea. I don't think that adding those two packages will slow any
latex process down that much, so I think it's okay. Oh, and I forgot to
add the appropriate strings to avoid_jsmath_..., and this should be done
in the same place (this should have no impact on speed). This last change
would make this ticket depend on #6089, but because of your positive
review, that shouldn't be a big deal.
Other comments: if have_tkz_graph returns false, then should tkz_picture
return an error, or return a string which tells the user why they're not
getting a nice picture? That's what the docstring says, more or less, but
that's not what actually happens, I think. The docstring should not say
anything about strings being added to the latex_preamble, by the way.
The following doesn't do anything. Should it?
{{{
sage: g = graphs.CompleteBipartiteGraph(1,3)
sage: g.latex_options(tkz_style = 'Art')
}}}
In the following, the nodes are overlapping, and it doesn't look good. It
looks like there is room to space them out more:
{{{
sage: g = graphs.CompleteBipartiteGraph(1,15)
sage: view(g)
}}}
Finally, I found the documentation not as helpful as it could be, partly
because it was scattered around. I think one solution is to add stuff
about "view(g)" and "latex(g)" (etc.) to the "Visualization" section at
the top of graph.py. You might include information about how to test (in
Sage) whether your system has tkz-graph and tkz-berge installed, where to
get them if they're not installed, and maybe brief descriptions, or at
least a list, of the available tkz_styles. When more options get added,
they can go here, too. You could also expand the documentation in
graph_latex.py, either at the top of the file or for the class
{{{GraphLatex}}}, with some more examples and then a pointer to the
Visualization section. You could also put a "See also" in the docstring
for plot and other related methods.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5975#comment:18>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---