MathJax-demos-node icon indicating copy to clipboard operation
MathJax-demos-node copied to clipboard

Bussproofs

Open alex-mashin opened this issue 11 months ago • 2 comments

The Bussproofs extension seem not to work with the tex2mml-page extension. All maths fail with the error "The bussproofs extension requires an output jax with a getBBox() method". Other TeX extensions work.

alex-mashin avatar Mar 12 '25 11:03 alex-mashin

That is correct. The tex2mml-page command does not load an output jax (conversion to MathML doesn't require one in general). The bussproofs package, however, does require an output jax because it needs to be able to determine the size of the output in order to do its complicated layout.

While it would be possible to modify tex2mml-page to load an output jax, that won't actually help, because the output jax can't produce measurements unless there is an actual DOM to work with, and that requires a browser. The LiteDOM used in the node-based applications doesn't know how to measure the resulting DOM elements.

The upshot is you can't do command-line processing using the bussproofs package using this command. The only choice would be to use something like headless Chrome through puppeteer. There is an tex2svg example in the puppeteer directory that you might be able to modify to accomplish your goal.

dpvc avatar Mar 16 '25 13:03 dpvc

That is correct. The tex2mml-page command does not load an output jax (conversion to MathML doesn't require one in general). The bussproofs package, however, does require an output jax because it needs to be able to determine the size of the output in order to do its complicated layout.

While it would be possible to modify tex2mml-page to load an output jax, that won't actually help, because the output jax can't produce measurements unless there is an actual DOM to work with, and that requires a browser. The LiteDOM used in the node-based applications doesn't know how to measure the resulting DOM elements.

The upshot is you can't do command-line processing using the bussproofs package using this command. The only choice would be to use something like headless Chrome through puppeteer. There is an tex2svg example in the puppeteer directory that you might be able to modify to accomplish your goal.

Thank you for sharing this most valuable lnsight. I don't know if I ever try to solve this problem (it is not pressing; just a single TeX extension that I cannot use, but was not going anyway). If I ever do, perhaps the solution would be convert to SVG only prooftrees by a separate service (based on Puppeteer, as you suggested), before submitting the web page to the main TeX to MML application.

alex-mashin avatar Mar 16 '25 14:03 alex-mashin