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

Greg Snow Greg.Snow at imail.org
Wed Dec 8 05:24:27 CET 2010

See inline below

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Paul Miller
> Sent: Tuesday, December 07, 2010 4:29 PM
> To: r-help at r-project.org
> Subject: [R] LaTeX, MiKTeX, LyX: A Guide for the Perplexed
> Hello Everyone,
> 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.
> 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?

MikTeX is a flavor of LaTeX for windows, so there is not much to decide between them, MikTeX is LaTeX (though there are other implementations on windows)

> 2. What are the best sources of information about LaTeX, MiKTeX, LyX,
> etc.?

There are many documents about LaTeX, including books. But I would suggest starting with the "Not So Short Introduction to LaTeX" that is free and comes with MikTeX (and probably the others).  LyX should have its own docs with it.  There are several other guides that come free that would be good to read after that.  If you want a paper book then I would suggest the original by Lamport.

> 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?

That depends on your background, if you have never worked from the command line or with a markup language, then it is pretty steep, if you have worked with those types of tools then it is not as bad.  But either way it is worth it.  When I first learned LaTeX I was tempted to go back and rewrite my master's thesis in it instead of the word processor.  I did not, but my dissertation was in LaTeX.

> 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?

Sharing LaTeX documents with people using word processors only is no more difficult than giving driving directions to someone who is blindfolded and has all 4 limbs tied behind their back.  Collaboration with people who insist on using programs that process their words much like a food processor processes food is the one legitimate reason to not use LaTeX (but untying them and removing the blindfold is much better).  If you just need basic input or approval then give them a paper version or pdf file and then you make the changes.  If they are going to be writing major portions or doing a lot of editing, then using LaTeX without all people understanding it will be a headache.

Some other packages to consider are odfWeave (odf is the opensource office suite, it can read and write MSWord documents, but still sweave with R); R2HTML works with sweave where the base document is in html;  sword is a tool from the same group as rexcel that gives the same general idea as sweave but using MSWord (windows only). 

> Thanks,
> Paul

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org

More information about the R-help mailing list