emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* graphics for html and latex / pdf export?
@ 2014-09-03 16:15 Rainer M Krug
  2014-09-03 17:21 ` Aaron Ecay
  0 siblings, 1 reply; 6+ messages in thread
From: Rainer M Krug @ 2014-09-03 16:15 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 936 bytes --]

Hi

I know this has been asked before, but I can't find it...

I would like to export a document which contains graphs generated in R
as html as well as latex / pdf. For LaTeX, I use output format pdf,
d=which does not work as inline picture for html export. How can I
automate the process, that all graphs which are included in org as e.g.

--8<---------------cut here---------------start------------->8---
#+begin_src R :file graph.pdf :results graphics
  plot(1,1)
#+end_src

#+RESULTS:
[[file:graph.pdf]]
--8<---------------cut here---------------end--------------->8---

are available for the html export as inline images (e.g. png)?

I remember some use of imagemagic? 

I could obviously do this manually in each code block, but I would
prefer a general solution, so that I can forget about it and it is working.

Thanks,

Rainer

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: graphics for html and latex / pdf export?
  2014-09-03 16:15 graphics for html and latex / pdf export? Rainer M Krug
@ 2014-09-03 17:21 ` Aaron Ecay
  2014-09-04 11:07   ` Rainer M Krug
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ecay @ 2014-09-03 17:21 UTC (permalink / raw)
  To: Rainer M Krug, emacs-orgmode

Hi Rainer,

One option is to use svg graphics, which are supported in latex (via the
svg package from CTAN) and in HTML (on almost all modern browsers:
<http://caniuse.com/#feat=svg>).  The svg latex package supports
compiling with pdflatex out of the box and lualatex with a little
hackery; xelatex is not supported (you also need to install inkscape and
compile with a flag that allows latex code to execute shell commands).

Otherwise, you might be looking for something like this worg page:
<http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3>.

And also search “by-backend” in the mailing list archives for other
relevant examples.

Hope this is helpful,

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: graphics for html and latex / pdf export?
  2014-09-03 17:21 ` Aaron Ecay
@ 2014-09-04 11:07   ` Rainer M Krug
  2014-09-04 12:05     ` Rainer M Krug
  0 siblings, 1 reply; 6+ messages in thread
From: Rainer M Krug @ 2014-09-04 11:07 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]

Aaron Ecay <aaronecay@gmail.com> writes:

> Hi Rainer,
>
> One option is to use svg graphics, which are supported in latex (via the
> svg package from CTAN) and in HTML (on almost all modern browsers:
> <http://caniuse.com/#feat=svg>).  The svg latex package supports
> compiling with pdflatex out of the box and lualatex with a little
> hackery; xelatex is not supported (you also need to install inkscape and
> compile with a flag that allows latex code to execute shell commands).

svg does not work easily, as I have to use the cairo package in R to use
it, so I have to add this manually. Nevertheless, I could do this in a
session in a block before.

>
> Otherwise, you might be looking for something like this worg page:
> <http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3>.

That one works nicely when generating the graphs on export - but I
would like to do no evaluations on export to have the org file as a
"output" itself.

Thanks a lot,

Rainer

>
> And also search “by-backend” in the mailing list archives for other
> relevant examples.
>
> Hope this is helpful,

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: graphics for html and latex / pdf export?
  2014-09-04 11:07   ` Rainer M Krug
@ 2014-09-04 12:05     ` Rainer M Krug
  2014-09-04 12:12       ` Thorsten Jolitz
  0 siblings, 1 reply; 6+ messages in thread
From: Rainer M Krug @ 2014-09-04 12:05 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2284 bytes --]

OK - ignore my comment concerning R - this is working. I am just trying
it out. HTML works perfectly. 

I am just struggling with pdf. I have to set the org-latex-pdf-process
to "pdflatex -shell-escape -interaction nonstopmode -output-directory %o
%f" and, due to security concerns, only want to set it via file local
variable. But I somehow don't manage it.

,----
| # Local Variables:
| # org-latex-pdf-process: "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
| # End:
`----

Does not work ("No valid command to process pdf"). How can I set the
command as a file local variable?

Rainer
 

Rainer M Krug <Rainer@krugs.de> writes:

> Aaron Ecay <aaronecay@gmail.com> writes:
>
>> Hi Rainer,
>>
>> One option is to use svg graphics, which are supported in latex (via the
>> svg package from CTAN) and in HTML (on almost all modern browsers:
>> <http://caniuse.com/#feat=svg>).  The svg latex package supports
>> compiling with pdflatex out of the box and lualatex with a little
>> hackery; xelatex is not supported (you also need to install inkscape and
>> compile with a flag that allows latex code to execute shell commands).
>
> svg does not work easily, as I have to use the cairo package in R to use
> it, so I have to add this manually. Nevertheless, I could do this in a
> session in a block before.
>
>>
>> Otherwise, you might be looking for something like this worg page:
>> <http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3>.
>
> That one works nicely when generating the graphs on export - but I
> would like to do no evaluations on export to have the org file as a
> "output" itself.
>
> Thanks a lot,
>
> Rainer
>
>>
>> And also search “by-backend” in the mailing list archives for other
>> relevant examples.
>>
>> Hope this is helpful,

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

PGP: 0x0F52F982

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: graphics for html and latex / pdf export?
  2014-09-04 12:05     ` Rainer M Krug
@ 2014-09-04 12:12       ` Thorsten Jolitz
  2014-09-04 12:19         ` Rainer M Krug
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Jolitz @ 2014-09-04 12:12 UTC (permalink / raw)
  To: emacs-orgmode

Rainer M Krug <Rainer@krugs.de> writes:

> OK - ignore my comment concerning R - this is working. I am just trying
> it out. HTML works perfectly. 
>
> I am just struggling with pdf. I have to set the org-latex-pdf-process
> to "pdflatex -shell-escape -interaction nonstopmode -output-directory %o
> %f" and, due to security concerns, only want to set it via file local
> variable. But I somehow don't manage it.
>
> ,----
> | # Local Variables:
> | # org-latex-pdf-process: "pdflatex -shell-escape -interaction
> | nonstopmode -output-directory %o %f"
> | # End:
> `----
>
> Does not work ("No valid command to process pdf"). How can I set the
> command as a file local variable?

maybe as list like here:

% reftex-ref-style-default-list: ("Fancyref")

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: graphics for html and latex / pdf export?
  2014-09-04 12:12       ` Thorsten Jolitz
@ 2014-09-04 12:19         ` Rainer M Krug
  0 siblings, 0 replies; 6+ messages in thread
From: Rainer M Krug @ 2014-09-04 12:19 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Rainer M Krug <Rainer@krugs.de> writes:
>
>> OK - ignore my comment concerning R - this is working. I am just trying
>> it out. HTML works perfectly. 
>>
>> I am just struggling with pdf. I have to set the org-latex-pdf-process
>> to "pdflatex -shell-escape -interaction nonstopmode -output-directory %o
>> %f" and, due to security concerns, only want to set it via file local
>> variable. But I somehow don't manage it.
>>
>> ,----
>> | # Local Variables:
>> | # org-latex-pdf-process: "pdflatex -shell-escape -interaction
>> | nonstopmode -output-directory %o %f"
>> | # End:
>> `----
>>
>> Does not work ("No valid command to process pdf"). How can I set the
>> command as a file local variable?
>
> maybe as list like here:
>
> % reftex-ref-style-default-list: ("Fancyref")

Perfect - working.

Thanks a lot,

Rainer

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-09-04 12:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03 16:15 graphics for html and latex / pdf export? Rainer M Krug
2014-09-03 17:21 ` Aaron Ecay
2014-09-04 11:07   ` Rainer M Krug
2014-09-04 12:05     ` Rainer M Krug
2014-09-04 12:12       ` Thorsten Jolitz
2014-09-04 12:19         ` Rainer M Krug

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