Skip to content
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

Merged
merged 9 commits into from Sep 8, 2017
Merged

Pluggable latex #2974

merged 9 commits into from Sep 8, 2017

Conversation

@ian-r-rose
Copy link
Member

@ian-r-rose ian-r-rose commented Sep 6, 2017

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

Copy link
Member

@blink1073 blink1073 left a comment

Looks great! I tried it alongside your katex extension.

@@ -135,6 +138,11 @@ namespace renderHTML {
* Whether the node should be typeset.
*/
shouldTypeset: boolean;

/**
* The Latex typesetter for the application.
Copy link
Member

@blink1073 blink1073 Sep 6, 2017

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?

Copy link
Member

@blink1073 blink1073 Sep 6, 2017

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)

Copy link
Member Author

@ian-r-rose ian-r-rose Sep 6, 2017

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?

Copy link
Member

@blink1073 blink1073 Sep 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

* Construct the typesetter.
*/
constructor() {
this._init();
Copy link
Member

@blink1073 blink1073 Sep 6, 2017

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.
Copy link
Member

@mpacer mpacer Sep 6, 2017

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?

@mpacer
Copy link
Member

@mpacer mpacer commented Sep 6, 2017

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?

@ian-r-rose
Copy link
Member Author

@ian-r-rose ian-r-rose commented Sep 6, 2017

Basically, the typeset API does not care whether the typesetting is done asynchronously (as with MathJax), or synchronously (as with KaTeX). Because it does not return a Promise, however, there is no way to hook into the point at which MathJax is done rendering.

@blink1073
Copy link
Member

@blink1073 blink1073 commented Sep 8, 2017

Great, thanks!

@blink1073 blink1073 merged commit cfae0a6 into jupyterlab:master Sep 8, 2017
2 checks passed
@blink1073 blink1073 mentioned this pull request Oct 9, 2017
@scottdraves
Copy link
Contributor

@scottdraves scottdraves commented Oct 26, 2017

this is awesome

@jasongrout jasongrout added this to the 0.28 milestone Sep 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants