In this blog article http://www.josephhardinee.com/blog/?p=46 in November 2013, the author quickly goes through the conversion process.
He mentions the need to install the Simple Mathjax plugin to make the equation display work.
Now, what I tested to work on my own Wordpress blog:
- Copy the html tab of the nbconvert output (only what is inside the
<body> ) on the "Text" tab. - disable parsing of Worpress code, because otherwise the images will not be displayed (as explained in the blog post). The following are two possible methods.
- Activate Mathjax: either with the plugin or manually in the zip code
Mathjax With Plugin
I have not tested the Simple Mathjax , but I have LaTeX for WordPress that works for me.
Manual Activation Mathjax
Copy the paste from nbconvert, output two <script> that activate Mathjax:
1) Download the library:
<script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>
2) Run it:
<script type="text/javascript"> init_mathjax = function() { if (window.MathJax) { // MathJax loaded MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ] }, displayAlign: 'left', // Change this to 'center' to center equations. "HTML-CSS": { styles: {'.MathJax_Display': {"margin": 0}} } }); MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } } init_mathjax(); </script>
Disabling HTML Analysis Code
The blog offers to activate the plugin Disable automatic formatting to do the work with a laptop. I tested it successfully, but it has one drawback: it gets confused with providing all other messages ... this is quite a problem!
Instead of Raw HTML , I tested a plugin that allows you to customize each entry. I did work with images by selecting the Disable automatic paragraphs option (the plugin creates a new field in the message editor).
The remaining problems:
while laptops should display this method well, there is still work to ensure that the syntax highlighting of the code cells is displayed correctly. However, the Python source code is already parsed using CodeMirror, so it should just load the appropriate CSS code.