The setup:

I have a docker container connected with a mounted volume containing an org file. The docker container has both texlive and emacs (configured exactly the way it is on my host) installed. I can open the org file and run org-latex-preview on the math components without any problems.

The problem:

I recently installed docker-tramp and figured I wouldn't need a separate installation of emacs in my docker containers. However, when I opened the same org file and ran org-latex-preview I got the following message in the *Org Preview LaTeX Output* buffer:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
! I can't find file `/tmp/orgtextfP6YZ.tex'.
<*> /tmp/orgtextfP6YZ.tex
(Press Enter to retry, or Control-D to exit)
Please type another input file name
! Emergency stop.
<*> /tmp/orgtextfP6YZ.tex
No pages of output.
Transcript written on /tmp//texput.log

Now the orgtextfP6YZ.tex file is not in the docker container's /tmp folder; however, it has been generated in the host's /tmp folder. So the command that org-latex-preview uses (dvipng) accesses the host's /tmp folder, which means that dvipng was run on the host rather than the remote (docker container).

When I'm using a buffer I accessed through docker-tramp, any command I call using M-! runs in the remote. So how do I configure it (or TRAMP in general) so that commands used indirectly (called by a function in emacs) are also run in the remote?

  • I don't know the answer but it's probably worth opening an issue on the docker-tramp github. – NickD Nov 30 '20 at 14:19
  • I've edited the question as things became clearer to me. It seems more like a TRAMP issue than a docker-tramp issue, but I could be wrong. – aNaravi Nov 30 '20 at 15:28

See the function org--latex-preview-region. There's the comment

;; Emacs cannot overlay images from remote hosts.  Create it in
;; `temporary-file-directory' instead.

Running on a remote host is disabled by intention.

OTOH, everything you start with M-! (or M-&) is given to a shell, which can run also remotely.

  • Well, I was definitely looking under the wrong hood - the problem lies with org and not tramp. Is there any way around this? I found a patch that was apparently rejected. – aNaravi Dec 1 '20 at 8:32
  • No idea. I don't use org. – Michael Albinus Dec 1 '20 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.