Michael Hannon wrote: > Another bit of information about this: if I remove: > > :session *R* > > from the line starting with: > > #+BABEL > > then I don't see any error message. > > OTOH, this isn't much of a workaround, because without a "session", the values of the variables are > not preserved between source-code blocks, so that, for instance, the combination: > > x <- c(1, 3, 5) #### defined in one block > > and > > q <- c(x, 8, 8) #### defined in another block > > raises an R error ('x' is not defined when the assignment to 'q' is made). > > Also, in grasping at straws, I've tried renaming the R session, as: > > ... :session mTest > > (on the theory that the '*' is used for emphasis in Org-Mode markup and might, therefore, somehow > confuse things). That didn't help. > FWIW, I don't get any error messages. I have no idea what the exported file should look like: I attach both the exported pdf and the exported html below (as well as the org file, which is just cut-n-pasted from what you posted). Versions: Org-mode version 7.7 (release_7.7.224.g6e14) GNU Emacs 24.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-09-13 I'll pull the newest bits and try again. Nick > > ------------------------------------------------------------------------------------------------- > From: Michael Hannon > To: Org-Mode List > Sent: Friday, September 16, 2011 10:50 AM > Subject: [O] Problems with Org-Mode export > > Greetings. I've been having problems lately in exporting Org-Mode source-code > documents to HTML and/or PDF. > > I'm running Org-Mode 7.7 with Emacs 23 on 64-bit linux (Fedora 15). > > I've appended a document that exhibits at least some of the problem. The > problems are similar to the problem described at: > > http://comments.gmane.org/gmane.emacs.orgmode/45316 > > and can *sometimes* be circumvented by executing org-reload. > > In the particular example shown below, the HTML export works as expected, but > the PDF export fails with message: > > org-export-latex-preprocess: Wrong type argument: stringp, nil > > By the way, everything worked fine in the example until I added the last > source block: > > #+begin_src R > > x > > #+end_src > > I tried using what I take to be the latest version of Org-Mode: > > Org-mode version 7.7 (release_7.7.290.g65d05) > > but that only made things worse. I tried an HTML export with this version, and > it generated a horrendous-looking message that begins with: > > org-babel-R-evaluate: Wrong number of arguments: #[(session body result-type > result-params column-names-p row-names-p) Æ=}... > > followed by a bunch of stuff containing enough non-printing characters that > it's hard to reproduce in email, and ending with: > > ...org-mode/lisp/ob-R.elc" . 9734)], 5 > > I'd welcome any help/advice that anybody can provide. > > Thanks, > > -- Mike > > ########## Sample file that exhibits some export problems > > #+TITLE: This is a test > > #+AUTHOR: Michael Hannon > #+email: jm_hannon@yahoo.com > > #+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes > > * Getting Started > > ** Batch Mode > > #+begin_src R :exports code > > pdf("xh.pdf") # set graphical output file > hist(rnorm(100)) # generate 100 N(0,1) variates and plot their histogram > dev.off() # close the graphical output file > > #+end_src > > If we put the code above in a file called =z.R=, we can execute the > code from the command line via: =R CMD BATCH z.R= > > #+begin_src R > > x <- c(1, 3, 5) > > #+end_src > > #+begin_src R > > x[3] > > #+end_src > > #+begin_src R > > q <- c(x,x,8) > > #+end_src > > #+begin_src R > > x > > #+end_src