[IPython-dev] Equation rending in html produced via 'ipython nbconvert --to html' not working
Fangohr H.
H.FANGOHR at soton.ac.uk
Tue Sep 2 11:11:42 EDT 2014
Thanks to all the answers.
On 2 Sep 2014, at 13:11, Jens Nielsen <jenshnielsen at gmail.com<mailto:jenshnielsen at gmail.com>> wrote:
Looking at the source I think this is #6392
https://github.com/ipython/ipython/issues/6392
You can probably modify the link to mathjax either in the template and reexport or just in the html as a work around.
Yes, this is the one: the server c328740.ssl.cf1.rackcdn.com<http://ssl.cf1.rackcdn.com> needs to be replaced by cdn.mathjax.org<http://cdn.mathjax.org>, then it works.
I understand that this is meant to be fixed in 2.2 (based on the comments in https://github.com/ipython/ipython/issues/6392) although it seems not to be fixed yet from my experience. Should I file this as a bug report?
Just in case others have the same issue: A cheap way to fix this (without having to modify ipython-notebook source) for file x.html is this:
sed -i .bak s/c328740.ssl.cf1.rackcdn.com/cdn.mathjax.org/<http://ssl.cf1.rackcdn.com/cdn.mathjax.org/> x.html
To do it for all files in subtree, we can use
find . -name '*.html' -exec sed -i .bak s/c328740.ssl.cf1.rackcdn.com/cdn.mathjax.org/<http://ssl.cf1.rackcdn.com/cdn.mathjax.org/> '{}' \;
Thanks,
Hans
/Jens
On Tue, Sep 2, 2014 at 1:06 PM, Matthias Bussonnier <bussonniermatthias at gmail.com<mailto:bussonniermatthias at gmail.com>> wrote:
Le 2 sept. 2014 à 02:19, Fangohr H. <H.FANGOHR at soton.ac.uk<mailto:H.FANGOHR at soton.ac.uk>> a écrit :
> Dear IPython team and users,
>
> it looks like I am having an installation/configuration/some-other issue on OS X 10.9.4 that leads to this behaviour:
>
> for a notebook x.ipynb (available at http://www.southampton.ac.uk/~fangohr/temp/nbconvert-html-issue/x.ipynb)
> that contains a markdown cell with input “$x^2$”, the output x.html
> (available at http://www.southampton.ac.uk/~fangohr/temp/nbconvert-html-issue/x.html)
> is not rendered correctly when an html version of the notebook is produced using “ipython nbconvert —to html x.ipynb”.
The file you link to works for me; are you previewing the file with the file:// protocol, or with a local http server ?
If it is with file:// then it does not work for security reason at browser level.
—
M
>
> nbconvert-html-issue $> ipython nbconvert --to html x.ipynb
> [NbConvertApp] Using existing profile dir: u'/Users/fangohr/.ipython/profile_default'
> [NbConvertApp] Converting notebook x.ipynb to html
> [NbConvertApp] Support files will be in x_files/
> [NbConvertApp] Loaded template full.tpl
> [NbConvertApp] Writing 184105 bytes to x.html
>
> Both files are available at http://www.southampton.ac.uk/~fangohr/temp/nbconvert-html-issue/
>
> When http://www.southampton.ac.uk/~fangohr/temp/nbconvert-html-issue/x.html is opened in Safari (or Firefox), the equation shows as the source, i.e. "$x^2$” (including the dollars) or - when Node.js was not installed as something like “\(x\^2\)”.
>
> I was hoping for a (mathjax) representation of $x^2$ as in rendered latex, i.e. the 2 in superscript.
>
> This used to work in the past, although I can’t make it work now.
>
>
> Some additional information:
>
> I started from a new installation of Python via Anaconda 2.0 (Python 2.7, 64 bit for OS X), then updated conda, anaconda, ipython and python-notebook.
>
> $> ipython --version
> 2.2.0
> $> ipython notebook --version
> 2.2.0
> $> ipython nbconvert --version
> 2.2.0
>
>
> The output of ‘iptest’ is available at http://www.southampton.ac.uk/~fangohr/temp/nbconvert-html-issue/iptest.log
>
>
> Can anybody else see this problem? Any ideas what I am missing?
>
>
> Many thanks,
>
> Hans
>
>
>
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org<mailto:IPython-dev at scipy.org>
> http://mail.scipy.org/mailman/listinfo/ipython-dev
_______________________________________________
IPython-dev mailing list
IPython-dev at scipy.org<mailto:IPython-dev at scipy.org>
http://mail.scipy.org/mailman/listinfo/ipython-dev
_______________________________________________
IPython-dev mailing list
IPython-dev at scipy.org<mailto:IPython-dev at scipy.org>
http://mail.scipy.org/mailman/listinfo/ipython-dev
More information about the IPython-dev
mailing list