When temporary-file-directory resolves to a Windows 8.3 short path
(e.g. C:\Users\MYLONG~1\AppData\Local\Temp\), Org Mode fails to generate
LaTeX previews.
org-compile-file: File "...orgtexXXXX.dvi" wasn't produced. Please
adjust 'dvipng' part of 'org-preview-latex-process-alist'.
Environment:
OS: Windows
GNU Emacs: 30.2
Org Mode: 9.7.11
MiKTeX: 26.5
Preview backend: dvipng
Both latex and dvipng are installed and function correctly.
Running the command generated by Org revealed that LaTeX receives a
malformed filename.
Instead of
../../../MYLONG~1/AppData/Local/Temp/orgtexXXXX.tex
LaTeX receives
../../../MYLONG\~1/AppData/Local/Temp/orgtexXXXX.tex
which produces
! I can't find file '../../../MYLONG'.
`\~` is interpreted by TeX as an accent command, the filename is no longer
parsed correctly.
Changing temporary-file-directory to use the long Windows path resolves the
issue.
(setq temporary-file-directory
(expand-file-name "~/../Local/Temp/"))
------------------------------------------------------------------------
Emacs : GNU Emacs 30.2 (build 2, x86_64-w64-mingw32)
of 2025-08-15
Package: Org mode version 9.7.11 (release_9.7.11 @
c:/Dev/emacs/emacs-30.2/share/emacs/30.2/lisp/org/)