#18015: Empty graph latex fails
----------------------------+----------------------------
   Reporter:  vbraun        |            Owner:
       Type:  defect        |           Status:  new
   Priority:  major         |        Milestone:  sage-6.6
  Component:  graph theory  |         Keywords:
  Merged in:                |          Authors:
  Reviewers:                |  Report Upstream:  N/A
Work issues:                |           Branch:
     Commit:                |     Dependencies:
   Stopgaps:                |
----------------------------+----------------------------
 {{{
 sage: Graph()
 Graph on 0 vertices
 sage: view(Graph())
 ---------------------------------------------------------------------------
 UnboundLocalError                         Traceback (most recent call
 last)
 <ipython-input-5-2dc28ec90e82> in <module>()
 ----> 1 view(Graph())

 /mnt/disk/home/release/Sage/local/lib/python2.7/site-
 packages/sage/misc/latex.pyc in view(objects, title, debug, sep, tiny,
 pdflatex, engine, viewer, tightpage, mode, combine_all, **kwds)
    2160     else:
    2161         latex_options = {}
 -> 2162     s = _latex_file_(objects, title=title, sep=sep, tiny=tiny,
 debug=debug, **latex_options)
    2163     if engine is None:
    2164         engine = _Latex_prefs._option["engine"]

 /mnt/disk/home/release/Sage/local/lib/python2.7/site-
 packages/sage/misc/latex.pyc in _latex_file_(objects, title, debug, sep,
 tiny, math_left, math_right, extra_preamble)
    1770         for i in range(len(objects)):
    1771             x = objects[i]
 -> 1772             L = latex(x)
    1773             if not '\\begin{verbatim}' in L:
    1774                 s += '%s%s%s'%(math_left, L, math_right)

 /mnt/disk/home/release/Sage/local/lib/python2.7/site-
 packages/sage/misc/latex.pyc in __call__(self, x, combine_all)
     918         """
     919         if has_latex_attr(x):
 --> 920             return LatexExpr(x._latex_())
     921         try:
     922             f = latex_table[type(x)]

 /mnt/disk/home/release/Sage/local/lib/python2.7/site-
 packages/sage/graphs/generic_graph.pyc in _latex_(self)
     715         setup_latex_preamble()
     716
 --> 717         return self.latex_options().latex()
     718
     719     def _matrix_(self, R=None):

 /mnt/disk/home/release/Sage/local/lib/python2.7/site-
 packages/sage/graphs/graph_latex.pyc in latex(self)
    1301         format = self.get_option('format')
    1302         if format  == "tkz_graph":
 -> 1303             return self.tkz_picture()
    1304         elif format == "dot2tex":
    1305             return self.dot2tex_picture()

 /mnt/disk/home/release/Sage/local/lib/python2.7/site-
 packages/sage/graphs/graph_latex.pyc in tkz_picture(self)
    1556         # layouts get put in the middle of the bounding box by
 setting the
    1557         # scaling to a constant value on a midline
 -> 1558         xspread = xmax - xmin
    1559         if xspread == 0:
    1560             x_scale = 0.0

 UnboundLocalError: local variable 'xmin' referenced before assignment
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/18015>
Sage <http://www.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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to