我对 LaTeX 还很陌生,所以对它了解甚少,请记住这一点。所以我刚刚写了一份文档,并使用以下方法做了参考书目。
\begin{thebibliography}{}
\bibitem{label}
\end{thebibliography}
然而,有人告诉我我需要使用哈佛风格的参考文献,随后建议我使用 bib 文件。所以我用我的参考书目信息创建了一个 bib 文件。然而,我似乎根本无法让它工作,我尝试了各种资源,但都无济于事。
如何使用 LaTeX 中的 bib 文件来制作我的参考书目(哈佛风格)?
当我实现bib文件时当前输出。
Process started: bibtex.exe "Project"
This is BibTeX, Version 0.99d (TeX Live 2019/W32TeX)
The top-level auxiliary file: Project.aux
I found no \citation commands---while reading file Project.aux
I found no \bibdata command---while reading file Project.aux
I found no \bibstyle command---while reading file Project.aux
(There were 3 error messages)
Process exited with error(s)
Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "Project".tex
Process exited normally
这是我的 bib 文件中的一个例子:
@book{codebreakers3,
author = {Kahn,D.},
title = {The Codebreakers: the story of secret writing },
year = {1996},
publisher = {Scribner},
isbn = {0684831309},
page ={235},
}
@book{Cryptonetwork,
title={Cryptography and Network Security: Principles and Practice, Global Edition},
author={Stallings, W.},
isbn={9781292158587},
year={2016},
pages = {314,451},
publisher={Pearson Education},
}
@article{diffie,
author = { W. Diffie. and M. Hellman.},
title = {New directions in cryptography},
journaltitle = {IEEE Transactions on Information Theory},
year = {1976},
volume = {22},
issue = {6},
month = {November},
pages = {644-654},
publisher = {IEEE Press Piscataway, NJ, USA },
issn = {0018-9448},
}
答案1
根据您编写 LaTeX 文档的方式,正确使用 bib 文件可能会或多或少复杂,因为您需要在编译过程中使用 bibtex 或 biber。
MWE 可能如下所示:
例子.bib
@book{example,
author = {Example Author},
title = {Example Book},
year = {2018}
}
example.tex (要编译biber
)
\documentclass{article}
\usepackage[style=authoryear-comp]{biblatex}
\addbibresource{example.bib}
\begin{document}
Here is some text with a reference. \parencite[Pages 1-4]{example}
\printbibliography
\end{document}
example.tex (要编译bibtex
)
\documentclass{article}
\usepackage{natbib}
\setcitestyle{authoryear,open={(},close={)}}
\begin{document}
Here is some text with a reference.
\cite{example} or \citep{example}
\bibliographystyle{abbrvnat}
\bibliography{example}
\end{document}
您可能想与您的资料来源/教授核实他期望的哈佛风格。虽然总体思路可能很清晰,但可能会有一些意外情况,例如要求您的参考书目采用严格的格式。