Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up R to pick up texlive rather than miktex on Windows

People also ask

How do I change from MiKTeX to TeX Live?

Simply change the order of the two entries with “Up” or “Down”, click “Save”, and you're all set (after the editor restart). I have now uninstalled MikTeX, but TeX still successfully compiles, so it appears to have worked.

How do I use TeX Live on Windows?

To install TeX Live, complete the following steps: Download TeX Live installation file from http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip. Extract the file, and copy the TeX Live installation folder to a directory on the server. Run the following command.

Which one is better MiKTeX or TeX Live?

Only MiKTeX can do 'on the fly' package installation, as TeX Live is more focused on having a system that works well on multi-user systems. TeX Live defaults to installing everything, which means that if you want everything it's (marginally) easier to use TeX Live than MiKTeX.

What is the difference between MiKTeX and TeX Live?

TeX Live was originally developed on Unix and so is available for Linux and on the Mac (and other systems) as well as Windows; MiKTeX is a Windows system so is (more-or-less) Windows-only. So if you want exactly the same set up on Windows and other operating systems, this of course means you need to use TeX Live.


I was confronted with the same issue in a similar project and spent some time understanding the tricks. The fact that MikTeX comes out selected even if you cleaned up the path results from the somewhat exasperating fact (especially for *nix-oriented devs like me and others) that on installing MikTeX, a fairly big number of Windows registry entries is set. The portable MikTeX (win32 only) distro is the sole exception to this. So if you do need MikTeX on board, my advice is just to do what I did:

  1. uninstall your current MikTeX distro
  2. cleanup the registry (ccleaner worked out well)
  3. install the portable win32 MikTeX distro

Now check that your path does include your TeXlive bin directory path again.
If you use pandoc for creating pdf files from Rmarkdown or other markdown languages, a convenient way to work around path issues is to specify the --latex-engine option and add the full filepath as an argument. Below is a possible command line, adapted from the RStudio IDE:
path/to/pandoc.exe -V papersize=A4 +RTS -K512m -RTS file.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output file.pdf --template path/to/default.tex --highlight-style tango --latex-engine /path/to/pdflatex.exe --variable geometry:margin=1in