emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Inconsistencies/bug with :results raw
@ 2011-03-02 11:42 Rainer M Krug
  2011-03-02 14:34 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Rainer M Krug @ 2011-03-02 11:42 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi

When exporting this org document to pdf, I get the attached pdf. There
are some inconsistencies in the export:

1) if I use :results once or twice makes a difference
2) when using :results twice, the result s not the same as the
combined nor the second :result value.
3) when using :results raw, no results at all are exported (expected).
4) If each code block is previously evaluated, the exported pdf
differs from the origial one,

I do not assume, that this is caused by my configuration, but I attach
my emacs.org anyway.

Cheers,

Rainer

* Version 1
This version only prints the org code for the table, but does not interprets it.
#+begin_src R :exports both :results output raw
  pdf("pdf1.pdf")
  plot(runif(100))
  dev.off()
  cat(
      "\n|--|--|\n",
      "|name|[[./pdf1.pdf]]|\n",
      "|--|--|\n"
      )
#+end_src


* Version 2
This version prints the table including the graph as expected, but
:results is used twice as a header argument.
#+begin_src R :results output :exports both :results raw
  pdf("pdf1.pdf")
  plot(runif(100))
  dev.off()
  cat(
      "\n|--|--|\n",
      "|name|[[./pdf1.pdf]]|\n",
      "|--|--|\n"
      )
#+end_src


* Version 3
Finally this version does only export the R code
#+begin_src R :exports both :results raw
  pdf("pdf1.pdf")
  plot(runif(100))
  dev.off()
  cat(
      "\n|--|--|\n",
      "|name|[[./pdf1.pdf]]|\n",
      "|--|--|\n"
      )
#+end_src




-- 
NEW GERMAN FAX NUMBER!!!

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

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:           +27 - (0)83 9479 042
Fax:            +27 - (0)86 516 2782
Fax:            +49 - (0)321 2125 2244
email:          Rainer@krugs.de

Skype:          RMkrug
Google:         R.M.Krug@gmail.com

[-- Attachment #2: ttt.pdf --]
[-- Type: application/pdf, Size: 66888 bytes --]

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [babel] Inconsistencies/bug with :results raw
  2011-03-02 11:42 [babel] Inconsistencies/bug with :results raw Rainer M Krug
@ 2011-03-02 14:34 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-03-02 14:34 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode

Hi Rainer,

Rainer M Krug <r.m.krug@gmail.com> writes:

> Hi
>
> When exporting this org document to pdf, I get the attached pdf. There
> are some inconsistencies in the export:
>
> 1) if I use :results once or twice makes a difference
> 2) when using :results twice, the result s not the same as the
> combined nor the second :result value.
> 3) when using :results raw, no results at all are exported (expected).
> 4) If each code block is previously evaluated, the exported pdf
> differs from the origial one,
>
> I do not assume, that this is caused by my configuration, but I attach
> my emacs.org anyway.
>
> Cheers,
>
> Rainer
>
> * Version 1
> This version only prints the org code for the table, but does not interprets it.
> #+begin_src R :exports both :results output raw
>   pdf("pdf1.pdf")
>   plot(runif(100))
>   dev.off()
>   cat(
>       "\n|--|--|\n",
>       "|name|[[./pdf1.pdf]]|\n",
>       "|--|--|\n"
>       )
> #+end_src
>

If you remove the leading "\n" from before the table in your cat call,
then the output will be table-aligned.  Also, this will have the result
of allowing Babel to remove the existing table on subsequent
evaluations.

>
>
>
> * Version 2
> This version prints the table including the graph as expected, but
> :results is used twice as a header argument.
> #+begin_src R :results output :exports both :results raw
>   pdf("pdf1.pdf")
>   plot(runif(100))
>   dev.off()
>   cat(
>       "\n|--|--|\n",
>       "|name|[[./pdf1.pdf]]|\n",
>       "|--|--|\n"
>       )
> #+end_src
>

Oh, thanks for catching this behavior (the difference based on splitting
of :results across two header arguments).  I've just pushed up a fix.

>
>
>
> * Version 3
> Finally this version does only export the R code
> #+begin_src R :exports both :results raw
>   pdf("pdf1.pdf")
>   plot(runif(100))
>   dev.off()
>   cat(
>       "\n|--|--|\n",
>       "|name|[[./pdf1.pdf]]|\n",
>       "|--|--|\n"
>       )
> #+end_src

Best -- Eric

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

end of thread, other threads:[~2011-03-02 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 11:42 [babel] Inconsistencies/bug with :results raw Rainer M Krug
2011-03-02 14:34 ` Eric Schulte

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