I want to use mathJax to render equations as PDFs on my mac application.
My idea is to use a webview to render the equation from a latex expression and capture that webview in a pdf. I managed to get this scheme working more or less but I still have a few issues.
First, there is an api to generate a PDF from the webview rendering and I can specify the rectangle I wish to capture but I'm not sure how to figure out the dimensions and location of the equation. I got pretty close to it by putting the equation in a div with "fit-content" width and height, but calling getBoundingClientRect on the div gives me a slightly too big of a rectangle.
Second, I need to know where the baseline of the equation lies. Is this information available? How can I access it?
Third, I want to be able to render equations offline, how do I package all the necessary code into my app - I mean, is there a package I can download that includes all the code and resources that are needed?
Last, but maybe it should be first, is the quality of rendering on HTML sufficient? I noticed, for example that for square root, there is a gap between the symbol and the horizontal line above the numbers. (see here: https://s3.amazonaws.com/mellel.outbox/square-root-issue.png)