Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conf.py in thematic_tutorials overwrites jsmath macros #11632

Closed
jhpalmieri opened this issue Jul 26, 2011 · 9 comments
Closed

conf.py in thematic_tutorials overwrites jsmath macros #11632

jhpalmieri opened this issue Jul 26, 2011 · 9 comments

Comments

@jhpalmieri
Copy link
Member

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 attachment: trac_11632-thematic-conf.v2.patch to the main Sage repository.

Component: documentation

Author: John Palmieri

Reviewer: Jeroen Demeyer

Merged: sage-4.7.2.alpha4

Issue created by migration from https://trac.sagemath.org/ticket/11632

@hivert
Copy link

hivert commented Jul 28, 2011

comment:1

Attachment: trac_11632-thematic-conf.patch.gz

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 ?

@jhpalmieri
Copy link
Member Author

comment:2

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

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

if you think that would be a good idea.

@jdemeyer
Copy link

jdemeyer commented Oct 7, 2011

comment:3

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).

@jhpalmieri
Copy link
Member Author

comment:4

Okay, here's the new version.

@jhpalmieri

This comment has been minimized.

@jdemeyer
Copy link

jdemeyer commented Oct 8, 2011

Merged: sage-4.7.2.alpha4

@jdemeyer
Copy link

jdemeyer commented Oct 8, 2011

comment:5

Attachment: trac_11632-thematic-conf.v2.patch.gz

@jdemeyer
Copy link

jdemeyer commented Oct 8, 2011

Reviewer: Jeroen Demeyer

@nexttime

This comment has been minimized.

@nexttime nexttime mannequin changed the title conf.py in thematics tutorial overwrites jsmath macros conf.py in thematic_tutorials overwrites jsmath macros Oct 8, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants