WinEdt's Options - Configurations Menu allows you to instantly switch between MiKTeX and TeX Live configurations should you decide to give both TeX Systems a try: If you want to use WinEdt with TeX Live, you should execute the menu command: Options - Configurations - TeX Live This will reconfigure WinEdt for TeX Live distribution.
Active1 year, 1 month ago
I have been trying to get pdflatex to use the correct version of miktex and have not been successful.
I have set the R Path to have the correct location of Miktex 2.9, and verified that it worked with:
However when i look at the version of miktex that pdflatex is using:
This 1.9 path is to an old version of miktex that no longer even exists.
Running in the command prompt which pdflatex returns the correct path, so the problem is just in R. How can I get R to use the correct path to pdflatex?
clairekelleyclairekelley
1 Answer
There are couple solutions you can try:
- Set the path manually per this answer. You will have to run this every time you restart RStudio.
- Put the following line in
Renviron.site
in the folderR_HOME/etc
whereR_HOME
is the path returned bySys.getenv('R_HOME')
. Ref - Install
tinytex
package.Note that you should use either MiKTeX ortinytex
, but not both. If you have both installed, Yihui recommended that you remove MiKTeX in this case. Ref
You might have to restart R/RStudio or even your PC/laptop after each change to see if it works or not
TungTung12.4k22 gold badges4343 silver badges5757 bronze badges
Not the answer you're looking for? Browse other questions tagged rlatexr-markdownpdflatex or ask your own question.
Active3 years, 10 months ago
On Windows, how could I instruct R to call TeXlive instead of MikTeX?
I've got R set up on my Linux and Windows machines. On my Windows machines, I happen to have both MikTeX and TeXlive available. For reasons I won't go into I'd like R to call TeXlive. At this time, R is picking up MikTeX instead.
I'm guessing I would need to set TEXINPUTS inside my Renviron file, or something similar. But I haven't been able to find precise instructions online. Help will be appreciated.
UPDATE: Here are different things I tried: changing the order of TeXlive and MikTeX in the PATH. Removing MikTeX from the path. Neither worked, MikTeX is still being picked up.
I couldn't find the relevant documentation for R, but I did find some hints in the RStudio documentation, so I attempted to solve the problem within RStudio. I successfully defined the RSTUDIO_PDFLATEX environment variable:
[Reference: http://www.rstudio.com/ide/docs/authoring/latex_program?version=0.97.312&mode=desktop]
but MikTeX is still called upon.
UPDATE 2: Another thing I've tried: While texlive is already on my PATH, just in case I added it from within R.
I also tried to set the path to pdflatex as returned by Sys.which('pdflatex') with the following:
as well as variants with PDFLATEX or 'PDFLATEX', but that doesn't help. I have also removed everything from the path except the path to texlive:
That gives me the desired path
However, running texi2dvi fails:
PatrickTPatrickT4,07955 gold badges4545 silver badges8080 bronze badges
2 Answers
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:
- uninstall your current MikTeX distro
- cleanup the registry (ccleaner worked out well)
- 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
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
user4400585
I'm pretty sure you need to add paths here in your global environment variables. See: http://statmath.wu.ac.at/software/R/qfin/ and http://www.howtogeek.com/51807/how-to-create-and-use-global-system-environment-variables/
ZagNutZagNut