Ticket #8633 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

remove more instances of 'texttt' from jsmath output

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

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

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

Change History

Changed 3 years ago by jhpalmieri

comment:1 Changed 3 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 3 years ago by jhpalmieri

  • Status changed from new to needs_review

Yes, it's ready for review.

comment:3 Changed 3 years ago by novoselt

  • Status changed from needs_review to positive_review

comment:4 Changed 3 years ago by novoselt

  • Reviewers set to Andrey Novoseltsev

comment:5 Changed 3 years ago by jhpalmieri

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

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

comment:6 Changed 3 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 3 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 3 years ago by jhpalmieri

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

Note: See TracTickets for help on using tickets.