从网站获取了 .bbl 文件并需要生成 pdf

从网站获取了 .bbl 文件并需要生成 pdf

正如标题所述,我从一个网站上以文件形式获得了一个参考列表.bbl,我想从中生成一个 pdf。我已经在谷歌上搜索了一个小时,但也许我错过了什么。据我所知,您可以创建一个.tex文件,然后使用,\bibliography{*name_of_file*}但这是行不通的。我也尝试过将文件的内容粘贴.bbl到参考书目中,但同样行不通。

有人可以给我一步一步指导如何做到这一点吗?

答案1

您没有给我们您的*.bbl文件,也没有说出您获得文件的网站,所以我只能猜测。请在下一个问题中添加所有相关信息,以便我们更轻松地帮助您!

假设*.bbl您得到的是:

\providecommand{\latin}[1]{#1}
\makeatletter
\providecommand{\doi}
  {\begingroup\let\do\@makeother\dospecials
  \catcode`\{=1 \catcode`\}=2 \doi@aux}
\providecommand{\doi@aux}[1]{\endgroup\texttt{#1}}
\makeatother
\providecommand*\mcitethebibliography{\thebibliography}
\csname @ifundefined\endcsname{endmcitethebibliography}
  {\let\endmcitethebibliography\endthebibliography}{}
\begin{mcitethebibliography}{4}
\providecommand*\natexlab[1]{#1}
\providecommand*\mciteSetBstSublistMode[1]{}
\providecommand*\mciteSetBstMaxWidthForm[2]{}
\providecommand*\mciteBstWouldAddEndPuncttrue
  {\def\EndOfBibitem{\unskip.}}
\providecommand*\mciteBstWouldAddEndPunctfalse
  {\let\EndOfBibitem\relax}
\providecommand*\mciteSetBstMidEndSepPunct[3]{}
\providecommand*\mciteSetBstSublistLabelBeginEnd[3]{}
\providecommand*\EndOfBibitem{}
\mciteSetBstSublistMode{f}
\mciteSetBstMaxWidthForm{subitem}{(\alph{mcitesubitemcount})}
\mciteSetBstSublistLabelBeginEnd
  {\mcitemaxwidthsubitemform\space}
  {\relax}
  {\relax}

\bibitem[Goossens \latin{et~al.}(1994)Goossens, Mittelbach, and
  Samarin]{Goossens}
Goossens,~M.; Mittelbach,~F.; Samarin,~A. \emph{The LaTeX Companion}, 1st ed.;
  Addison-Wesley, 1994\relax
\mciteBstWouldAddEndPuncttrue
\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}
{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax
\EndOfBibitem
\bibitem[Adams(1980)]{adams}
Adams,~D. \emph{The Restaurant at the End of the Universe}; The Hitchhiker's
  Guide to the Galaxy; Pan Macmillan, 1980\relax
\mciteBstWouldAddEndPuncttrue
\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}
{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax
\EndOfBibitem
\bibitem[Editor \latin{et~al.}(2015)Editor, Editor2, and Editor3]{test}
Editor,~F., Editor2,~S., Editor3,~T., Eds. \emph{Test to show the effect};
  Publisher, 2015\relax
\mciteBstWouldAddEndPuncttrue
\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}
{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax
\EndOfBibitem
\bibitem[Feynman(1969)]{feynman}
Feynman,~R.~P. Very High-Energy Collisions of Hadrons. \emph{Phys. Rev. Lett.}
  \textbf{1969}, \emph{23}, 1415--1417\relax
\mciteBstWouldAddEndPuncttrue
\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}
{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax
\EndOfBibitem
\end{mcitethebibliography}

为了能够在 tex 代码中使用它,您需要知道它是如何生成的。因此,让我们看看以下 MWE(使用 bib 文件和生成参考书目的命令完成,结果如上所示*.bbl):

\begin{filecontents*}{testbib.bib}
@Book{Goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) 
             [{On} the electrodynamics of moving bodies]},
  journal = {Annalen der Physik},
  volume  = {322},
  number  = {10},
  pages   = {891--921},
  year    = {1905},
  DOI     = {http://dx.doi.org/10.1002/andp.19053221004},
}
@article{Ross2006,
  title     = {Treating the right patient at the right time: 
               access to heart failure care},
  author    = {Ross, H and Howlett, J and Arnold, J Malcolm O and 
               Liu, P and O’Neill, BJ and Brophy, JM and Simpson, CS and 
               Sholdice, MM and Knudtson, M and Ross, DB and others},
  journal   = {Canadian journal of Cardiology},
  volume    = {22},
  number    = {9},
  pages     = {749--754},
  year      = {2006},
  publisher = {Elsevier},
}
@article{Heidenreich2013,
  title     = {Forecasting the impact of heart failure in the 
               United States a policy statement from the American Heart Association},
  author    = {Heidenreich, Paul A and Albert, Nancy M and 
               Allen, Larry A and Bluemke, David A and Butler, Javed and 
               Fonarow, Gregg C and Ikonomidis, John S and Khavjou, Olga 
               and Konstam, Marvin A and Maddox, Thomas M and others},
  journal   = {Circulation: Heart Failure},
  volume    = {6},
  number    = {3},
  pages     = {606--619},
  year      = {2013},
  publisher = {Am Heart Assoc},
}
@book{mschinLearning,
author    = {Tom M. Mitchell}, 
title     = {Machine learning},
publisher = {Mac Gew Hill},
year      = 1997,
volume    = 4,
series    = 10,
address   = {The address},
edition   = 3,
month     = 7,
note      = {An optional note},
isbn      = {0071154671},
}
@misc{mozart:KV183,
  author  = {Mozart, Wolfgang Amadeus},
  title   = {Sinfonie g-Moll},
  year    = {1773},
  address = {Salzburg},
  note    = {New K{\"o}chelverzeichnis Nr. 183, old version Nr. 25; 
             Erster Satz: Allegro con brio, Zweiter Satz: Andante, 
             Dritter Satz: Menuetto, Vierter Satz: Allegro},
}
\end{filecontents*}


\documentclass[10pt,a4paper]{article}

\usepackage{showframe}  % to visualise the typing area and margins
\usepackage{hyperref}   % better urls


\begin{document}

This is text with \cite{Goossens} and \cite{adams}.

\nocite{*} % to test all bib entrys
\bibliographystyle{unsrt} % <===========================================
\bibliography{testbib}

\end{document}

此处的包filecontents仅用于将 tex 代码和 bib 文件一起放入可编译的 MWE 中,您无需使用filecontents

为了能够testbib.bbl立即使用该文件,您需要以下 tex 代码(请参阅\cite所需的命令和用于创建该文件的 bibliographystyle *.bbl):

\documentclass[10pt,a4paper]{article}

\usepackage{showframe}  % to visualise the typing area and margins
\usepackage{hyperref}   % better urls


\begin{document}

This is text with \cite{Goossens} and \cite{adams}.

\nocite{*} % to test all bib entrys
\bibliographystyle{unsrt} % <===========================================
\input{testbib.bbl} % <=================================================

\end{document}

参考书目\input{testbib.bbl}包含在该处的文档中,您可以\input{testbib.bbl}

由此产生的书目

最后请将上面的结果与文件代码的结果进行比较*.bib

带有 bib 文件的参考书目

答案2

欢迎来到 TeX.SX!

我们将您的文件命名为“references.bib”。

创建一个文档并将其命名为“main.tex”,其内容如下:

\documentclass{article}
\usepackage{natbib}

\begin{document}
\nocite{*}
\bibliographystyle{apalike}
%unsrt: Style with unsorted citations [1] [2]
%plain: [1] [2] etc but shorted 
%apalike: Author year style
%agsm: Harvard style
\bibliography{references}
\end{document}

然后运行:

pdflatex main
bibtex main
pdflatex main

和 pdflatex 主要

这将生成一份以您选择的样式打印参考书目的文档。

请随意使用,geometry例如:

\usepackege[top=1in,bottom=1.2in,left=1in,right=1.5in]{geometry}

(将此命令与您想要在序言中拥有的边距一起添加 - 例如,就在\documentclass命令下方 -)

或者使用以下方式删除页码:

 \pagestyle{empty}

命令之后的某处\documentclass

编辑:

抱歉...只显示您有一个bbl文件而不是bib...删除我的答案但保留几分钟以便查看它并决定是否要使用您的 bib(如果有)文件并随时访问样式.... bib 文件可以提供几种参考样式... 只是一个文件bbl的特定输出bib,因此不太可用......所以,如果你有(或可以得到)一个bib,请尝试这种方法。

相关内容