Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency between Xenops external command input and latex engine #70

Open
deshearth opened this issue Mar 8, 2024 · 2 comments
Open

Comments

@deshearth
Copy link

deshearth commented Mar 8, 2024

In tex file generated by Xenops (located at /var/folder/... and it can be found by click copy failing command), it uses a package called "fontspec". But the compiling engine is latex. So if I run failing command in terminal, the error is that lualatex or xelatex is required to use the package. I wonder how this tex file is generated and is there any way to customize the preamble. I know that variable org-format-latex-header can be set. But in the tex file generated by Xenops, there are a few other packages, such as "fontspec".

@mglnsk
Copy link

mglnsk commented Feb 11, 2025

There exists a possible workaround -- using similar approach to configuring the default org-latex-preview for lualatex (relevant stackoverflow answer). As xenops exposes similar variables, it is possible to set:

(setq luasvgmpreview '(luasvgm :programs ("lualatex" "dvisvgm")
                :description "dvi > svg"
                :message "you need to install lualatex and dvisvgm."
                :image-input-type "dvi"
                :image-output-type "svg"
                :image-size-adjust (2.0 . 2.0)
                :latex-compiler
                ("lualatex --interaction=nonstopmode --shell-escape --output-format=dvi --output-directory=%o %f")
                :image-converter
                ("dvisvgm %f -n -b min -c %S -o %O")))
(add-to-list 'xenops-math-latex-process-alist luasvgmpreview)
(setq xenops-math-latex-process 'luasvgm)

This makes xenops use the lualatex compiler to generate previews.

@dandavison
Copy link
Owner

dandavison commented Feb 11, 2025

Hello, sorry about the very minimal level of support I provide for xenops!

I use lualatex personally when I use xenops. Here's the commit I use for this: ff0afa4

As you can see I literally just replace the :latex-compiler in xenops-math-latex-process-alist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants