代码在 R 中可以运行,但在 LaTeX 中编译时则不行

代码在 R 中可以运行,但在 LaTeX 中编译时则不行

我正在尝试在 LaTeX 中编译代码(该代码由 R 中的 knitr 准备)。在 RStudio 中一切似乎都正常:

Writing to file Trial.tex
Processing code chunks with options ...
 1 : keep.source term verbatim (Trial.Rnw:48)
 2 : keep.source term verbatim (label = setup, Trial.Rnw:59)
Loading required package: carData

Attaching package: 'dplyr'

The following object is masked from 'package:car':

    recode

The following objects are masked from 'package:data.table':

    between, first, last

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union


Attaching package: 'kableExtra'

The following object is masked from 'package:dplyr':

    group_rows


Attaching package: 'gridExtra'

The following object is masked from 'package:dplyr':

    combine

corrplot 0.84 loaded
ResourceSelection 0.3-4      2019-01-08
 3 : keep.source term hide (Trial.Rnw:83)
 4 : keep.source term verbatim pdf  (Trial.Rnw:99)
 5 : keep.source term verbatim pdf  (Trial.Rnw:117)
 6 : keep.source term verbatim pdf  (Trial.Rnw:123)
 7 : keep.source term tex (Trial.Rnw:129)
 8 : keep.source term tex (Trial.Rnw:138)
 9 : keep.source term verbatim pdf  (Trial.Rnw:146)
10 : keep.source term hide (Trial.Rnw:153)
11 : keep.source term hide (Trial.Rnw:166)
12 : keep.source term verbatim (Trial.Rnw:179)
13 : keep.source term tex (Trial.Rnw:182)
14 : keep.source term verbatim (Trial.Rnw:188)
15 : keep.source term tex (Trial.Rnw:191)
16 : keep.source term verbatim (Trial.Rnw:195)
17 : keep.source term tex (Trial.Rnw:198)
18 : keep.source term verbatim (Trial.Rnw:203)
19 : keep.source term tex (Trial.Rnw:214)
The following objects are masked from wcgs (pos = 3):

    age0, arcus0, behpat0, chd69, chol0, dbp0, dibpat0, height0, id,
    ncigs0, sbp0, time169, typechd, weight0

20 : keep.source term tex (Trial.Rnw:222)
21 : keep.source term verbatim (Trial.Rnw:230)
22 : keep.source term verbatim (Trial.Rnw:234)
23 : keep.source term verbatim (Trial.Rnw:238)
24 : keep.source term verbatim (Trial.Rnw:242)
25 : keep.source term verbatim (Trial.Rnw:251)
26 : keep.source term tex (Trial.Rnw:262)

You can now run (pdf)latex on 'Trial.tex'
By�o 50 lub wi�cej ostrze�e� (u�yj 'warnings()' aby zobaczy� pierwsze 50)
Running pdflatex.exe on Trial.tex...failed
Error running C:/PROGRA~1/MIKTEX~1.9/miktex/bin/x64/pdflatex.exe (exit code 1)

完成此操作后,TeX 中会创建两个文件夹:Trial 和 Trial-concordance。不幸的是,当我尝试编译第一个或第二个代码时,会出现错误

File `Sweave.sty' not found. \begin

这两个文件都在同一个文件夹中(我不知道这是否有必要,更确切地说没有必要)。如能得到任何帮助,我将不胜感激。

相关内容