org-download icon indicating copy to clipboard operation
org-download copied to clipboard

export issue with org-download-method directory

Open wang1zhen opened this issue 4 years ago • 6 comments

Here is my configuration (in Doom Emacs) for org-download:

(after! org-download
  (setq org-download-method 'directory
        org-download-image-dir "."
        org-download-heading-lvl 0
        org-download-timestamp "%Y-%m-%d_%H-%M-%S_")
  )

when I paste an image into an org file, everything seems to be fine, yet if I export the org-file to latex, the images are treated as URLs instead of graphics. Is it possible to fix?

the left buffer shows the org file and the right buffer shows the latex buffer: 图片

wang1zhen avatar Jan 04 '21 05:01 wang1zhen

Looks like an issue in Org to LaTeX export.

I tried to reproduce by recreating the same Org document and using the image you attached.

Here's what I got in LaTeX:

\includegraphics[width=.9\linewidth]{org-download/2021-01-05_20-13-12_103504956-e5f30480-4e93-11eb-9ee9-f981da441aed.png}

Your issue is that _ gets transformed into \_ during export. Maybe somewhere in your config there's a setting for this.

abo-abo avatar Jan 05 '21 19:01 abo-abo

Thank you, yes this might be an issue with org-mode export, and it works if I use the attach method. I'll try to figure out the actual problem later.

图片

wang1zhen avatar Jan 06 '21 04:01 wang1zhen

I am having issue with the directory org-download-method on export too.

(require 'org-download)
(setq-default
 org-download-method 'directory
 org-download-image-dir "images"
 org-download-heading-lvl nil
 org-download-timestamp "%Y%m%d-%H%M%S_")

tried export to html and to pdf. On both exports no images are shown. I only see the reference to the image.

alinmear avatar Nov 07 '21 15:11 alinmear

Same problerm here. Only effects on [[download:]] link, [[attachment:]] link seems work well. Any fix for this?

zhyzky avatar Feb 09 '23 08:02 zhyzky

Same problerm here. Only effects on [[download:]] link, [[attachment:]] link seems work well. Any fix for this?

Hope this could help someone. I've found it's caused by doom emacs which changes some origin org-download settings. Following code revert this change.

  (setq org-download-link-format "[[file:%s]]\n"
        org-download-abbreviate-filename-function #'file-relative-name)
  (setq org-download-link-format-function #'org-download-link-format-function-default)

zhyzky avatar Feb 10 '23 02:02 zhyzky

@zhyzky thank you very much, I've spent 6 hours trying to solve this issue. Your snippet fixed it!

danielkrajnik avatar Jun 09 '23 21:06 danielkrajnik