emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Vincent Beffara <vbeffara@ens-lyon.fr>
To: emacs-orgmode@gnu.org
Subject: Re: Choosing image format according to export backend
Date: Wed, 15 May 2013 19:59:55 +0200	[thread overview]
Message-ID: <m2vc6k3yzo.fsf@ens-lyon.fr> (raw)
In-Reply-To: m238to5ek0.fsf@ens-lyon.fr

> 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.

... my entry for the dirtiest piece of code possible (but it works for
now):

(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)

Am I on the right track? Meaning, after adding a test on the backend,
possibly a file existence check and so on. Or am I missing a simpler
way?

Cheers,

-- 
Vincent

  reply	other threads:[~2013-05-15 18:00 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 [this message]
2013-05-15 20:21 ` John Hendy
2013-08-09  9:49   ` Carsten Dominik
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=m2vc6k3yzo.fsf@ens-lyon.fr \
    --to=vbeffara@ens-lyon.fr \
    --cc=emacs-orgmode@gnu.org \
    /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).