From: Carsten Dominik <carsten.dominik@gmail.com>
To: John Hendy <jw.hendy@gmail.com>
Cc: Vincent Beffara <vbeffara@ens-lyon.fr>,
emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Choosing image format according to export backend
Date: Fri, 9 Aug 2013 11:49:48 +0200 [thread overview]
Message-ID: <E720EE9F-AA3B-4539-B5D1-888741FDEA14@gmail.com> (raw)
In-Reply-To: <CA+M2ft91HOve72ZgsbiY28PaPRgS72Qgo41SUb5sZb7Y__bwpQ@mail.gmail.com>
On 15.5.2013, at 22:21, John Hendy <jw.hendy@gmail.com> wrote:
> On Wed, May 15, 2013 at 12:38 PM, Vincent Beffara <vbeffara@ens-lyon.fr> 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.
I think this should be possible using filters in the exporter.
- Carsten
>
>
> 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
>>
>>
>
next prev parent reply other threads:[~2013-08-09 9:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 17:38 Choosing image format according to export backend Vincent Beffara
2013-05-15 17:59 ` Vincent Beffara
2013-05-15 20:21 ` John Hendy
2013-08-09 9:49 ` Carsten Dominik [this message]
2013-08-09 10:26 ` Suvayu Ali
2013-08-09 15:36 ` Eric Schulte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E720EE9F-AA3B-4539-B5D1-888741FDEA14@gmail.com \
--to=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=jw.hendy@gmail.com \
--cc=vbeffara@ens-lyon.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).