Ticket #11632 (closed defect: fixed)

Opened 22 months ago

Last modified 20 months ago

conf.py in thematic_tutorials overwrites jsmath macros

Reported by: jhpalmieri Owned by: mvngu
Priority: minor Milestone: sage-4.7.2
Component: documentation Keywords:
Cc: Work issues:
Report Upstream: N/A Reviewers: Jeroen Demeyer
Authors: John Palmieri Merged in: sage-4.7.2.alpha4
Dependencies: Stopgaps:

Description (last modified by leif) (diff)

Because of the line

html_theme_options['jsmath_macros'] = ["mathfrak : ['\\\\mathbf{#1}', 1]"]

in thematic_tutorials/conf.py, existing jsmath macros are overwritten, so Sage-specific macros like \QQ don't work. The attached patch fixes this.

Apply trac_11632-thematic-conf.v2.patch Download to the main Sage repository.

Attachments

trac_11632-thematic-conf.patch Download (935 bytes) - added by jhpalmieri 22 months ago.
trac_11632-thematic-conf.v2.patch Download (1.0 KB) - added by jhpalmieri 20 months ago.

Change History

Changed 22 months ago by jhpalmieri

comment:1 Changed 22 months ago by hivert

Hi john,

Is there any missing dependencies ? On

popcorn-*evel/sage-review $ sage -version
| Sage Version 4.7, Release Date: 2011-05-23                         |

with just the patch applied I get:

Exception occurred:
  File "/home/florent/src/Sage/sage/devel/sage/doc/en/thematic_tutorials/conf.py", line 35, in <module>
    html_theme_options['jsmath_macros'].append("mathfrak : ['\\\\mathbf{#1}', 1]")
KeyError: 'jsmath_macros'
The full traceback has been saved in /tmp/sphinx-err-IGtEC6.log, if you want to report the issue to the developers.

Or should it be applied on some dev version ?

comment:2 follow-up: ↓ 3 Changed 22 months ago by jhpalmieri

  • Status changed from new to needs_review

I can't reproduce this; I've tried on two different machines with vanilla versions of Sage 4.7. (I wrote the patch based on 4.7.1.rc0, but I don't think anything relevant has changed since 4.7.) I can change the patch to

  • doc/en/thematic_tutorials/conf.py

    diff --git a/doc/en/thematic_tutorials/conf.py b/doc/en/thematic_tutorials/conf.py
    a b htmlhelp_basename = "thematic_tutorials" 
    3232# following line turns it into bold face only when using jsMath, thus 
    3333# avoiding the errors, while keeping the nice mathfrak fonts when not 
    3434# using jsMath. 
    35 html_theme_options['jsmath_macros'] = ["mathfrak : ['\\\\mathbf{#1}', 1]"] 
     35try: 
     36    html_theme_options['jsmath_macros'].append("mathfrak : ['\\\\mathbf{#1}', 1]") 
     37except KeyError: 
     38    html_theme_options['jsmath_macros'] = ["mathfrak : ['\\\\mathbf{#1}', 1]"] 
    3639 
    3740# Grouping the document tree into LaTeX files. List of tuples 
    3841# (source start file, target name, title, author, 

if you think that would be a good idea.

comment:3 in reply to: ↑ 2 Changed 20 months ago by jdemeyer

  • Status changed from needs_review to needs_work

Replying to jhpalmieri:

if you think that would be a good idea.

Yes, please do it. The problem mentioned by hivert is reproducible with sage-4.7.2.alpha3 (note you need to delete the devel/sage/doc/output directory before testing).

comment:4 Changed 20 months ago by jhpalmieri

  • Status changed from needs_work to needs_review
  • Description modified (diff)

Okay, here's the new version.

Changed 20 months ago by jhpalmieri

comment:5 Changed 20 months ago by jdemeyer

  • Status changed from needs_review to closed
  • Reviewers set to Jeroen Demeyer
  • Resolution set to fixed
  • Merged in set to sage-4.7.2.alpha4

comment:6 Changed 20 months ago by leif

  • Description modified (diff)
  • Summary changed from conf.py in thematics tutorial overwrites jsmath macros to conf.py in thematic_tutorials overwrites jsmath macros
Note: See TracTickets for help on using tickets.