[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Babel and R issue when exporting to PDF via LaTeX in Windows 7

From: Ben Ward
Subject: [Orgmode] Babel and R issue when exporting to PDF via LaTeX in Windows 7
Date: Sun, 2 Jan 2011 19:31:39 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv: Gecko/20101207 Thunderbird/3.1.7

Hi, all, I hope someone can help with this issue,

Unfortunately I'm having a work PC upgrade, and it means Windows 7 and the order not to install any other system on it for compatibility and for the IT experts - I use the term loosely, to only need to know how to use one system.

Im trying to get org-mode set up with emacs so I can icorporate R code in my documents - like Sweave functionality. I have this achieved in Arch Linux. Howeer when I export to PDF in Windows 7 I'm just getting a PDF with Titl, Author, Date, and Contents and then no R stuff.

I have set up emacs by extracting emacs-23.2-bin-i386. Program Files, and I ran addpm.exe. My home is set to C:\Users\"My Name" and in that location, I have a folder .emacs.d, which contains my init.el, because it's awkward to begin a filename with a dot.

I extracted the vaniall ESS zip file to C:\Program Files\emacs-23.2-bin-i386\site-lisp, and I did the same for org 7.4.

I then had the following init.el setup:

> ;; Loading ESS
> (require 'ess-site)
> ;; Loading Org-Mode
> (require 'org-install)
> (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
> (global-set-key "\C-cl" 'org-store-link)
> (global-set-key "\C-ca" 'org-agenda)
> (global-set-key "\C-cb" 'org-iswitchb)
> (global-font-lock-mode 1)
> (transient-mark-mode 1)
> ;; Babel Configuration
> (org-babel-do-load-languages 'org-babel-load-languages '((R . t)(ditaa . t)(dot . t)(emacs-lisp . t)(gnuplot . nil)(haskell . nil)(latex . t)(ocaml . nil)(perl . t)(python . t)(ruby . t)(screen . nil)(sh . t)(sql . nil)(sqlite . nil)))

This in Linux: the extraction and installation of ess, and install of org 7.4 (in Linux I would use "make install", but in Windows when I just extract it to site-lisp, and then go into Emacs with the above init file and do M-x org and show the version number it changes from the old 5.** to 7.4, so it's clearly loading the right stuff), would normally be enough for everything to work. However in Windows I'm getting blank PDF's without any R stuff, although I did do a HTML export and the R code and results did get included into that.

The org file with test R code is really very simple:

#+TITLE: A Test of the org-babel features with the R Stats Language, with a Windows 7 setup.
#+AUTHOR: Ben J. Ward
#+BABEL: :session *R* :results output

Below is code generating a vector calld data, and then a call of it's name that should display the numbers that make it up:

#+begin_src R :exports both
data <- c(1,2,3,4,5)

I've tried first with TeXLive and then with MiKTeX and I've had trouble with both. Yet the evaluation through ESS is definately working: I can do C-c C-c on code chunks and get the familar #+results: line in my org file as I do it.

My Linux install uses TeXLive - incase it's relevant.

If anyone can give me some advice or instruction with this I'd be eternally grateful.

Ben Ward.

For extra information, you can see the intermediate .tex file produced, below - it doesent contain any verbatim of code or output of R:

> % Created 2011-01-02 Sun 19:25

> \documentclass[11pt]{article}

> \usepackage[latin1]{inputenc}

> \usepackage[T1]{fontenc}

> \usepackage{fixltx2e}

> \usepackage{graphicx}

> \usepackage{longtable}

> \usepackage{float}

> \usepackage{wrapfig}

> \usepackage{soul}

> \usepackage{textcomp}

> \usepackage{marvosym}

> \usepackage{wasysym}

> \usepackage{latexsym}

> \usepackage{amssymb}

> \usepackage{hyperref}

> \tolerance=1000

> \providecommand{\alert}[1]{\textbf{#1}}

> \begin{document}

> \title{A Test of the org-babel features with the R Stats Language, with a Windows 7 setup.}

> \author{Ben J. Ward}

> \date{02 January 2011}

> \maketitle

> \setcounter{tocdepth}{3}

> \tableofcontents

> \vspace*{1cm}

> \end{document}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]