emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andrew Berger <andbberger@gmail.com>
To: emacs-orgmode@gnu.org
Subject: org-latex-preview symlink handling
Date: Wed, 29 May 2024 01:44:19 -0700	[thread overview]
Message-ID: <CADCSoY17XzKjE44re+X7cL-PwMwGvydR0GVOdEHz5HXYs5netA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]

Long listener, first time caller

org-latex-preview was failing with: org-compile-file: File
"/private/var/folders/5b/m1bt7sss2n19dwg1d62h_hrw0000gn/T/orgtexGt3N0x.dvi"
wasn’t produced. Please adjust ‘dvipng’ part of
‘org-preview-latex-process-alist’.

Root cause was that on my system ~/org is a symlink to some icloud auto
sync directory (for beorg).

After much stumbling (despite my 10+ years of daily emacs use I haven't
much explored the lispy bowels!) I landed on the following solution:

    (setq org-preview-latex-process-alist
          '((dvipng :programs ("latex" "dvipng")
                    :description "dvi > png"
                    :message "You need to install the programs: latex and
dvipng."
                    :image-input-type "dvi"
                    :image-output-type "png"
                    :image-size-adjust (1.0 . 1.0)
                    :latex-compiler ("latex -interaction nonstopmode
-output-directory %o %f")
                    :image-converter ("dvipng -D %D -T tight -o %o/%b.png
%o/%b.dvi"))))

    (defun my/org-latex-preview ()
      (let ((find-file-visit-truename t)
            (vc-follow-symlinks t))
        (org-latex-preview)))

    (defun my/org-latex-preview-buffer ()
      (let ((find-file-visit-truename t)
            (vc-follow-symlinks t))
        (org-latex-preview-buffer)))

Could the default symlink behavior be improved?

A

[-- Attachment #2: Type: text/html, Size: 1843 bytes --]

             reply	other threads:[~2024-05-29  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29  8:44 Andrew Berger [this message]
2024-05-29 13:25 ` org-latex-preview symlink handling Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADCSoY17XzKjE44re+X7cL-PwMwGvydR0GVOdEHz5HXYs5netA@mail.gmail.com \
    --to=andbberger@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).