#5975: [with experimental patch] Implement latex output for (combinatorial) 
graphs
--------------------------+-------------------------------------------------
 Reporter:  rbeezer       |       Owner:  rbeezer     
     Type:  enhancement   |      Status:  new         
 Priority:  major         |   Milestone:  sage-feature
Component:  graph theory  |    Keywords:              
--------------------------+-------------------------------------------------

Comment(by rbeezer):

 latex-test-1.patch is just that, a test.  Code by Fidel Barrera-Cruz,
 which I've got working in this patch.  Strictly experimental for
 discussion purposes.  The session

 {{{
 g = graphs.PetersenGraph()
 latex(g)
 }}}

 produces

 {{{
 \begin{tikzpicture}
 \GraphInit[vstyle=Dijkstra]

 \SetVertexNoLabel
 \SetVertexMath

 \Vertex[x=2.5cm,y=4.7553cm]{a0}
 \Vertex[x=0.0cm,y=2.9389cm]{a1}
 \Vertex[x=0.9549cm,y=0.0cm]{a2}
 \Vertex[x=4.0451cm,y=0.0cm]{a3}
 \Vertex[x=5.0cm,y=2.9389cm]{a4}
 \Vertex[x=2.5cm,y=3.441cm]{a5}
 \Vertex[x=1.25cm,y=2.5328cm]{a6}
 \Vertex[x=1.7275cm,y=1.0633cm]{a7}
 \Vertex[x=3.2725cm,y=1.0633cm]{a8}
 \Vertex[x=3.75cm,y=2.5328cm]{a9}

 \AssignVertexLabel{a}{10}{
 $0$,
 $1$,
 $2$,
 $3$,
 $4$,
 $5$,
 $6$,
 $7$,
 $8$,
 $9$
 }

 \Edge(a0)(a1)
 \Edge(a0)(a4)
 \Edge(a0)(a5)
 \Edge(a1)(a2)
 \Edge(a1)(a6)
 \Edge(a2)(a3)
 \Edge(a2)(a7)
 \Edge(a3)(a4)
 \Edge(a3)(a8)
 \Edge(a4)(a9)
 \Edge(a5)(a7)
 \Edge(a5)(a8)
 \Edge(a6)(a8)
 \Edge(a6)(a9)
 \Edge(a7)(a9)

 \end{tikzpicture}
 }}}

 which when run through Latex produces the attached PDF.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5975#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to