# Mathjax preprocessing no longer working in PB 4.x #958

Closed
opened this Issue Oct 3, 2017 · 14 comments

Projects
None yet
3 participants
Contributor

### Prerequisites

Check the boxes below by changing them from [ ] to [x].

### Description

We are using a plugin that uses the action/filter hooks created in PB 3.9.7 to drop in our own latex renderer (MathJax), see example. Now, though MathJax is selectable as a renderer, we were also loading some preprocessing scripts that are no longer working.

### Steps to Reproduce

1. Install/enable mathjax plugin
2. drop in the suggested sample latex on a page: $e^{\i \pi} + 1 = 0$

Expected behavior: The second attached image

Actual behavior: The first attached image

### System Information

Pressbooks: 4.3.2
WordPress: 4.8.2
PHP: 7.0

Contributor

Contributor

Member

### connerbw commented Oct 4, 2017

 What's the simplest solution? Remove the line? I'd rather do that, say with a config variable, than add a new filter that may be deprecated soon (math is on our road map). Is that OK?
Member

### connerbw commented Oct 4, 2017

 @greatislander This? #958 (comment)
Contributor

### monkecheese commented Oct 4, 2017 • edited

 Both options are simple for me to implement. BUT I lean toward the latter solution because, moving forward, if mathjax is something you guys are hoping to add to core, then doing the pb_add_latex_shortcode filter hook might be smarter because it's something you might end up using down the line when you circle back on math rendering (per your roadmap). If you find that it isn't helpful and you find a better solution for adding mathjax to core, the filter could be deprecated. Either way though, I'm okay with both options.
Contributor

### monkecheese commented Oct 4, 2017

 On second thought, I can appreciate why you wouldn't want to add a new filter that is more or less likely to be deprecated later. The safer bet might actually be to do the first suggestion for now.
Member

### greatislander commented Oct 4, 2017

 If you wouldn't mind submitting a PR I'd be happy to merge in the AM. Thanks for talking this through with us!
Contributor

### monkecheese commented Oct 4, 2017 • edited

 PR submitted: #959
Contributor

### monkecheese commented Oct 5, 2017

 I just saw the comment about using a config variable instead of checking the pb_enqueue_latex_scripts hook (not sure how I missed that). If that's preferred, I'd be happy to update the PR. Cheers!
Member

### greatislander commented Oct 5, 2017

 All good, just merged #959.