Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8633 closed defect (fixed)

remove more instances of 'texttt' from jsmath output

Reported by: jhpalmieri Owned by: tbd
Priority: major Milestone: sage-4.4
Component: misc Keywords:
Cc: Merged in: sage-4.4.alpha0
Authors: John Palmieri Reviewers: Andrey Novoseltsev
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Try this in the notebook with the "Typeset" box checked:

random_matrix(ZZ, 5, 5).eigenvalues()

You will see a box saying "Unknown control sequence '\texttt'". The attached patch fixes this by replacing "\texttt" with "\hbox" before processing the LaTeX string with jsMath.

This was reported on sage-support.

Attachments (1)

trac_8633-texttt.patch (1.1 KB) - added by jhpalmieri 11 years ago.

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by jhpalmieri

comment:1 Changed 11 years ago by novoselt

Works for me (I had another case of \texttt - thank you for providing such a timely patch!) and for the given code.

Is it ready for review? The patch does not add any doctests, but I am not sure if it is possible to test such an issue in doctests. At least it does not break any existing ones.

comment:2 Changed 11 years ago by jhpalmieri

  • Status changed from new to needs_review

Yes, it's ready for review.

comment:3 Changed 11 years ago by novoselt

  • Status changed from needs_review to positive_review

comment:4 Changed 11 years ago by novoselt

  • Reviewers set to Andrey Novoseltsev

comment:5 Changed 11 years ago by jhpalmieri

  • Merged in set to sage-4.4.alpha0
  • Resolution set to fixed
  • Status changed from positive_review to closed

Merged "trac_8633-texttt.patch" in 4.4.alpha0.

comment:6 Changed 11 years ago by jason

I get the same problem on 4.4.2 with

html.table([random_matrix(ZZ, 5, 5).eigenvalues()])

even though the example in this ticket does work.

comment:7 Changed 11 years ago by jhpalmieri

I think that the two calls to latex in sage/misc/html.py need to be changed from

latex(XXX)

to

latex(XXX).replace('\\texttt','\\hbox')

Open another ticket, cc me, and post a patch.

comment:8 Changed 11 years ago by jhpalmieri

(Oh, and add a doctest in the patch.)

Note: See TracTickets for help on using tickets.