mv123
August 31, 2022, 12:20pm
1
On my old laptop I could use knitr to create pdf files from Rnw files. On my new laptop, compilation of the Rnw file to a tex file works well (and I can convert this tex file to a pdf file in Winedt without problems) but in Rstudio I get the following error message:
[1] "Part2.tex"
Running pdflatex.exe on Part2.tex...failed
Error running C:/Program Files/MiKTeX/miktex/bin/x64/pdflatex.exe (exit code -1073740791)
The pdflatex.exe file is indeed located in that directory, which is also in the PATH, but it still does not work?
How to solve this (or how to find out what the problem is)?
cderv
September 7, 2022, 8:24am
2
Can you have access to some log from MikTeX about the error ?
Is this only happening inside RStudio ?
It may be a known issue as I found
opened 09:56PM - 24 Feb 21 UTC
bug
info needed
sweave
### System details
RStudio Edition : Desktop
RStudio Version : 1.4.1… 103 and 1.4.1106-4
OS Version : Windows 10 PRO 20H2 Build 19042
R Version : R-3.6.3 and R-4.0.4 and pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.2)
### Steps to reproduce the problem
File -> New File -> R Sweave
Content of example file 'test_miktex_sweave.Rnw':
```
\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}
some text
\end{document}
```
### Describe the problem in detail
Compile PDF output:
```
Writing to file test_miktex_sweave.tex
Processing code chunks with options ...
You can now run (pdf)latex on 'test_miktex_sweave.tex'
Running pdflatex.exe on test_miktex_sweave.tex...failed
Error running C:/Users/USER/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe (exit code -1073740791)
```
### Describe the behavior you expected
.pdf file created from within RStudio
Remark: switching to Terminal in working directory and issuing command
`pdflatex test_miktex_sweave.tex` will produce the .pdf, since execution (exit code -1073740791) stops only AFTER 'test_miktex_sweave.tex' has been created in the document directory.
```
$ pdflatex test_miktex_sweave.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.2)
entering extended mode
(test_miktex_sweave.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18> xparse <2020-03-03>
(C:\Users\USER\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
...
....
```
- [X] I have read the guide for [submitting good bug reports](https://github.com/rstudio/rstudio/wiki/Writing-Good-Bug-Reports).
- [X] I have installed the latest version of RStudio, and confirmed that the issue still persists.
- [] If I am reporting a RStudio crash, I have included a [diagnostics report](https://support.rstudio.com/hc/en-us/articles/200321257-Running-a-Diagnostics-Report).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
=== ORIGINAL PART OF ISSUE ==================
Just my 2ct on this - it does not seem to be linked to "tinytex" exclusively - at least if you deselect `Use tinytex when compiling` (or even remove the package completely) `Compile PDF` runs into error `...pdflatex (exit code -1073740791)`
_Originally posted by @gwd999 in https://github.com/rstudio/rstudio/issues/8725#issuecomment-785409033_
pdflatex.log
```
2021-02-24 23:29:31,150+0100 INFO pdflatex - this process (2188) started by 'rsession' with command line: C:/Users/USER/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe --version
2021-02-24 23:29:31,163+0100 INFO pdflatex - allowing known shell commands
2021-02-24 23:29:31,181+0100 INFO pdflatex - this process (2188) finishes with exit code 0
```
Error is also present in 1.4.1106-4 preview.
There was a post on Stackoverflow that mentions this behaviour with a workaround ["solution":](https://tex.stackexchange.com/questions/582041/r-sweave-does-not-compile-to-pdf/582528#582528) to uninstall MikTex and install an older version (MiKTeX64-2.9.7269-basic) and not update Miktex or the packages, which is not the most sustainable/promising strategy imho.
system
Closed
September 28, 2022, 8:25am
3
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.