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

Allow customization for MathJax #501

Open
mseri opened this issue Aug 26, 2024 · 1 comment
Open

Allow customization for MathJax #501

mseri opened this issue Aug 26, 2024 · 1 comment
Assignees

Comments

@mseri
Copy link

mseri commented Aug 26, 2024

Feature Description

LaTeX lwarp package allows to export books in HTML which are almost completely compatible with pressbooks. Only one feature has problems: equation numbering.

It would be great if pressbooks could support enabling the hidden form and the small javascript customization needed to enable automatic equation numbering and cross-reference.
This is an essential feature for many advanced mathematics and theoretical physics books, and being able to use latex to generate the content is also an helpful improvement for the editing.

Feature Use Case

Advanced mathematics and physics textbooks often require to cross-link equations referring to the equation numbers. MathJax allows one to do this, but it requires some customizations in javascript.

Since this is cumbersome and error prone to do by hand, do it in a way compatible with lwarp could also simplify porting existing latex content to pressbooks.

Example

In this Exercise, clicking on (1.84) sends the user to the corresponding equation.

What is needed

The javascript customization is the same in all cases and it is the following: https://github.com/mseri/hammech20/blob/3d4e085b1a74ad7e1812e552266fb8c44181ddbf/chapter-1.html#L12-L231

In addition, an invisible div seems to be needed in the body to properly inject the relevant extra macros. In my case, this looks like
https://github.com/mseri/hammech20/blob/3d4e085b1a74ad7e1812e552266fb8c44181ddbf/chapter-1.html#L474-L647
I think this one may vary depending on the latex packages and macros needed.

@SteelWagstaff
Copy link
Member

Research needed.

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

4 participants
@cmurtagh @mseri @SteelWagstaff and others