* Problems with Org-Mode export @ 2011-09-16 17:50 Michael Hannon 2011-09-16 20:04 ` Michael Hannon ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: Michael Hannon @ 2011-09-16 17:50 UTC (permalink / raw) To: Org-Mode List [-- Attachment #1: Type: text/plain, Size: 2189 bytes --] 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 [-- Attachment #2: Type: text/html, Size: 2687 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problems with Org-Mode export 2011-09-16 17:50 Problems with Org-Mode export Michael Hannon @ 2011-09-16 20:04 ` Michael Hannon 2011-09-17 4:59 ` David Maus 2011-09-20 19:31 ` Problems with Org-Mode export Michael Hannon 2 siblings, 0 replies; 11+ messages in thread From: Michael Hannon @ 2011-09-16 20:04 UTC (permalink / raw) To: Org-Mode List [-- Attachment #1: Type: text/plain, Size: 2641 bytes --] FYI: the problem described below is worse with: Org-mode version 7.7 (release_7.7.298.gbf3e9) -- Mike >________________________________ >From: Michael Hannon <jm_hannon@yahoo.com> >To: Org-Mode List <emacs-orgmode@gnu.org> >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 > > > > [-- Attachment #2: Type: text/html, Size: 3807 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problems with Org-Mode export 2011-09-16 17:50 Problems with Org-Mode export Michael Hannon 2011-09-16 20:04 ` Michael Hannon @ 2011-09-17 4:59 ` David Maus 2011-09-19 21:17 ` Michael Hannon 2011-09-20 19:31 ` Problems with Org-Mode export Michael Hannon 2 siblings, 1 reply; 11+ messages in thread From: David Maus @ 2011-09-17 4:59 UTC (permalink / raw) To: Michael Hannon; +Cc: Org-Mode List [-- Attachment #1: Type: text/plain, Size: 1941 bytes --] At Fri, 16 Sep 2011 10:50:01 -0700 (PDT), Michael Hannon wrote: > 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. Could I ask you to provide the entire backtrace for both errors? M-x toggle-debug-on-error RET The backtrace might contain information about the exact place where a string is expected. If you can't copy it into the email program save to disk + gzip + attach should do the trick. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de [-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problems with Org-Mode export 2011-09-17 4:59 ` David Maus @ 2011-09-19 21:17 ` Michael Hannon 2011-09-19 23:20 ` [PATCH] Check argument is a string before calling string-match Bernt Hansen 0 siblings, 1 reply; 11+ messages in thread From: Michael Hannon @ 2011-09-19 21:17 UTC (permalink / raw) To: David Maus; +Cc: Org-Mode List [-- Attachment #1.1: Type: text/plain, Size: 2070 bytes --] >> 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. > > > Could I ask you to provide the entire backtrace for both errors? > > M-x toggle-debug-on-error RET > > The backtrace might contain information about the exact place where a > string is expected. If you can't copy it into the email program save > to disk + gzip + attach should do the trick. Hi, David. I've attached the backtrace for: Org-mode version 7.7 (release_7.7.304.g9da4) (I was traveling when I worked on this previously, and my environment has now changed. The version I'm using now exhibits the same kind of error.) Thanks, -- Mike [-- Attachment #1.2: Type: text/html, Size: 3282 bytes --] [-- Attachment #2: backtrace.txt.gz --] [-- Type: application/x-gzip, Size: 3319 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] Check argument is a string before calling string-match 2011-09-19 21:17 ` Michael Hannon @ 2011-09-19 23:20 ` Bernt Hansen 2011-10-04 12:36 ` [Accepted] " Carsten Dominik 0 siblings, 1 reply; 11+ messages in thread From: Bernt Hansen @ 2011-09-19 23:20 UTC (permalink / raw) To: emacs-orgmode; +Cc: Bernt Hansen * lisp/org-html.el (org-export-as-html): Check string-match argument (org-html-handle-time-stamps): Check string-match argument Avoid wrong-type-argument errors during exporting. --- This may or may not be the same error you are getting - but I ran into this during exporting back in August and it was sitting in my queue. Please report if this fixes your issue or not. -Bernt lisp/org-html.el | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lisp/org-html.el b/lisp/org-html.el index fde563b..6492c2f 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1598,7 +1598,8 @@ lang=\"%s\" xml:lang=\"%s\"> (setq line (org-html-handle-links line opt-plist)) ;; TODO items - (if (and (string-match org-todo-line-regexp line) + (if (and org-todo-line-regexp + (string-match org-todo-line-regexp line) (match-beginning 2)) (setq line @@ -2213,19 +2214,20 @@ for further information." "Format time stamps in string S, or remove them." (catch 'exit (let (r b) - (while (string-match org-maybe-keyword-time-regexp s) - (or b (setq b (substring s 0 (match-beginning 0)))) - (setq r (concat - r (substring s 0 (match-beginning 0)) - " @<span class=\"timestamp-wrapper\">" - (if (match-end 1) - (format "@<span class=\"timestamp-kwd\">%s @</span>" - (match-string 1 s))) - (format " @<span class=\"timestamp\">%s@</span>" - (substring - (org-translate-time (match-string 3 s)) 1 -1)) - "@</span>") - s (substring s (match-end 0)))) + (when org-maybe-keyword-time-regexp + (while (string-match org-maybe-keyword-time-regexp s) + (or b (setq b (substring s 0 (match-beginning 0)))) + (setq r (concat + r (substring s 0 (match-beginning 0)) + " @<span class=\"timestamp-wrapper\">" + (if (match-end 1) + (format "@<span class=\"timestamp-kwd\">%s @</span>" + (match-string 1 s))) + (format " @<span class=\"timestamp\">%s@</span>" + (substring + (org-translate-time (match-string 3 s)) 1 -1)) + "@</span>") + s (substring s (match-end 0))))) ;; Line break if line started and ended with time stamp stuff (if (not r) s -- 1.7.7.rc1.3.g5593 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Accepted] Check argument is a string before calling string-match 2011-09-19 23:20 ` [PATCH] Check argument is a string before calling string-match Bernt Hansen @ 2011-10-04 12:36 ` Carsten Dominik 0 siblings, 0 replies; 11+ messages in thread From: Carsten Dominik @ 2011-10-04 12:36 UTC (permalink / raw) To: emacs-orgmode Patch 952 (http://patchwork.newartisans.com/patch/952/) is now "Accepted". Maintainer comment: none This relates to the following submission: http://mid.gmane.org/%3C1316474402-26292-1-git-send-email-bernt%40norang.ca%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O] Check argument is a string before calling string-match > Date: Tue, 20 Sep 2011 04:20:02 -0000 > From: Bernt Hansen <bernt@norang.ca> > X-Patchwork-Id: 952 > Message-Id: <1316474402-26292-1-git-send-email-bernt@norang.ca> > To: emacs-orgmode@gnu.org > Cc: Bernt Hansen <bernt@norang.ca> > > * lisp/org-html.el (org-export-as-html): Check string-match argument > (org-html-handle-time-stamps): Check string-match argument > > Avoid wrong-type-argument errors during exporting. > > --- > This may or may not be the same error you are getting - but I ran into > this during exporting back in August and it was sitting in my queue. > > Please report if this fixes your issue or not. > > -Bernt > > lisp/org-html.el | 30 ++++++++++++++++-------------- > 1 files changed, 16 insertions(+), 14 deletions(-) > > diff --git a/lisp/org-html.el b/lisp/org-html.el > index fde563b..6492c2f 100644 > --- a/lisp/org-html.el > +++ b/lisp/org-html.el > @@ -1598,7 +1598,8 @@ lang=\"%s\" xml:lang=\"%s\"> > (setq line (org-html-handle-links line opt-plist)) > > ;; TODO items > - (if (and (string-match org-todo-line-regexp line) > + (if (and org-todo-line-regexp > + (string-match org-todo-line-regexp line) > (match-beginning 2)) > > (setq line > @@ -2213,19 +2214,20 @@ for further information." > "Format time stamps in string S, or remove them." > (catch 'exit > (let (r b) > - (while (string-match org-maybe-keyword-time-regexp s) > - (or b (setq b (substring s 0 (match-beginning 0)))) > - (setq r (concat > - r (substring s 0 (match-beginning 0)) > - " @<span class=\"timestamp-wrapper\">" > - (if (match-end 1) > - (format "@<span class=\"timestamp-kwd\">%s @</span>" > - (match-string 1 s))) > - (format " @<span class=\"timestamp\">%s@</span>" > - (substring > - (org-translate-time (match-string 3 s)) 1 -1)) > - "@</span>") > - s (substring s (match-end 0)))) > + (when org-maybe-keyword-time-regexp > + (while (string-match org-maybe-keyword-time-regexp s) > + (or b (setq b (substring s 0 (match-beginning 0)))) > + (setq r (concat > + r (substring s 0 (match-beginning 0)) > + " @<span class=\"timestamp-wrapper\">" > + (if (match-end 1) > + (format "@<span class=\"timestamp-kwd\">%s @</span>" > + (match-string 1 s))) > + (format " @<span class=\"timestamp\">%s@</span>" > + (substring > + (org-translate-time (match-string 3 s)) 1 -1)) > + "@</span>") > + s (substring s (match-end 0))))) > ;; Line break if line started and ended with time stamp stuff > (if (not r) > s > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problems with Org-Mode export 2011-09-16 17:50 Problems with Org-Mode export Michael Hannon 2011-09-16 20:04 ` Michael Hannon 2011-09-17 4:59 ` David Maus @ 2011-09-20 19:31 ` Michael Hannon 2011-09-20 20:29 ` Nick Dokos 2 siblings, 1 reply; 11+ messages in thread From: Michael Hannon @ 2011-09-20 19:31 UTC (permalink / raw) To: Org-Mode List [-- Attachment #1: Type: text/plain, Size: 3311 bytes --] 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. -- Mike >________________________________ >From: Michael Hannon <jm_hannon@yahoo.com> >To: Org-Mode List <emacs-orgmode@gnu.org> >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 > > > > [-- Attachment #2: Type: text/html, Size: 5095 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problems with Org-Mode export 2011-09-20 19:31 ` Problems with Org-Mode export Michael Hannon @ 2011-09-20 20:29 ` Nick Dokos 2011-09-21 1:09 ` Michael Hannon 0 siblings, 1 reply; 11+ messages in thread From: Nick Dokos @ 2011-09-20 20:29 UTC (permalink / raw) To: Michael Hannon; +Cc: nicholas.dokos, Org-Mode List [-- Attachment #1: Type: text/plain, Size: 4333 bytes --] Michael Hannon <jm_hannon@yahoo.com> 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 <jm_hannon@yahoo.com> > To: Org-Mode List <emacs-orgmode@gnu.org> > 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 [-- Attachment #2: org file --] [-- Type: text/plain, Size: 673 bytes --] #+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 [-- Attachment #3: html file --] [-- Type: application/xml, Size: 4775 bytes --] <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>This is a test</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta name="generator" content="Org-mode"/> <meta name="generated" content="2011-09-20 16:28:20 EDT"/> <meta name="author" content="Michael Hannon"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <style type="text/css"> <!--/*--><![CDATA[/*><!--*/ html { font-family: Times, serif; font-size: 12pt; } .title { text-align: center; } .todo { color: red; } .done { color: green; } .tag { background-color: #add8e6; font-weight:normal } .target { } .timestamp { color: #bebebe; } .timestamp-kwd { color: #5f9ea0; } .right {margin-left:auto; margin-right:0px; text-align:right;} .left {margin-left:0px; margin-right:auto; text-align:left;} .center {margin-left:auto; margin-right:auto; text-align:center;} p.verse { margin-left: 3% } pre { border: 1pt solid #AEBDCC; background-color: #F3F5F7; padding: 5pt; font-family: courier, monospace; font-size: 90%; overflow:auto; } table { border-collapse: collapse; } td, th { vertical-align: top; } th.right { text-align:center; } th.left { text-align:center; } th.center { text-align:center; } td.right { text-align:right; } td.left { text-align:left; } td.center { text-align:center; } dt { font-weight: bold; } div.figure { padding: 0.5em; } div.figure p { text-align: center; } div.inlinetask { padding:10px; border:2px solid gray; margin:10px; background: #ffffcc; } textarea { overflow-x: auto; } .linenr { font-size:smaller } .code-highlighted {background-color:#ffff00;} .org-info-js_info-navigation { border-style:none; } #org-info-js_console-label { font-size:10px; font-weight:bold; white-space:nowrap; } .org-info-js_search-highlight {background-color:#ffff00; color:#000000; font-weight:bold; } /*]]>*/--> </style> <script type="text/javascript"> <!--/*--><![CDATA[/*><!--*/ function CodeHighlightOn(elem, id) { var target = document.getElementById(id); if(null != target) { elem.cacheClassElem = elem.className; elem.cacheClassTarget = target.className; target.className = "code-highlighted"; elem.className = "code-highlighted"; } } function CodeHighlightOff(elem, id) { var target = document.getElementById(id); if(elem.cacheClassElem) elem.className = elem.cacheClassElem; if(elem.cacheClassTarget) target.className = elem.cacheClassTarget; } /*]]>*///--> </script> </head> <body> <div id="preamble"> </div> <div id="content"> <h1 class="title">This is a test</h1> <div id="table-of-contents"> <h2>Table of Contents</h2> <div id="text-table-of-contents"> <ul> <li><a href="#sec-1">1 Getting Started </a> <ul> <li><a href="#sec-1-1">1.1 Batch Mode </a></li> </ul> </li> </ul> </div> </div> <div id="outline-container-1" class="outline-2"> <h2 id="sec-1"><span class="section-number-2">1</span> Getting Started </h2> <div class="outline-text-2" id="text-1"> </div> <div id="outline-container-1-1" class="outline-3"> <h3 id="sec-1-1"><span class="section-number-3">1.1</span> Batch Mode </h3> <div class="outline-text-3" id="text-1-1"> <pre class="src src-R">pdf(<span style="color: #ffa07a;">"xh.pdf"</span>) <span style="color: #f4a460;"># </span><span style="color: #f4a460;">set graphical output file</span> hist(rnorm(100)) <span style="color: #f4a460;"># </span><span style="color: #f4a460;">generate 100 N(0,1) variates and plot their histogram</span> dev.off() <span style="color: #f4a460;"># </span><span style="color: #f4a460;">close the graphical output file</span> </pre> <p> If we put the code above in a file called <code>z.R</code>, we can execute the code from the command line via: <code>R CMD BATCH z.R</code> </p> <pre class="src src-R"> x <span style="color: #7fffd4;"><-</span> c(1, 3, 5) </pre> <pre class="src src-R"> x[3] </pre> <pre class="example"> [1] 5 </pre> <pre class="src src-R"> q <span style="color: #7fffd4;"><-</span> c(x,x,8) </pre> <pre class="src src-R"> x </pre> <pre class="example"> [1] 1 3 5 </pre> </div> </div> </div> </div> <div id="postamble"> <p class="date">Date: 2011-09-20 16:28:20 EDT</p> <p class="author">Author: Michael Hannon</p> <p class="creator">Org version 7.7 with Emacs version 24</p> <a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a> </div> </body> </html> [-- Attachment #4: pdf file --] [-- Type: application/pdf, Size: 51751 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problems with Org-Mode export 2011-09-20 20:29 ` Nick Dokos @ 2011-09-21 1:09 ` Michael Hannon 2011-09-21 14:37 ` Nick Dokos 0 siblings, 1 reply; 11+ messages in thread From: Michael Hannon @ 2011-09-21 1:09 UTC (permalink / raw) To: nicholas.dokos@hp.com; +Cc: Org-Mode List [-- Attachment #1: Type: text/plain, Size: 2698 bytes --] Nick Dokos <nicholas.dokos@hp.com> wrote: > [...] > 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. Thanks, Nick. This is getting curiouser and curiouser. I can now reliably get documents exported using the vanilla 7.7 Org-Mode, but not with the development version I currently have installed: Org-mode version 7.7 (release_7.7.304.g9da4) I suspect that the following bit of the error message is the relevant one: org-babel-R-evaluate: Wrong number of arguments: #[(session body result-type result-params column-names-p row-names-p but I don't know what to make of it. In order to simplify the discussion, I've been working with some Org code that I took from the "worg" web site. Please see below for details. I've also appended the pieces of my .emacs file that relate to finding Org files. At this point I guess I'm ready to declare victory and slink away, but it WOULD be interesting to know what's going on. -- Mike ---------- #+TITLE: Test #+AUTHOR: Michael Hannon #+EMAIL: jm_hannon@yahoo.com #+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes #### Example taken from: #### http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.html * Example of Org-Babel for R Literate Programming ** R text output A simple summary. #+begin_src R x <- rnorm(10) summary(x) #+end_src ** R graphics output Note we use the object =x= generated in previous code block, thanks to the header option =:session *R*=. The output graphics file is =a.png=. #+begin_src R :file a.png y <- rnorm(10) plot(x, y) #+end_src Same plot with larger dimension: #+begin_src R :file b.png :width 800 :height 800 plot(x, y) #+end_src ---------- Org-Mode path variables, standard and devel versions (setq load-path (cons "/usr/local/emacs.d/ssh" load-path)) (require 'ssh) ;;;;;;(setq load-path (cons "/usr/local/emacs.d/org-mode/org-7.7/lisp" load-path)) ;;;;;;(setq load-path (cons "/usr/local/emacs.d/org-mode/org-7.7/contrib/lisp" load-path)) (setq load-path (cons "/usr/local/emacs.d/org-mode/org-devel/org-mode/lisp" load-path)) (setq load-path (cons "/usr/local/emacs.d/org-mode/org-devel/org-mode/contrib/lisp" load-path)) (require 'org-install) [-- Attachment #2: Type: text/html, Size: 4194 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problems with Org-Mode export 2011-09-21 1:09 ` Michael Hannon @ 2011-09-21 14:37 ` Nick Dokos 2011-09-21 19:10 ` Michael Hannon 0 siblings, 1 reply; 11+ messages in thread From: Nick Dokos @ 2011-09-21 14:37 UTC (permalink / raw) To: Michael Hannon; +Cc: nicholas.dokos, Org-Mode List Michael Hannon <jm_hannon@yahoo.com> wrote: > Nick Dokos <nicholas.dokos@hp.com> wrote: > > > 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. > I pulled from latest and reran both the original test file and the test file below. I get no errors either with my standard config or with a minimal .emacs in either case. Version info for reference: Org-mode version 7.7 (release_7.7.311.g0c099) GNU Emacs 24.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-09-13 This is on Ubuntu 10.10. Nick > Thanks, Nick. This is getting curiouser and curiouser. I can now reliably > get documents exported using the vanilla 7.7 Org-Mode, but not with the > development version I currently have installed: > > Org-mode version 7.7 (release_7.7.304.g9da4) > > I suspect that the following bit of the error message is the relevant one: > > org-babel-R-evaluate: Wrong number of arguments: #[(session body result-type > result-params column-names-p row-names-p > > but I don't know what to make of it. > > In order to simplify the discussion, I've been working with some Org code that > I took from the "worg" web site. Please see below for details. > > I've also appended the pieces of my .emacs file that relate to finding Org > files. > > At this point I guess I'm ready to declare victory and slink away, but it > WOULD be interesting to know what's going on. > > -- Mike > > ---------- > > #+TITLE: Test > #+AUTHOR: Michael Hannon > #+EMAIL: jm_hannon@yahoo.com > #+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes > > #### Example taken from: > #### http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.html > > * Example of Org-Babel for R Literate Programming > ** R text output > A simple summary. > #+begin_src R > x <- rnorm(10) > summary(x) > #+end_src > > ** R graphics output > Note we use the object =x= generated in previous code block, thanks to > the header option =:session *R*=. The output graphics file is > =a.png=. > > #+begin_src R :file a.png > y <- rnorm(10) > plot(x, y) > #+end_src > > Same plot with larger dimension: > > #+begin_src R :file b.png :width 800 :height 800 > plot(x, y) > #+end_src > > ---------- Org-Mode path variables, standard and devel versions > > (setq load-path (cons "/usr/local/emacs.d/ssh" load-path)) > (require 'ssh) > > ;;;;;;(setq load-path (cons "/usr/local/emacs.d/org-mode/org-7.7/lisp" load-path)) > > ;;;;;;(setq load-path (cons "/usr/local/emacs.d/org-mode/org-7.7/contrib/lisp" load-path)) > > (setq load-path (cons "/usr/local/emacs.d/org-mode/org-devel/org-mode/lisp" load-path)) > > (setq load-path (cons "/usr/local/emacs.d/org-mode/org-devel/org-mode/contrib/lisp" load-path)) > > (require 'org-install) > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Problems with Org-Mode export 2011-09-21 14:37 ` Nick Dokos @ 2011-09-21 19:10 ` Michael Hannon 0 siblings, 0 replies; 11+ messages in thread From: Michael Hannon @ 2011-09-21 19:10 UTC (permalink / raw) To: nicholas.dokos@hp.com; +Cc: Org-Mode List [-- Attachment #1: Type: text/plain, Size: 3563 bytes --] Thanks, Nick. I just grabbed: Org-mode version 7.7 (release_7.7.314.g12f0) and don't seem to have the problem any more. -- Mike >________________________________ >From: Nick Dokos <nicholas.dokos@hp.com> >To: Michael Hannon <jm_hannon@yahoo.com> >Cc: nicholas.dokos@hp.com; Org-Mode List <emacs-orgmode@gnu.org> >Sent: Wednesday, September 21, 2011 7:37 AM >Subject: Re: [O] Problems with Org-Mode export > >Michael Hannon <jm_hannon@yahoo.com> wrote: > >> Nick Dokos <nicholas.dokos@hp.com> wrote: >> >> > 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. >> > >I pulled from latest and reran both the original test file and the test >file below. I get no errors either with my standard config or with a >minimal .emacs in either case. > >Version info for reference: > >Org-mode version 7.7 (release_7.7.311.g0c099) > >GNU Emacs 24.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-09-13 > >This is on Ubuntu 10.10. > >Nick > >> Thanks, Nick. This is getting curiouser and curiouser. I can now reliably >> get documents exported using the vanilla 7.7 Org-Mode, but not with the >> development version I currently have installed: >> >> Org-mode version 7.7 (release_7.7.304.g9da4) >> >> I suspect that the following bit of the error message is the relevant one: >> >> org-babel-R-evaluate: Wrong number of arguments: #[(session body result-type >> result-params column-names-p row-names-p >> >> but I don't know what to make of it. >> >> In order to simplify the discussion, I've been working with some Org code that >> I took from the "worg" web site. Please see below for details. >> >> I've also appended the pieces of my .emacs file that relate to finding Org >> files. >> >> At this point I guess I'm ready to declare victory and slink away, but it >> WOULD be interesting to know what's going on. >> >> -- Mike >> >> ---------- >> >> #+TITLE: Test >> #+AUTHOR: Michael Hannon >> #+EMAIL: jm_hannon@yahoo.com >> #+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes >> >> #### Example taken from: >> #### http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.html >> >> * Example of Org-Babel for R Literate Programming >> ** R text output >> A simple summary. >> #+begin_src R >> x <- rnorm(10) >> summary(x) >> #+end_src >> >> ** R graphics output >> Note we use the object =x= generated in previous code block, thanks to >> the header option =:session *R*=. The output graphics file is >> =a.png=. >> >> #+begin_src R :file a.png >> y <- rnorm(10) >> plot(x, y) >> #+end_src >> >> Same plot with larger dimension: >> >> #+begin_src R :file b.png :width 800 :height 800 >> plot(x, y) >> #+end_src >> >> ---------- Org-Mode path variables, standard and devel versions >> >> (setq load-path (cons "/usr/local/emacs.d/ssh" load-path)) >> (require 'ssh) >> >> ;;;;;;(setq load-path (cons "/usr/local/emacs.d/org-mode/org-7.7/lisp" load-path)) >> >> ;;;;;;(setq load-path (cons "/usr/local/emacs.d/org-mode/org-7.7/contrib/lisp" load-path)) >> >> (setq load-path (cons "/usr/local/emacs.d/org-mode/org-devel/org-mode/lisp" load-path)) >> >> (setq load-path (cons "/usr/local/emacs.d/org-mode/org-devel/org-mode/contrib/lisp" load-path)) >> >> (require 'org-install) >> >> > > > > [-- Attachment #2: Type: text/html, Size: 5266 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-10-04 12:36 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-09-16 17:50 Problems with Org-Mode export Michael Hannon 2011-09-16 20:04 ` Michael Hannon 2011-09-17 4:59 ` David Maus 2011-09-19 21:17 ` Michael Hannon 2011-09-19 23:20 ` [PATCH] Check argument is a string before calling string-match Bernt Hansen 2011-10-04 12:36 ` [Accepted] " Carsten Dominik 2011-09-20 19:31 ` Problems with Org-Mode export Michael Hannon 2011-09-20 20:29 ` Nick Dokos 2011-09-21 1:09 ` Michael Hannon 2011-09-21 14:37 ` Nick Dokos 2011-09-21 19:10 ` Michael Hannon
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.