A patch is attached.

Ihor: I tried looking at the link you sent but could not understand how to
use org-persist cache. The conversion program needs an output location to
write a file to. Is there some variable or function which indicates a cache
directory to use? If so, I couldn't figure it out (apologies; I am not an
expert in emacs lisp).

Note: as asked in an earlier comment, rsvg-convert can be used instead of
inkscape. The attached patch tries to use inkscape if installed but if that
is missing and rsvg-convert is available, we use that instead. In
principle, the user could set the org-latex-svg-to-pdf-command and
org-latex-svg-to-pdf-command-options variables to control the conversion
program.

Thanks,
-Emin

On Sun, May 11, 2025 at 6:28 AM Ihor Radchenko <yanta...@posteo.net> wrote:

> Emin Martinian <emin.martin...@gmail.com> writes:
>
> > If latex experts and/or maintainers of org-mode are broadly in agreement
> > with the above, I would be happy to try and take the pull request to
> > el-easydraw <https://github.com/misohena/el-easydraw/pull/37> and
> > incorporate something like that into a PR for Org-mode. I think the way
> to
> > go would be to modify the (when (equal filetype "svg")
> > <
> https://github.com/bzg/org-mode/blob/b6dbf8881076191e1351d7cd15e26547a2531fea/lisp/ox-latex.el#L2877
> >
> > portion of ox-latex.org to call something like the
> > edraw-org-export-latex-link
> > <
> https://github.com/misohena/el-easydraw/pull/37/files#diff-d74d9626acb8016adf39b497068745979fef8789a108264c79e45c003a364997R57
> >
> > function in my original PR (renamed/modified to not be specific to
> edraw).
>
> Looks like there are no objections to the idea, so go ahead.
> Just one comment - rather than creating a .pdf file in the same folder
> with original .svg (which may or may not be writable), please use
> org-persist cache. See
>
> https://code.tecosaur.net/tec/org-mode/src/branch/dev/lisp/org-latex-preview.el#L2973
> for an example how to do it.
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

Attachment: 0001-lisp-ox-latex.el-Convert-SVG-to-PDF-on-latex-export.patch
Description: Binary data

Reply via email to