Nie wydaje mi się, aby zhakować sobie przez wszystkie możliwości i mieć pełną bibliografię wstawioną do pliku wyjściowego PDF RStudio, knitr
, skryptu .Rnw i przycisku "Kompiluj PDF". Żądanym tekstem w pliku PDF będą szczegóły cytowanych prac.Z knitr i .Rnw dla LaTeXa, jak wydrukujesz pełną bibliografię w pliku PDF?
Oto plik Liliputki bibtex o nazwie jabrefbibtest.bib
zapisany w katalogu roboczym.
@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"}
}
Skrypt .Rnw
, okrojona, to
\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}
Dziennik:
! 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]
Wraz z lateksu Companion, Dokumenty dynamiczne z R i knitr przez Yihui Xie, dwa startery LaTeX i 262-stronicowy podręcznik dla biblatexa porady dotyczące tych stron. Próżno.
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
EDIT po UWAGI
cały plik PDF ma to:
Referencje Oto jedna cytacja [?] I tutaj jest druga [?]. Teraz czy pełne referencje pokazują poniżej?
co się dzieje, jeśli wykomentuj/delete linia '\ usepackage [backend = bibtex] {biblatex}' ...? –
@BenBolker: skomentowanie tej linii powoduje powstanie pliku PDF - postęp! - ale cytaty są puste [?] i nie ma pełnych referencji. PS Dziękuję za zmiany. Nie zdawałem sobie sprawy, że mogę sformatować bibtex i dziennik przeglądania. – lawyeR
używanie 'setwd()' wewnątrz twojego pliku Rnw jest również prawdopodobnie złym pomysłem. Co się stanie, jeśli usuniesz kawałek "bibbackground"? –