-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Pluggable latex #2974
Pluggable latex #2974
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I tried it alongside your katex extension.
packages/rendermime/src/renderers.ts
Outdated
@@ -135,6 +138,11 @@ namespace renderHTML { | |||
* Whether the node should be typeset. | |||
*/ | |||
shouldTypeset: boolean; | |||
|
|||
/** | |||
* The Latex typesetter for the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, "The LaTeX typesetter" here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same in other places in this file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Probably not for type and variable names, though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed
packages/rendermime/src/latex.ts
Outdated
* Construct the typesetter. | ||
*/ | ||
constructor() { | ||
this._init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps not init here so we don't call this unless we actually render something.
@@ -13,7 +13,7 @@ import 'codemirror/addon/mode/multiplex'; | |||
* Define an IPython GFM (GitHub Flavored Markdown) mode. | |||
* | |||
* Is just a slightly altered GFM Mode with support for latex. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also fix the capitalisation there too?
I'm a little confused as to how this allows both the async and synchronous processing models that MathJax and KaTeX embody (respectively). Could the docs explain that in case someone wants to extend this for a third math processing engine? |
Basically, the |
Great, thanks! |
this is awesome |
Adresses #2280. This adds a
latexTypesetter
property to the application rendermime. It defaults to an implementation using MathJax, but can be swapped for one using another renderer (such as KaTeX). A proof-of-concept extension for KaTeX is here.cc @jasongrout @mpacer