Ticket #8633: trac_8633-texttt.patch

File trac_8633-texttt.patch, 1.1 KB (added by jhpalmieri, 11 years ago)
  • sage/misc/latex.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1269970271 25200
    # Node ID 77e629d7a1403f45e780cd26132480d9f714fed7
    # Parent  5d8e5d412f0f3e4b7fa54ae418a8ea7248823e1c
    trac 8633: eliminate more instances of 'texttt' from jsmath output
    
    diff -r 5d8e5d412f0f -r 77e629d7a140 sage/misc/latex.py
    a b  
    14171417        if isinstance(x, LatexExpr):
    14181418            # already a latex expression, so the output of
    14191419            # latex(blah).  so treat as a string.
    1420             x = "\\hbox{%s}"%str(x)
     1420            x = "\\hbox{%s}"%str(x.replace('\\texttt','\\hbox'))
    14211421            # add spaces around < and > to help jsMath to parse them
    14221422            x = x.replace('<', ' < ')
    14231423            x = x.replace('>', ' > ')
    14241424        elif has_latex_attr(x):
    1425             x = LatexExpr(x._latex_())
     1425            x = LatexExpr(x._latex_().replace('\\texttt','\\hbox'))
    14261426        else:
    14271427            try:
    14281428                f = latex_table[type(x)]