From: Rainer M Krug <Rainer@krugs.de>
To: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: pdf images in html export
Date: Wed, 12 Nov 2014 14:09:06 +0100 [thread overview]
Message-ID: <m2vbmkwop9.fsf@krugs.de> (raw)
In-Reply-To: <oluzjbwdaw1.fsf@med.uni-goettingen.de> (Andreas Leha's message of "Wed, 12 Nov 2014 09:30:06 +0000")
[-- Attachment #1: Type: text/plain, Size: 2216 bytes --]
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> Hi Marco,
>
> Marco Wahl <marcowahlsoft@gmail.com> writes:
>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>
>>> how would I export an org file containing
>>>
>>> [[file:./myimage.pdf]]
>>>
>>> to html so that a say png version myimage.pdf is inlined in the html
>>> which links to the pdf?
>>>
>>> I guess it should be possible to run imagemagick on all pdf links during
>>> export somehow.
>>
>> You could introduce a relation of the pdf-filenames to the respective
>> thumb-filenames e.g. by using the suffix '_thumb'. Before the export
>> the conversion tool would create the thumbs.
>>
>> The org-file could reference the data as
>>
>> [[file:./myimage.pdf][file:myimage_thumb.png]]
>>
>> See the info page (info "(org)Images in HTML export")?
>>
>> Untested. I just accidentially browsed that info page yesterday.
>>
>>
>
> Thanks for your thoughts. I would like to automate all of that. So, I
> guess the first question is where to put code that would trigger the
> conversion and how to best detect links to pdfs.
Well - this is coming again and again - but no solution out of the
box. There are effectively two approaches:
1) Macro to change properties according to backend used.
One usage is changing the file name extension according to the
backend. This is implemented as a simplified macro below. This could
be done by using ~(by-backend (html "graph.png") (latex "graph.pdf") (t "graph.pdf"))~
See [[http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3][work section ob-doc-LaTeX]] for details.
#+begin_src emacs-lisp
(setq org-babel-latex-htlatex "htlatex")
(defmacro rmk-by-backend (&rest body)
`(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))
#+end_src
2) To use svg image format, which is supported by both (although has
it's drawbacks: slow rendering of the html, need to run external programs upon compilation)
So the first might be the modst feasible option.
Rainer
>
> Thanks,
> Andreas
>
>
>
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
next prev parent reply other threads:[~2014-11-12 13:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 0:48 pdf images in html export Andreas Leha
2014-11-12 8:27 ` Marco Wahl
2014-11-12 9:30 ` Andreas Leha
2014-11-12 13:09 ` Rainer M Krug [this message]
2014-11-12 13:36 ` Andreas Leha
2014-11-12 14:13 ` Rainer M Krug
2014-11-13 12:21 ` Instructor account
2014-11-13 19:10 ` Andreas Leha
2014-11-12 19:03 ` Charles C. Berry
2014-11-12 20:50 ` Andreas Leha
2014-11-12 21:04 ` John Hendy
2014-11-12 21:32 ` Andreas Leha
2014-11-12 22:59 ` John Hendy
2014-11-13 9:11 ` Eric S Fraga
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=m2vbmkwop9.fsf@krugs.de \
--to=rainer@krugs.de \
--cc=andreas.leha@med.uni-goettingen.de \
--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).