Hi John,

John Hendy <jw.he...@gmail.com> writes:
> On Nov 12, 2014 7:36 AM, "Andreas Leha"
> <andreas.l...@med.uni-goettingen.de> wrote:
>>
>> Hi Rainer,
>>
>> Rainer M Krug <rai...@krugs.de> writes:
>> > Andreas Leha <andreas.l...@med.uni-goettingen.de> writes:
>> >
>> >> Hi Marco,
>> >>
>> >> Marco Wahl <marcowahls...@gmail.com> writes:
>> >>> Andreas Leha <andreas.l...@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.
>> >
>>
>> Thanks for this. I am aware of how to *produce* graphics in
> different
>> formats for different export backends. I use your first approach,
>> which I think is the better solution.
>>
>> Here, I am after a solution, that works on images that are not
> produced
>> but merely included via [[file:./some.pdf]].
>>
>
> If the names are always the same, could you just sed or replace-regexp
> all *.pdf for *.png?
>

I could.  And I would need to do the conversion manually as well.

But I still want the pdfs to go into the LaTeX export.

> Not elegant, but works easily/now, and takes less time than this
> thread :)

Hint taken.  Such feature is apparently not too important for most.

[...]

Thanks,
Andreas


Reply via email to