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

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
Contributor

@blink1073 blink1073 left a 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.

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

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

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
Contributor

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

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
Contributor

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
Contributor

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

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 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

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
Contributor

Great, thanks!

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

this is awesome

@jasongrout jasongrout added this to the 0.28 milestone Sep 6, 2018
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 8, 2019
@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.
Labels
enhancement pkg:markdownviewer status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants