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

Does the plugin support mathjax? #87

Open
huangjj27 opened this issue Nov 29, 2023 · 7 comments
Open

Does the plugin support mathjax? #87

huangjj27 opened this issue Nov 29, 2023 · 7 comments

Comments

@huangjj27
Copy link

I'm in love with mdbook and always write something with math formula in markdown, And I want to make this thing to be published as epub files. However, I found out that the mathjax support for mdbook is output.html only. Does anyone have the same requirement to display math in their epubs ?

@dieterplex
Copy link
Contributor

Adding Mathjax V2 support like mdbook is possible in ePub3 with supported reader. Though mdbook-epub is generating ePub2 book, it may not a big deal.

Some are using mdbook-katex preprocessor that would be more friendly to browserless readers. But it require mdbook-epub to support preprocessor first.

@blandger
Copy link
Collaborator

I did mdbook preprocessor reusing by mdbook-epub in branch

Recently the PR with changes was closed after three years of review. :))

So that is quite possible (e.g. in branch) to clone existing mdbook preprocessor, update it's behaviour and call it in 'per chapter' manner.

@dieterplex
Copy link
Contributor

The approach of preprocessing per chapter may not required? Could it be preprocessed in whole book basis? or we just add mathjas support with user provided template or with a flag?

@blandger
Copy link
Collaborator

The original mdBook preprocessors work that way and process the entire book.

@huangjj27
Copy link
Author

mdbook-katex is a quite good replacement of MathJax. I'm considering to switch to it.

@dieterplex
Copy link
Contributor

The original mdBook preprocessors work that way and process the entire book.

Yeah, but it's not true for mdbook-epub.
As a renderer mdbook-epub itself is not able to invoke preprocessors to modify the content of books.

Another approach to do that can be found at my fork. It utilize MDBook::execute_build_process(&renderer) API to invoke mdbook-epub as a renderer to render preprocessed content. If that is desired, I would send PR here.

@blandger
Copy link
Collaborator

blandger commented Feb 7, 2024

Another approach to do that can be found at my fork.

Is it link to all necessary changes ?? I would like to see all code sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants