Tinytex: Compile Rnw documents in RStudio using tinytex

Created on 25 Dec 2017  路  10Comments  路  Source: yihui/tinytex

In the future, it will be nice to build PDF from Rnw documents using tinytex as well, although I don't think Rnw is still widely used today.

enhancement

All 10 comments

although I don't think Rnw is still widely used today.

It is used today. By lots of old farts of my kind who doesn't find in Markdown the extensive facilities offered by LaTeX (indexing, cross-referencing, references, auto-tables, etc...) which are _indispensable_ to _easy_ structured writing.

I _think_ that this array of facilities _may_ be implemented in something like Markdown (or pandoc). It just turns out that no implementation offers them in a consistent way (pandoc comes near, but still has a lot to cover).

Since our publication modes are changing (screen-oriented material, such as Web pages (hypertext) and slides have needs very different from those of page-oriented material (i. e. papers)), the tools we use have to change. But the needs are the same :

  • a cross-reference to a page number is meaningless on a Web page. But the need for the cross-reference still exists.
  • A bibliographic reference does not need a number pointing to a list. But the (scholarly) need for the reference still exists.
  • A (fixed) image carries less information than (say) a movie or an animation (or a sound file). But the need for illustration still exists.

As far as I know, the needs fulfilled by LaTeX and consorts for page-oriented production are still out of reach of available screen-oriented programs. So we are between two worlds : Latex is a good solution for producing page-oriented (= outmoded) output, and we do not have (yet) the "right" set of programs to produce screen-oriented (hypertext) material.

And don't get me started on the typographic problems : most of the current production of screen-oriented material is just plain horrible in terms of ease of reading when compared to a (properly typeset) printed page. But the knowledge necessary to the production of easy-to-read screen-oriented (hypertext) material just doesn't exists. Whereas the printed-page production can use >5 centuries in experience of production, whic gives it a lot of empirical evidence.

So do not kill .Rnw too fast...

Rest assured that we will _never_ kill .Rnw. I was just saying that Rmd might be more popular, and tinytex has been supported there. Next we need to consider the support for Rnw (if I don't care about Rnw, I wouldn't even file this issue at all).

I was just saying that Rmd might be more popular, and tinytex has been supported there.

Indeed : Markdown (and .Rmd) are (rightly) popular with (e. g.) students, because it fulfills (well !) their needs (e. g. homework and simple papers).

Standard academic publication has other needs. Ditto for book publishing. Ditto for grant submission. Ditto ... _ad nauseam_...

BTW : I am not as sanguine as you are about tinytex. I came a long time ago to the conclusion that a "full" TeXlive was worth its space on disk. However, the idea of downloading packages "on demand" iqs a nice one. I'll take the time to give you a more pondered answer _after_ taking the time to think about it.

Yeah, try it and see if you want to update your conclusion.

I don't want to argue about Markdown vs LaTeX. All I want to do is show that I'm able to write books with R Markdown at a much faster speed than when I was in the LaTeX world, because I don't have to follow the "standard academic" typesetting rules, which are often more harmful than helpful in my opinion. That said, here is what I always say to LaTeX users: if you are comfortable and you think you are more productive with LaTeX, just stay with it. That is totally fine, and I'm happy to support Rnw. I don't mean R Markdown is universally better, and I don't mean R Markdown should replace LaTeX, as I said in 2016: https://blog.rstudio.com/2016/12/02/announcing-bookdown/

What is new in the IDE (latest Preview 1.4.1103 version):

  • There is now a switch in the Global option menu to activate to use tinytex for tex rendering.
    image
  • This can also be configure in RStudio's user preference file using "use_tinytex": true (open with CTRL+SHIFT+P and Edit User Prefs file or use usethis::edit_rstudio_prefs())

However, even with this switch activated, it does not seem that tinytex::latexmk() is used to compile the PDF (for Rnw, or TeX file)

However, even with this switch activated, it does not seem that tinytex::latexmk() is used to compile the PDF (for Rnw, or TeX file)

in fact, the ability to compile Rnw to PDF in the IDE using tinytex was done in https://github.com/rstudio/rstudio/pull/8570
It was not merged in _master_ so I believe it will be possible for a release following the 1.4 preview or 1.4 release.
We'll have to wait a bit to have that available in the IDE but, the feature has been implemented already.

About tex file only using tinytex, I got an issue : https://github.com/rstudio/rstudio/issues/8725 but it could be a windows issue only.

Hi everyone. I confirm this now works in the new rstudio daily version. This means it will be included in the coming first patch release to the new 1.4.

If you can't wait, you can access the new daily from here: https://dailies.rstudio.com/

@yihui should we consider this closed ? or close when it is released ?

I think we can close this issue now. Thanks for testing!

Was this page helpful?
0 / 5 - 0 ratings