Hi Nicolas!
Just reimplement Crystals.ParentMethods._latex_ to basically do the
above:
G=self.digraph()
G.set_latex_options(format="dot2tex")
return latex(G)
At this occasion, it could provide some more options to
set_latex_options, like the missing edge labels. And possibly the 0
edges going backward and colors on the edges (I don't have the syntax
under hand, but see the e-mail we had exchanged for your affine
crystal); note that this would introduce a dependency on
graphs_color_by_label-nt.patch, but it should be quick to polish and
get it merged when needed.
Thank you for your comments!
I have now implemented the method
def latex(self, **options):
r"""Returns the crystal graph as a latex string. This can be
exported
to a file with self.latex_file('filename').
EXAMPLES::
sage: T = CrystalOfTableaux(['A',2],shape=[1])
sage: T.latex()
...
"""
G=self.digraph()
G.set_latex_options(format="dot2tex", edge_labels = True,
edge_options = lambda (u,v,label):
({"backward":label ==0}), **options)
return G._latex_()
in /categories/crystals.py. However, I have a question:
How can I now pass along the **options to the view command in this setting?
Before we could do
sage: K = KirillovReshetikhinCrystal(['A',3,1], 1,1)
sage: G = K.digraph()
sage: G.set_latex_options(format = "dot2tex", edge_labels = True, color_by_label = {0:"black", 1:"blue",
2:"red", 3:"green"}, edge_options = lambda (u,v,label): ({"backward":label ==0}))
sage: view(G, pdflatex=True, tightpage=True)
So if the user decides to color the edges, how can this be passed on or set
through view?
Cheers,
Anne
--
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.