Fixed font issue for nbviewer.

The Neo-Euler was rendering with no subscripts or superscripts.
Not sure why, but I swithed to the "TeX" font and all is well.
This commit is contained in:
Roger Labbe 2015-07-19 10:51:32 -07:00
parent 96b3409da0
commit ca88bd82b3
2 changed files with 14 additions and 11 deletions

View File

@ -1,14 +1,17 @@
# -*- coding: utf-8 -*-
from contextlib import contextmanager
from IPython.core.display import HTML
import json
import matplotlib.pylab as pylab
import matplotlib.pyplot as plt
import json
import numpy as np
import os.path
import sys
from contextlib import contextmanager
sys.path.insert(0,'./code') # allow us to import book_format
sys.path.insert(0, './code') # allow us to import book_format
def test_filterpy_version():
import filterpy
@ -96,14 +99,14 @@ def _decode_dict(data):
return rv
def load_style(directory = '.', name='/code/custom.css'):
def load_style(directory = '.', name='code/custom.css'):
if sys.version_info[0] >= 3:
s = json.load(open(directory + "/code/538.json"))
s = json.load(open(os.path.join(directory, "code/538.json")))
else:
s = json.load(open(directory + "/code/538.json"), object_hook=_decode_dict)
plt.rcParams.update(s)
reset_axis ()
np.set_printoptions(suppress=True)
styles = open(directory + name, 'r').read()
styles = open(os.path.join(directory, name), 'r').read()
return HTML(styles)

View File

@ -213,12 +213,12 @@
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
},
displayAlign: 'center', // Change this to 'center' to center equations.
displayAlign: 'left', // Change this to 'center' to center equations.
"HTML-CSS": {
scale:85,
availableFonts: ["Neo-Euler"],
preferredFont: "Neo-Euler",
webFont: "Neo-Euler",
scale:100,
availableFonts: [],
preferredFont:null,
webFont: "TeX",
styles: {'.MathJax_Display': {"margin": 4}}
}
});