Hi there.
I have recently re-installed emacs to use org-mode again, and I am trying to get nice previews or latex equations and fragments in org-mode (on macOS using emacs-mac). The default `dvisvgm` works nicely, however it seems lualatex cannot easily be used to create dvi images, as such I have to try something else. I wish to use lualatex for nice fonts and for drawing diagrams (some of the packages I wish to sue require the use of lualatex to compile).
My current process is to compile to pdf using the following preamble
```latex
\documentclass[preview, border=1pt]{standalone}
\usepackage{usenames}[color]
[PACKAGES]
[DEFAULT-PACKAGES]
\pagestyle{empty}
```
In above, `[DEFAULT-PACKAGES]` is defined based on `org-latex-default-packages-alist` and `[PACKAGES]` is defined based on `org-latex-packages-alist` which right now only contains the `physics` package and the `firamath-otf` package.
I then use the utility `pdf2svg` to convert the resulting pdf into a svg. Everything works beautifully, except the svg images created from inline latex fragments have additional whitespace to the right of them, as if they were display equations (although the styling is inline and the are not centre justified). This does not seem to be the case if I create a tex file with the same equation, compile it with the same preamble and then convert to an svg, so I am struggling to figure out what might be changing within emacs to include the additional whitespace in the svg.
I struggling to read elisp, and nothing seems obvious to me. Perhaps someone could give me some insight, or at least give me some help with debugging? How could I say, alter the functions that create the preview such that generated latex file is also saved somewhere? That would help me a lot in figuring out what is going on.
Thanks in advance.
P.S. this is the exact process I am using:
```elisp
(setq luasvg '(luasvg :programs ("lualatex" "pdf2svg")
:description "pdf > svg"
:message "you need to install lualatex and imagemagick."
:use-xcolor t
:image-input-type "pdf"
:image-output-type "svg"
:image-size-adjust (1.0 . 1.0)
:latex-compiler ("lualatex -shell-escape -interaction nonstopmode -output-directory %o %f")
:image-converter ("pdf2svg %f %O")))
(setq org-preview-latex-default-process 'luasvg)
```