# Ticket #14382: trac_14382-delta.patch

File trac_14382-delta.patch, 6.2 KB (added by jhpalmieri, 8 years ago)

for review only: diff between previous patches and texttt patch

• ## doc/de/tutorial/latex.rst

diff --git a/doc/de/tutorial/latex.rst b/doc/de/tutorial/latex.rst
 a sage: latex(integrate(z^4, z)) \frac{1}{5} \, z^{5} sage: latex('a string') \text{\tt a{ }string} \text{\texttt{a{ }string}} sage: latex(QQ) \Bold{Q} sage: latex(matrix(QQ, 2, 3, [[2,4,6],[-1,-1,-1]]))
• ## doc/en/tutorial/latex.rst

diff --git a/doc/en/tutorial/latex.rst b/doc/en/tutorial/latex.rst
 a sage: latex(integrate(z^4, z)) \frac{1}{5} \, z^{5} sage: latex('a string') \text{\tt a{ }string} \text{\texttt{a{ }string}} sage: latex(QQ) \Bold{Q} sage: latex(matrix(QQ, 2, 3, [[2,4,6],[-1,-1,-1]]))
• ## sage/combinat/free_module.py

diff --git a/sage/combinat/free_module.py b/sage/combinat/free_module.py
 a from sage.misc.latex import latex s = latex(m) if s.find(r'\text{\tt ') != -1: if s.find('\\text{\\textt') != -1: # m contains "non-LaTeXed" strings, use string representation s = str(m) sage: F.rename("F") sage: G.rename("G") sage: latex(tensor([F, F, G])) # indirect doctest \text{\tt F} \otimes \text{\tt F} \otimes \text{\tt G} \text{\texttt{F}} \otimes \text{\texttt{F}} \otimes \text{\texttt{G}} sage: F._latex_ = lambda : "F" sage: G._latex_ = lambda : "G" sage: latex(tensor([F, F, G])) # indirect doctest
• ## sage/groups/perm_gps/permgroup.py

diff --git a/sage/groups/perm_gps/permgroup.py b/sage/groups/perm_gps/permgroup.py
 a sage: S = SymmetricGroup(['a','b','c']) sage: latex(S) \langle (\text{\tt a},\text{\tt b},\text{\tt c}), (\text{\tt a},\text{\tt b}) \rangle \langle (\text{\texttt{a}},\text{\texttt{b}},\text{\texttt{c}}), (\text{\texttt{a}},\text{\texttt{b}}) \rangle """ return '\\langle ' + \ ', '.join([x._latex_() for x in self.gens()]) + ' \\rangle'
• ## sage/groups/perm_gps/permgroup_element.pyx

diff --git a/sage/groups/perm_gps/permgroup_element.pyx b/sage/groups/perm_gps/permgroup_element.pyx
 a sage: S = SymmetricGroup(['a', 'b']) sage: latex(S.gens()) \left[(\text{\tt a},\text{\tt b})\right] \left[(\text{\texttt{a}},\text{\texttt{b}})\right] """ from sage.misc.latex import latex return "".join(["(" + ",".join([latex(x) for x in cycle])+")" for cycle in self.cycle_tuples()])
• ## sage/misc/latex.py

diff --git a/sage/misc/latex.py b/sage/misc/latex.py
 a sage: str_function('+34.5') '+34.5' sage: str_function('hello_world') '\\text{\\tt hello{\\char\\_}world}' '\\text{\\texttt{hello{\\char\\_}world}}' sage: str_function('-1.00000?') # trac 12178 '-1.00000?' """ # And dashes too, since it causes issues for the command line... x = x.replace("-", "{-}") # Make it work in math mode, but look like typewriter line_wrapper = r"\text{\tt %s}" line_wrapper = r"\text{\texttt{%s}}" x = "\\\\\n".join(line_wrapper % line for line in x.split("\n")) # Preserve line breaks if "\n" in x: sage: latex(FiniteField(25,'a')) \Bold{F}_{5^{2}} sage: latex("hello") \text{\tt hello} \text{\texttt{hello}} sage: LatexExpr(r"\frac{x^2 - 1}{x + 1} = x - 1") \frac{x^2 - 1}{x + 1} = x - 1 x = latex(x, combine_all=combine_all) # The following block, hopefully, can be removed in some future MathJax. prefix = r"\text{\tt " prefix = r"\text{\texttt{" parts = x.split(prefix) for i, part in enumerate(parts): if i == 0: n += 1 if c == "}" and part[closing - 1] != "\\": n -= 1 if n == 0: if n == -1: break y = part[:closing] # part should end in "}}", so omit the last two characters # from y y = part[:closing-1] for delimiter in """|"'#%&,.:;?!@_~^+-/\=<>()[]{}0123456789E""": if delimiter not in y: break sage: t = PolynomialRing(QQ, 't').0 sage: from sage.misc.latex import repr_lincomb sage: repr_lincomb(['a', 's', ''], [-t, t - 2, t^12 + 2]) '-t\\text{\\tt a} + \\left(t - 2\\right)\\text{\\tt s} + \\left(t^{12} + 2\\right)' '-t\\text{\\texttt{a}} + \\left(t - 2\\right)\\text{\\texttt{s}} + \\left(t^{12} + 2\\right)' sage: repr_lincomb(['a', 'b'], [1,1]) '\\text{\\tt a} + \\text{\\tt b}' '\\text{\\texttt{a}} + \\text{\\texttt{b}}' Verify that a certain corner case works (see :trac:5707 and :trac:5766)::
• ## sage/modular/hecke/algebra.py

diff --git a/sage/modular/hecke/algebra.py b/sage/modular/hecke/algebra.py
 a EXAMPLES:: sage: latex(CuspForms(3, 24).hecke_algebra()) # indirect doctest \mathbf{T}_{\text{\tt Cuspidal...Gamma0(3)...24...} \mathbf{T}_{\text{\texttt{Cuspidal...Gamma0(3)...24...} """ from sage.misc.latex import latex return "\\mathbf{T}_{%s}" % latex(self.__M)
• ## sage/sets/set.py

diff --git a/sage/sets/set.py b/sage/sets/set.py`
 a :: sage: print latex(Primes()) \text{\tt Set{ }of{ }all{ }prime{ }numbers:{ }2,{ }3,{ }5,{ }7,{ }...} \text{\texttt{Set{ }of{ }all{ }prime{ }numbers:{ }2,{ }3,{ }5,{ }7,{ }...}} sage: print latex(Set([1,1,1,5,6])) \left\{1, 5, 6\right\} """