2015-10-25 10 views
6

मैं सभी संभावनाओं के माध्यम से अपना रास्ता हैक नहीं कर सकता और RStudio, knitr, एक आरएनडब्ल्यू स्क्रिप्ट, और "संकलित पीडीएफ" बटन के पीडीएफ आउटपुट में एक पूर्ण ग्रंथसूची डाली गई है। पीडीएफ में वांछित पाठ उद्धृत कार्यों का विवरण होगा।लाइटिक्स के लिए बुनाई और आरएनडब्ल्यू के साथ, आप पीडीएफ आउटपुट में पूर्ण ग्रंथसूची कैसे प्रिंट करते हैं?

यहां एक लिलीपुटियन बिबटेक्स फ़ाइल है, जिसे 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] 
लेटेक्स साथी, आर के साथ गतिशील दस्तावेज़ और knitr, द्वारा के साथ साथ

Yihui Xie, दो LaTeX प्राइमर्स और बाइबिलटेक्स के लिए 262 पेज मैनुअल मैंने कॉम के माध्यम से संघर्ष किया है इन साइटों की जटिल सलाह। बेकारी से।

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

टिप्पणियाँ

सभी पीडीएफ फाइल है के बाद संपादित यह है:

+०१२३५१६४१०६१

संदर्भ यहां एक उद्धरण है [?] और यहां एक दूसरा [?] है। अब पूर्ण संदर्भ नीचे दिखाएं?

+0

क्या होता है से पहले अगर आप टिप्पणी बाहर/हटाने अपनी पुस्तक सूची में अपने .bib फ़ाइल से सभी संदर्भों को, यानी यहां तक ​​कि लोगों को कि आप का हवाला देते हुए खत्म नहीं हुई शामिल करने के लिए लाइन में शामिल '\ usepackage [backend = bibtex] {biblatex}' line ...? –

+0

@ बेनबॉल्कर: उस लाइन को पीडीएफ में उत्पन्न होने के परिणामस्वरूप टिप्पणी - प्रगति! - लेकिन उद्धरण खाली हैं [?] और कोई पूर्ण संदर्भ नहीं हैं। पीएस संपादन के लिए धन्यवाद। मुझे एहसास नहीं हुआ कि मैं बिबटेक्स और व्यू लॉग को प्रारूपित कर सकता हूं। – lawyeR

+0

आपकी आरएनडब्ल्यू फाइल के अंदर 'setwd() 'का उपयोग करके शायद एक बुरा विचार भी है। यदि आप 'बिबबैकग्राउंड' खंड निकालते हैं तो क्या होता है? –

उत्तर

2

त्रुटि संदेश के रूप में आप से कहा:

  1. \bibliographystyle{plain} का प्रयोग न करें (इस biblatex के लिए काम नहीं करता है); \usepackage[]{biblatex} में style विकल्प का उपयोग करें;
  2. \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} 

Btw, RStudio शायद biblatex की biber डिफ़ॉल्ट बैकएंड का समर्थन नहीं करता है, तो backend=bibtex विकल्प इस्तेमाल किया गया था।

+0

शूट आपको याद किया उत्तर दिया @Yihui मैं अपनी प्रतिक्रिया छोड़ रहा हूँ, हालांकि यह भी जानकारीपूर्ण है अगर यह भी जानकारीपूर्ण है। –

+0

धन्यवाद, Yihui। मैं तुम भाग गया यू कोड, इसने उद्धरणों का निर्माण किया लेकिन पूर्ण ग्रंथसूची नहीं, मैं अंत में प्रयास करने की कोशिश कर रहा हूं। यह पीडीएफ से है, यहां एक उद्धरण है GreentargetEngagement2012 और यहां एक सेक - ऑनड सिटीप्राइवेट बैंक अब पूर्ण संदर्भ नीचे दिखाए गए हैं? – lawyeR

1

मैं बिल्कुल इस नीचे सेटअप का उपयोग पाने के लिए (ध्यान दें मैं knitr/rmarkdown में wd बदलते के एक प्रशंसक और इस हटाया नहीं कर रहा हूँ, यह भी RNW में अपनी चाबी मेगावाट में महत्वपूर्ण से मेल नहीं खाती):

enter image description here

\documentclass[11pt]{article} 

\usepackage[american]{babel} 
\usepackage[style=apa,backend=biber,bibencoding=latin1]{biblatex} 
\DeclareLanguageMapping{american}{american-apa} 

\addbibresource{jabrefbibtest.bib} 


\begin{document} 

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

%\bibliographystyle{plain} 

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

Now do full References show below? 

\printbibliography 
\end{document} 

इसके अलावा RNW निट के बाद मैं संदर्भ पहली बार प्रस्तुत करना tex फ़ाइल हालांकि एक LaTeX संकलक चलाने के लिए है।

+0

मुझे धीमा होने के लिए खेद है, लेकिन आपके उत्तर की आखिरी वाक्य का क्या मतलब है, और कैसे एक "लाटेक्स कंपाइलर के बावजूद टेक्सास फ़ाइल चलाता है"? – lawyeR

+0

मैं miktex खोलता हूं और .tex फ़ाइल चलाता हूं (RStudio/knitr ten फ़ाइल से tex बनाता है) इसके माध्यम से। यह संदर्भ जोड़ता है (इससे पहले कोई संदर्भ खंड नहीं है और उद्धरण बोल्ड सामना करने वाली बिब्की के रूप में दिखाई देते हैं)। एक बार जब आप tex फ़ाइल को एक बार चलाते हैं, तब तक जब तक आप उद्धरणों को परिवर्तित नहीं करते हैं, तब तक आप RStw फ़ाइल में RNW फ़ाइल चला सकते हैं। यदि आप उद्धरण बदलते हैं तो आपको उद्धरणों को फिर से काम करने के लिए फिर से टेक्स्ट फ़ाइल को फिर से चालू करने की आवश्यकता होती है। यह संभावना है कि यहुई बाईबर और आरस्टूडियो के बारे में क्या संदर्भ दे रहा है। –

0

मैं हमेशा स्क्रिप्ट के अंत में \bibliography{jabrefbibtest} डालता हूं जहां मैं संदर्भ होना चाहता हूं।

0

, \nocite{*} सही लाइन \printbibliography

संबंधित मुद्दे

 संबंधित मुद्दे