[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Choosing image format according to export backend
From: |
John Hendy |
Subject: |
Re: [O] Choosing image format according to export backend |
Date: |
Wed, 15 May 2013 15:21:23 -0500 |
On Wed, May 15, 2013 at 12:38 PM, Vincent Beffara <address@hidden> wrote:
> Dear list,
>
> I would like to have the same org file export to both PDF (through
> LaTeX) and HTML. The problem I have is images: for printing, PDF images
> would be best but for display in a browser, it is much better to have a
> PNG file rather than a link to the PDF. So what I need is for the
> exporter to choose the image differently according to the backend.
I know this is more of a request for coding help, but just wanted to
add my vote that this would be great. I don't use html *that* much,
but having the option would be awesome, and the replacement of all
*.pdf links with *.png (and typically re-running R code to generate
.png version, or running imagemagick on the dir to create them) is
typically too much of a barrier so I just stick with PDF/Beamer.
I'd love something like this.
John
>
> I found this piece of code on stackoverflow:
>
> #+begin_src emacs-lisp :exports results :results value raw
> (case (and (boundp 'backend) backend)
> (nil "")
> (latex "[[file:traps.pdf]]")
> (html "[[file:traps.png]]"))
> #+end_src
>
> That works, but I was not able to make it recognize captions and such
> (except by pasting them in both options or otherwise modifying the lisp
> code above). Plus the markup is a bit heavy. Is there a simpler way?
>
> [One thing I thought about was to keep only one of them in the markup,
> and modifying the output for the other backend. I kind of know how to
> do that within LaTeX by redefining the \includegraphics command but it
> feels ... well ... not elegant. Maybe using a hook during one of the
> exports?]
>
> Cheers,
>
> --
> Vincent
>
>