[R] LaTeX, MiKTeX, LyX: A Guide for the Perplexed

Rainer M Krug r.m.krug at gmail.com
Wed Dec 8 10:23:48 CET 2010

Hash: SHA1

On 12/08/2010 12:29 AM, Paul Miller wrote:
> Hello Everyone,

Hi Paul,

> Been learning R over the past several months. Read several books and
> have learned a great deal about data manipulation, statistical
> analysis, and graphics.
> Now I want to learn how to make nice looking documents and about
> "literate programming." My understanding is that R users normally do
> this using LaTeX, MiKTeX, LyX, etc. in conjuction with Sweave. An
> alternative might be to use the R2wd package to create Word
> documents.

Different option to sweave:

I am using org-mode in emacs. You have to get used to emacs, but then
you have huge advantages (probably over sweave as well):

1) in emacs, you use ESS, the most useful R editor (personal opinion -
no war vim versus emacs versus rkward versus ... intended)

2) your document, as in sweave, can be exported to LaTeX, but also to
html and other formats

3) as in sweave, you can tangle your code, but not only that:
org-mode (or more accurate the included org-babel) allows you to combine
different programming language in your document (e.g.
which combines ruby, R and gnuplot)

last but not least,
4) org mode, apart from its use for literate programming, is a task
manager, time manager, ... . Therefore you can easily include TODO items
in your document, selectively show your all TODO items, kepp track of
your time you spend on certain projects (usefull for consultancies but
also simply to keep track what you are doing).

Finally: it is no as difficult as it sounds, as you only have to know
about the literate programming with org-babel, and then you can start.
The rest will follow.

Here is a link which gives an introduction to R in org-babel:


and also


See also http://orgmode.org/worg/org-contrib/babel/uses.php for a
comparison between sweave and org-mode / org-babel.

- From personal experience, org-mode has dramatically changed (and
improved) the way I use R and how I write code (long simulation models).


> So I guess I have four questions:
> 1. How do I choose between the various options? Why would someone
> decide to use LaTeX instead of MiKTeX or vice versa for example?
> 2. What are the best sources of information about LaTeX, MiKTeX, LyX,
> etc.?
> 3. What is the learning curve like for each of these? What do you get
> for the time you put in learning something that is more difficult?
> 4. How do people who use LaTeX, MiKTeX, LyX, etc. share documents
> with people who are just using Word? How difficult does using LaTeX,
> MiKTeX, LyX, etc. make it to collaborate on projects with others?
> Thanks,
> Paul
> [[alternative HTML version deleted]]
> ______________________________________________ R-help at r-project.org
> mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do
> read the posting guide http://www.R-project.org/posting-guide.html 
> and provide commented, minimal, self-contained, reproducible code.

- -- 
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
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer at krugs.de

Skype:      RMkrug
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the R-help mailing list