yihui 好的!新版 rmarkdown 已安装。我用 RStudio 新建 bookdown 项目得到了 'A Minimal Book Example',build 出了一个 test.tex 文件,里面的参考文献声明如下:
\bibliography{book.bib,packages.bib}
下面是用 tinytex + CTeX 对 test.tex 文件的编译信息。貌似找到 .bib 文件了:Found bibliography file(s) [book.bib packages.bib]
,但 .bbl 文件里的条目是空的。
> tinytex::pdflatex('test.tex')
Error: Failed to compile test.tex.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "test.tex"' had status 1
> tinytex::latexmk('test.tex', 'pdflatex')
Latexmk: This is Latexmk, John Collins, 20 Nov. 2017, version: 4.54.
Rule 'pdflatex': File changes, etc:
Changed files, or newly in use since previous run(s):
'test.aux'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -halt-on-error -interaction=batchmode -recorder "test.tex"'
------------
Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6500)
entering extended mode
Latexmk: Found input bbl file 'test.bbl'
Latexmk: Log file says output to 'test.pdf'
Latexmk: List of undefined refs and citations:
Citation `R-bookdown' on page 7 undefined on input line 249
Citation `xie2015' on page 7 undefined on input line 250
=== TeX engine is 'pdfTeX'
Latexmk: Found bibliography file(s) [book.bib packages.bib]
Latexmk: Summary of warnings:
Latex failed to resolve 2 citation(s)
Rule 'pdflatex': File changes, etc:
Changed files, or newly in use since previous run(s):
'test.toc'
------------
Run number 2 of rule 'pdflatex'
------------
------------
Running 'pdflatex -halt-on-error -interaction=batchmode -recorder "test.tex"'
------------
Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6500)
entering extended mode
Latexmk: Found input bbl file 'test.bbl'
Latexmk: Log file says output to 'test.pdf'
Latexmk: List of undefined refs and citations:
Citation `R-bookdown' on page 7 undefined on input line 249
Citation `xie2015' on page 7 undefined on input line 250
=== TeX engine is 'pdfTeX'
Latexmk: Found bibliography file(s) [book.bib packages.bib]
Latexmk: Summary of warnings:
Latex failed to resolve 2 citation(s)
Latexmk: All targets (test.pdf) are up-to-date
Warning message:
running command '"latexmk" -pdf -latexoption=-halt-on-error -interaction=batchmode -pdflatex=pdflatex "test.tex"' had status 12
> devtools::session_info()
Session info -------------------------------------------------------------------------------
setting value
version R version 3.4.3 (2017-11-30)
system x86_64, mingw32
ui RStudio (1.1.383)
language (EN)
collate Chinese (Simplified)_People's Republic of China.936
tz Europe/Berlin
date 2017-12-20
Packages -----------------------------------------------------------------------------------
package * version date source
base * 3.4.3 2017-11-30 local
compiler 3.4.3 2017-11-30 local
curl 3.0 2017-10-06 CRAN (R 3.4.2)
datasets * 3.4.3 2017-11-30 local
devtools 1.13.4 2017-11-09 CRAN (R 3.4.3)
digest 0.6.12 2017-01-27 CRAN (R 3.3.2)
git2r 0.19.0 2017-07-19 CRAN (R 3.4.1)
graphics * 3.4.3 2017-11-30 local
grDevices * 3.4.3 2017-11-30 local
httr 1.3.1 2017-08-20 CRAN (R 3.4.1)
memoise 1.1.0 2017-04-21 CRAN (R 3.3.3)
methods * 3.4.3 2017-11-30 local
R6 2.2.2 2017-06-17 CRAN (R 3.3.3)
stats * 3.4.3 2017-11-30 local
tinytex 0.1.6 2017-12-19 Github (yihui/tinytex@acbc9db)
tools 3.4.3 2017-11-30 local
utils * 3.4.3 2017-11-30 local
withr 2.1.0 2017-11-01 CRAN (R 3.4.3)
yaml 2.1.16 2017-12-12 CRAN (R 3.4.3)