# HG changeset patch
# User Rob Beezer <beezer@ups.edu>
# Date 1295757179 28800
# Node ID e76426e5a607c9bab9d5538fe34d2c9c9aa9bae7
# Parent  3ad0748b11ae30f5c4c0f5bc2e4bd15b8e808840
8948: vector printing doctests

diff -r 3ad0748b11ae -r e76426e5a607 sage/geometry/toric_lattice.py
--- a/sage/geometry/toric_lattice.py	Tue May 11 01:29:26 2010 -0500
+++ b/sage/geometry/toric_lattice.py	Sat Jan 22 20:32:59 2011 -0800
@@ -914,9 +914,9 @@
 
             sage: L = ToricLattice(3, "L")
             sage: L.submodule_with_basis([(3,2,1),(1,2,3)])._latex_()
-            '\\left\\langle\\left(3,2,1\\right)_{L}, \\left(1,2,3\\right)_{L}\\right\\rangle'
+            '\\left\\langle\\left(3,\\,2,\\,1\\right)_{L}, \\left(1,\\,2,\\,3\\right)_{L}\\right\\rangle'
             sage: L.submodule([(3,2,1),(1,2,3)])._latex_()
-            '\\left\\langle\\left(1,2,3\\right)_{L}, \\left(0,4,8\\right)_{L}\\right\\rangle'
+            '\\left\\langle\\left(1,\\,2,\\,3\\right)_{L}, \\left(0,\\,4,\\,8\\right)_{L}\\right\\rangle'
         """
         s  = '\\left\\langle'
         s += ', '.join([ b._latex_() for b in self.basis() ])
@@ -1221,12 +1221,11 @@
             sage: Ns = N.submodule([N(2,4,0), N(9,12,0)])
             sage: Q = N/Ns
             sage: print Q._latex_()
-            N / \left\langle\left(1,8,0\right)_{N},
-            \left(0,12,0\right)_{N}\right\rangle
+            N / \left\langle\left(1,\,8,\,0\right)_{N}, \left(0,\,12,\,0\right)_{N}\right\rangle
             sage: Ns = N.submodule([N(1,4,0)])
             sage: Q = N/Ns
             sage: print Q._latex_()
-            N / \left\langle\left(1,4,0\right)_{N}\right\rangle
+            N / \left\langle\left(1,\,4,\,0\right)_{N}\right\rangle
         """
         return "%s / %s" % (latex(self.V()), latex(self.W()))
             
@@ -1441,7 +1440,7 @@
             sage: Ns = N.submodule([N(2,4,0), N(9,12,0)])
             sage: Q = N/Ns
             sage: print Q.gen(0)._latex_()
-            \left[0,1,0\right]_{N}
+            \left[0,\,1,\,0\right]_{N}
         """
         return latex(self.lift()).replace("(", "[", 1).replace(")", "]", 1)
         
diff -r 3ad0748b11ae -r e76426e5a607 sage/geometry/toric_lattice_element.pyx
--- a/sage/geometry/toric_lattice_element.pyx	Tue May 11 01:29:26 2010 -0500
+++ b/sage/geometry/toric_lattice_element.pyx	Sat Jan 22 20:32:59 2011 -0800
@@ -351,7 +351,7 @@
             sage: Ld = ToricLattice(3, "L").dual()
             sage: e = Ld(1,2,3)
             sage: e._latex_()
-            '\\left(1,2,3\\right)_{L^*}'
+            '\\left(1,\\,2,\\,3\\right)_{L^*}'
         """
         return "%s_{%s}" % (super(ToricLatticeElement, self)._latex_(),
                             self.parent().ambient_module()._latex_name)
diff -r 3ad0748b11ae -r e76426e5a607 sage/misc/latex.py
--- a/sage/misc/latex.py	Tue May 11 01:29:26 2010 -0500
+++ b/sage/misc/latex.py	Sat Jan 22 20:32:59 2011 -0800
@@ -993,13 +993,13 @@
 
             sage: a = vector(QQ, [1,2,3])
             sage: latex(a)
-            \left(1,2,3\right)
+            \left(1,\,2,\,3\right)
             sage: latex.vector_delimiters("[", "]")
             sage: latex(a)
-            \left[1,2,3\right]
+            \left[1,\,2,\,3\right]
             sage: latex.vector_delimiters(right="\\}")
             sage: latex(a)
-            \left[1,2,3\right\}
+            \left[1,\,2,\,3\right\}
             sage: latex.vector_delimiters()
             ['[', '\\}']
 
diff -r 3ad0748b11ae -r e76426e5a607 sage/modular/modsym/element.py
--- a/sage/modular/modsym/element.py	Tue May 11 01:29:26 2010 -0500
+++ b/sage/modular/modsym/element.py	Sat Jan 22 20:32:59 2011 -0800
@@ -181,7 +181,7 @@
             sage: set_modsym_print_mode('modular'); latex(x) # indirect doctest
             \left\{\frac{-1}{9}, 0\right\} + \left\{\infty, 0\right\}
             sage: set_modsym_print_mode('vector'); latex(x) # indirect doctest
-            \left(1,0,1\right)
+            \left(1,\,0,\,1\right)
             sage: set_modsym_print_mode()
         """
 
diff -r 3ad0748b11ae -r e76426e5a607 sage/modules/free_module_element.pyx
--- a/sage/modules/free_module_element.pyx	Tue May 11 01:29:26 2010 -0500
+++ b/sage/modules/free_module_element.pyx	Sat Jan 22 20:32:59 2011 -0800
@@ -1868,18 +1868,33 @@
         return self.nonzero_positions()
 
     def _latex_(self):
-        """
-        Return a latex representation of self. For example, if self is
-        the free module element (1,2,3,4), then following latex is
-        generated: "(1,2,3,4)" (without the quotes).  The vector is
-        enclosed in parentheses by default, but the delimiters can be
-        changed using the command ``latex.vector_delimiters(...)``.
+        r"""
+        Return a latex representation of the vector ``self``.
+
+        OUTPUT:
+
+        If self is the free module element (1,2,3,4),
+        then a string with the following latex is returned:
+        "\left(1,\,2,\,3,\,4\right)" (without the quotes).
+        The vector is enclosed in parentheses by default,
+        but the delimiters can be changed using the command
+        ``latex.vector_delimiters(...)`` as in the example below.
 
         EXAMPLES::
 
             sage: v = vector(QQ, [1,2,3])
             sage: latex(v)
-            \left(1,2,3\right)
+            \left(1,\,2,\,3\right)
+
+        This is an example of how to change the delimiters.
+        You have the power to mix and match, though it is
+        probably not advisable.  For more detail see
+        :meth:`~sage.misc.latex.Latex.vector_delimiters`.
+
+            sage: latex.vector_delimiters('[', '\\rangle')
+            sage: w = vector(CDF, [1,2,3])
+            sage: latex(w)
+            \left[1.0,\,2.0,\,3.0\right\rangle
         """
         latex = sage.misc.latex.latex
         vector_delimiters = latex.vector_delimiters()
diff -r 3ad0748b11ae -r e76426e5a607 sage/modules/vector_callable_symbolic_dense.py
--- a/sage/modules/vector_callable_symbolic_dense.py	Tue May 11 01:29:26 2010 -0500
+++ b/sage/modules/vector_callable_symbolic_dense.py	Sat Jan 22 20:32:59 2011 -0800
@@ -88,12 +88,12 @@
             sage: f
             (u, v, w) |--> (2*u + v, u - w, w^2 + u)
             sage: latex(f)
-            \left( u, v, w \right) \ {\mapsto} \ \left(2 \, u + v,u - w,w^{2} + u\right)
+            \left( u, v, w \right) \ {\mapsto} \ \left(2 \, u + v,\,u - w,\,w^{2} + u\right)
             sage: r(t) = (cos(t), sin(t))
             sage: r
             t |--> (cos(t), sin(t))
             sage: latex(r)
-            t \ {\mapsto}\ \left(\cos\left(t\right),\sin\left(t\right)\right)
+            t \ {\mapsto}\ \left(\cos\left(t\right),\,\sin\left(t\right)\right)
         """
         from sage.misc.latex import latex
         ring=self.base_ring()
