Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow latex formulas in HTML output #994

Closed
wants to merge 1 commit into from

3 participants

Pablo Winant Min RK Brian E. Granger
Pablo Winant

Currently latex rendering works for markdown cells and latex output.
However, HTML output containing latex formulas will not be processed until a true latex content is detected (or when entering a markdown cell). Given that HTML output may well contain formulas (e.g a table whose columns are latex variables), it seems natural to call the mathjax renderer after html output too. This is what this patch does.
It looks like Mathjax is caching already computed results, so the overhead may be small even if there are many formulas around.

Min RK
Owner

This seems perfectly sensible to me, thanks! Unless @ellisonbg knows a reason that this would have unsavory side effects, we should go ahead with it.

Brian E. Granger
Owner
Min RK
Owner

Thanks! merged.

Min RK minrk closed this
Michael Droettboom mdboom referenced this pull request from a commit in mdboom/ipython
Pablo Winant albop Latexify formulas contained in html text.
closes gh-994
2ad63d5
Brian E. Granger ellisonbg referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
matthew von rocketstein mattvonrocketstein referenced this pull request from a commit in mattvonrocketstein/ipython
Pablo Winant albop Latexify formulas contained in html text.
closes gh-994
f5faa7e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 13, 2011
  1. Pablo Winant
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 IPython/frontend/html/notebook/static/js/codecell.js
4 IPython/frontend/html/notebook/static/js/codecell.js
View
@@ -243,7 +243,7 @@ var IPython = (function (IPython) {
this.append_mime_type(json, toinsert);
this.element.find('div.output').append(toinsert);
// If we just output latex, typeset it.
- if (json.latex !== undefined) {
+ if ((json.latex !== undefined) || (json.html !== undefined)) {
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
};
};
@@ -295,7 +295,7 @@ var IPython = (function (IPython) {
this.append_mime_type(json, toinsert)
this.element.find('div.output').append(toinsert);
// If we just output latex, typeset it.
- if (json.latex !== undefined) {
+ if ( (json.latex !== undefined) || (json.html !== undefined) ) {
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
};
};
Something went wrong with that request. Please try again.