From: Xavier Garrido <xavier.garrido@gmail.com>
To: Vincent Beffara <vbeffara@ens-lyon.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Using different image format given the export backend
Date: Tue, 02 Jul 2013 08:39:54 +0200 [thread overview]
Message-ID: <51D275BA.3020900@gmail.com> (raw)
In-Reply-To: <m2y59qytiu.fsf@ens-lyon.fr>
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
>
prev parent reply other threads:[~2013-07-02 6:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 19:02 Using different image format given the export backend Garrido Xavier
2013-07-01 19:22 ` Vincent Beffara
2013-07-02 6:39 ` Xavier Garrido [this message]
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=51D275BA.3020900@gmail.com \
--to=xavier.garrido@gmail.com \
--cc=emacs-orgmode@gnu.org \
--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).