Modular LaTeX Render Options

I’ve started a PR (#583), that exhibits the hacks we currently use at Lumen that adds a few more latex renderer options. It seems like it is similar-ish to the filter hooks used in import. Any thoughts? I’ll look at it further, but some of the script tag stuff seems a little messy and like maybe there’d be a better way to deal with that.

Yes, I think we can definitely streamline the script tag components. I’d also like to diff PB-LaTeX and the current version of WP LaTex. My understanding (@brad, please correct me if I’m wrong) is that PB-LaTeX is a fork of an earlier version that removes support for self-hosted LaTeX instances, but there may be some changes in the current version that are worth incorporating.

yes, v1.8 I believe. I don’t remember exactly what I stripped out but there were a bunch of latex rendering services. In order to get the export routine to work I had to choose one. https://github.com/pressbooks/pressbooks/blob/dev/includes/modules/export/epub/class-pb-epub201.php#L1792

1 Like

Alright, the current PR is ready for review here.

And here is our plugin’s changes that utilize the hooks to pull in MathJax and Katex here.

1 Like

Merged! Thanks for your work on this.

Wow awesome! No problem ned.

Do you think you can make your alternative renderers available as a small standalone plugin soon?

Yeah i think i can do that. The MathJax renderer we can do anyway. The other one’s aren’t really setup for public consumption. I’ll see what I can come up with.

1 Like

@ned, what would you prefer the standalone plugin be named? taking suggestions. :slight_smile:

we call our internal plugins candela-*name-here*. or we could just call it pressbooks-latex or pressbooks-mathjax.

¯_(ツ)_/¯

I’m in favour of pressbooks-mathjax just to avoid confusion between that and @brad’s original pb-latex. :+1:

1 Like

Here’s what I came up with @ned! It’s tested and seems to work as expected on my local instances.

https://github.com/lumenlearning/pressbooks-mathjax

1 Like