Use tectonic in org-mode inline LaTeX preview

Hi! I try to use tectonic in emacs’s org-mode inline LaTeX preview. Usually, I need to set a command to tell tectonic how to build a temporarily generated tex file to a xdv file. But using this config:

tectonic %f --outfmt xdv --outdir %o

%f is the name of the tex file, and %o is the directory.
But I got an error:

Reader error: is a directory, /tmp/

The invoking command is:

tectonic /tmp/90a10b3354c1730ba33363855f8ae914bd012bae.tex --outfmt xdv --outdir /tmp/

I don’t know why this happens. How can I solve this?

I solved this by enabling the unstable shell-escape option. Setting the command to

("tectonic -X compile %f -Z shell-escape --outfmt xdv --outdir %o")

and the invoking command will be

tectonic -X compile /tmp/352bf2a154e6f27f41d73dc6f03ebe560f027455.tex -Z shell-escape --outfmt xdv --outdir /tmp/

Then tectonic will compile the file normally.