Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11632 closed defect (fixed)

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: Merged in: sage-4.7.2.alpha4
Authors: John Palmieri Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by leif)

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 to the main Sage repository.

Attachments (2)

trac_11632-thematic-conf.patch (935 bytes) - added by jhpalmieri 10 years ago.
trac_11632-thematic-conf.v2.patch (1.0 KB) - added by jhpalmieri 10 years ago.

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by jhpalmieri

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

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

Okay, here's the new version.

Changed 10 years ago by jhpalmieri

comment:5 Changed 10 years ago by jdemeyer

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

comment:6 Changed 10 years 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.