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

[WIP] feat: html via tex4ht, tweaked #6

Closed
wants to merge 15 commits into from
Closed

[WIP] feat: html via tex4ht, tweaked #6

wants to merge 15 commits into from

Conversation

pkra
Copy link
Collaborator

@pkra pkra commented Jan 30, 2021

Build notes

First draft issues

  • equation ref => manually fixed (added tag, wrapped in math mode)
  • added macros to HTML manually => through make4ht
  • added css for body max-width
  • removed odd MathJax config and changed to SVG
  • hand fixed SVGs (only partially) - now dvisvgm based - yay!

Notes on make4ht

  • random tspan (smallcaps) - disable font processing via NoFonts
  • 1 png - now svg via dvisvgm
  • title is h2, no main, no landmarks
  • anchors with just id -- need rewriting, e.g., $$('a[id]:not([href])').forEach(node => node.parentNode.setAttribute('id', node.getAttribute('id')) && node.remove())
  • TOC is span soup with nbsps (instead of nav with nested lists) - maybe just drop and do in post-processing?
  • theorem need styling; all have the same class
  • img alt is bad (diagrams)
  • qed just floats right => needs fixng

other todo's

  • \intertext - maybe \rlap{\text{...}} is ok?
    • Yes but better: define \intertext as a a mathjax macro using rlap and closing the rows
  • macros via mathjax configuration
  • work out how to add extra styles properly

@pkra
Copy link
Collaborator Author

pkra commented Jan 30, 2021

Overall pretty straight forward

@pkra
Copy link
Collaborator Author

pkra commented Jan 30, 2021

Pushed latest version - working SVGs now.

@pkra
Copy link
Collaborator Author

pkra commented Jan 30, 2021

Fun bug found: mathjax/MathJax#2624

@pkra
Copy link
Collaborator Author

pkra commented Jan 30, 2021

Oooh. nofont is NoFonts...

@pkra
Copy link
Collaborator Author

pkra commented Jan 30, 2021

Some nice tips from the developer of make4ht at michal-h21/make4ht#42

@pkra
Copy link
Collaborator Author

pkra commented Jan 30, 2021

I'll need to remember https://www.kodymirus.cz/tex4ht-doc/Introduction.html ...

@pkra
Copy link
Collaborator Author

pkra commented Jan 30, 2021

Time for a make4ht configuration...

@michal-h21
Copy link

I see this in the ToDo list:

  • random tspan (smallcaps) - disable font processing?

tspan elements can be introduced by TikZ. I don't know if you use it in this project (I just saw that you linked it from the make4ht issue), but if yes, then it is likely caused by that. You can use the alternative TikZ driver, it shouldn't suffer from this issue and it has better support of formatting inside TikZ text nodes.

@pkra
Copy link
Collaborator Author

pkra commented Jan 30, 2021

Thanks @michal-h21.

random tspan (smallcaps) - disable font processing?

This was actually in theorem heads. Here's an example from the first commit:

2.3. <tspan font-family="pplrc7t" font-size="">P<span
.

You can use the alternative TikZ driver

Thanks, I did switch to that driver (or rather: finally got it to work). It's soooo much better - utf8 encoding, no random closing p tags, no g's inside text / around tspan elements. And so much easier than moving things to standalone.

@michal-h21
Copy link

Thanks, I did switch to that driver (or rather: finally got it to work). It's soooo much better - utf8 encoding, no random closing p tags, no g's inside text / around tspan elements. And so much easier than moving things to standalone.

Another way is also TikZ externalization, but it is slower and requires more configurations. This is much easier and in most cases better solution.

@pkra
Copy link
Collaborator Author

pkra commented Feb 11, 2021

@scoskey take another look when you get the chance. Should now workly smoothly. Two commits touch the TeX source - one to fix the whitespace, one to wrap the eqref. The rest is now in the config 🎉

@pkra
Copy link
Collaborator Author

pkra commented Jun 22, 2023

@scoskey closing this but let's chat about it next time.

@pkra pkra closed this Jun 22, 2023
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

Successfully merging this pull request may close these issues.

3 participants