emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Using different image format given the export backend


From: Xavier Garrido
Subject: Re: [O] Using different image format given the export backend
Date: Tue, 02 Jul 2013 08:39:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Hi Vincent,

Thanks for the trick. Until I found something else I will try it ;)

Xavier

Le 01/07/2013 21:22, Vincent Beffara a écrit :

Hello,

#+CAPTION: Toto figure
#+NAME: fig::toto
#+ATTR_LATEX: :width 0.38\textwidth
#+BEGIN_SRC emacs-lisp :exports results :results value raw
    (case (and (boundp 'backend) backend)
      (nil "")
      (latex "[[file:./toto.pdf]]"
      (html  "[[file:./toto.png]]"))
#+END_SRC

I do it like this:

(defun vb-massage-includegraphics (str backend opts)
   (replace-regexp-in-string ".png}" ".pdf}" str))
(add-hook 'org-export-filter-final-output-functions
           'vb-massage-includegraphics)

And then, simply refer to the png file in the .org file. Then nothing
happens for the html output, but on latex export, the regexp matches the
'}' and includes the .pdf file instead.

That is extremely ugly, and makes plenty of assumptions, most of all
that the .pdf file exists. And it should probably test for the value of
'backend'. But for personal use, it is convenient ...

            /v




reply via email to

[Prev in Thread] Current Thread [Next in Thread]