我似乎无法破解所有的可能性,并在RStudio的PDF输出中插入了完整的引用书目,knitr,.Rnw脚本和“编译PDF”按钮。 PDF中所需的文本将是所引用作品的详细信息。

这是一个保存在工作目录中的Lilliputian bibtex文件,称为jabrefbibtest.bib

@Book{GreentargetEngagement2012,
  Title                    = {"2012 - In - House Counsel New Media Engagement Survey"},
  Author                   = {"Inside Counsel "},
  Publisher                = {"Greentarget"},
  Year                     = {"2012"},
  Pages                    = {"20"},
  Plots                    = {"9"},
  Tables                   = {"0"},
  Url                      = {"http://www.greentarget.com/wp-content/uploads/2012/01/2012GTZGICSurveyReportFinal-WebsiteVersion.pdf"}
}
@Book{CitiprivateBank,
  Title                    = {"Intellectual Leadership with Law Watch"},
  Author                   = {""},
  Publisher                = {""},
  Year                     = {"2008"},
  Pages                    = {"2"},
  Plots                    = {"1"},
  Tables                   = {"4"},
  Url                      = {"http://www.citigroup.com/privatebank/lawassociates/pdfs/lawwatch/slipsheet.pdf"}
}

删除的.Rnw脚本是
\documentclass[11pt]{article}

\usepackage[backend=bibtex]{biblatex}
% \addbibresource{}     # not sure if this is needed

\begin{document}

<<bibbackground, echo=FALSE, include=FALSE>>=
setwd("~/R/knitr docs/")
Sys.setenv(TEXINPUTS=getwd(),
           BIBINPUTS=getwd(),
           BSTINPUTS=getwd())
@

\bibliographystyle{plain}
\bibliography{jabrefbibtest}

Here is one citation \cite{GreentargetEngagement2012} and here is a second \cite{CitiprivateBank}.

Now do full References show below?

\printbibliography
\end{document}

日志:
! Package biblatex Error: '\bibliographystyle' invalid.

See the biblatex package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.59 \bibliographystyle{plain}

Use the package option 'style' instead.
I'm ignoring this command.


! LaTeX Error: Can be used only in preamble.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.60 \bibliography
                  {jabrefbibtest}
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

LaTeX Warning: Citation 'GreentargetEngagement2012' on page 1 undefined on inpu
t line 62.
[more omitted]

连同《 latex 伴侣》,《由R编成的动态文档》,谢一辉(Yihui Xie),两本LaTeX入门书籍和262页的biblatex手册,我一直在努力寻找这些站点的复杂建议。一无所获。

https://tex.stackexchange.com/questions/71565/knitr-and-biblatex

https://tex.stackexchange.com/questions/63852/question-mark-instead-of-citation-number

http://texblog.org/2013/08/20/rknitr-automatic-bibliography-generation-with-biblatex-in-rstudio/

http://www.inside-r.org/packages/cran/knitcitations/docs/bibliography

,在COMMENTS 之后进行编辑

所有的PDF文件是这样的:

引用
这是一个引文[?],而第二个[?]。
现在,下面显示完整的引用文献吗?

最佳答案

正如错误消息告诉您的那样:

  • 不要使用\bibliographystyle{plain}(这不适用于biblatex);改用style中的\usepackage[]{biblatex}选项;
  • \bibliography{jabrefbibtest}必须放在前言中,而不是在正文中。

  • 更正这些问题后,它应该可以工作:
    \documentclass[11pt]{article}
    
    \usepackage[backend=bibtex]{biblatex}
    \bibliography{jabrefbibtest}
    % or use \addbibresource{jabrefbibtest.bib}
    
    \begin{document}
    
    Here is one citation \cite{ABFWomenFirstChairs2015} and
    here is a second \cite{ACCGCSkills2013}.
    
    Now do full References show below?
    
    \printbibliography
    \end{document}
    

    顺便说一句,RStudio可能不支持biber的默认后端biblatex,因此使用了backend=bibtex选项。

    关于r - 使用适用于LaTeX的knitr和.Rnw,如何在PDF输出中打印完整的引用书目?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33332654/

    10-11 04:53