Hello, I want to export to different output formats. Trouble is the way ox-gfm exports images. So I thought, hm, why not utilise macros to abstract away the differences. Well, that escalated quickly:
#+macro: img_gfm (eval (concat "#+begin_export md\n![img](" $1 " \"" $2 "\")\n*Abb.: " $2 "* (Quelle: " $3 ")\n#+end_export")) #+macro: img_latex (eval "foobar") # Image export for Github flavoured markdown # $1 path to image # $2 caption # $3 source #+macro: img (eval (cl-case org-export-current-backend ('gfm (concat "{{{img_gfm(" $1 "," $2 "," $3")}}}")) ('latex "{{{img_latex}}}") (t "barfoo"))) {{{img(./foo, foo, barfoo)}}} That kind of works (and breaks if I want commas in the caption), but is ugly as... and doesn't get better if I implement the other output formats. Maybe syntax like @@latex: ...@@ would help. But no, I think that is defined in the specific backends, not as a general mechanism. So, how can I do it better? All the best, hmw