Le mercredi 17 avril 2024 à 16:48 +0000, Ihor Radchenko a écrit :
> Emmanuel Charpentier <emm.charpent...@free.fr> writes:
> 
> > I have a case where the current way of forcing the temporary
> > directory
> > to me `/tmp` is wrong. Running emacs on Ubuntu **under WSL2**,,
> > exporting latex snippets to ODT *as images* fails : the `.dvi`
> > files
> > are correctly compiled and placed in `/tmp{, but the convert
> > program
> > tries to read them in `../../../../tmp/`, which is indeed `/tmp` in
> > a
> > "normal" filesystem but **is not** in WSL, where the root (`/`) is
> > in
> > fact a mounted tree.
> > 
> > Admittedly, this is a corner case, but it turned out to be
> > necessary
> > (exporting via mathml gave unsatisfying results).
> 
> It looks like is a different bug. (probably even in Emacs, when
> calculating relative path)

That might also be an idiosyncratic bug of WSL2' implementation of the
virtual machine filesystem...
> 
> Assuming that your `org-preview-latex-default-process' is using the
> default value of 'dvipng, does it help if you change the image
> convertor
> command to use absolute path?

I didn't know that one could do that : the placeholders are not well
documented...

> 
> (plist-put (alist-get 'dvipng org-preview-latex-process-alist)
>          :image-converter
>            '("dvipng -D %D -T tight -o %O %F"))

Nope, same problem : the *Org Preview LaTeX Output* buffer says :

../../../../../tmp/orgtexSyy18r.dvi: No such file or directory
This is dvipng 1.15 Copyright 2002-2015 Jan-Ake Larsson

If I understand it correctly, the %F placeholder should be an
*absolute* filename. It is not...

Couldn't the output directory of the :latex-compiler element being
hardcoded to, say, the curerent directory or a subdirectory thereof,
and ditto for the input directory of :image-converter ?

Sincerely,



Reply via email to