当我编译/排版 test.bib 文件时,出现以下情况:
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9)
**entering extended mode**
然后程序就挂了。该怎么办?提前谢谢
编辑:现在,编译后参考文献确实出现在主文档中。但是,当我在行中更改参考书目样式时\bibliographystyle{unsrtnat}
,参考文献仍然以与以前相同的样式显示。我尝试了 IEEEtran、plain 和 unsrtnat。它们不应该在文档中提供不同的样式吗?主要是,我不希望 url 出现在主文档中。
主要文档 Latex 代码:
\documentclass[11pt]{article}
\begin{document}
\section{A}
Yesyesyes \cite{muiva}
\bibliographystyle{unsrtnat}
\bibliography{test}
\end{document}
test.bib
代码:
@article{muiva,
title = {Effect of doping concentration on the properties of aluminium doped zinc oxide thin films prepared by spray pyrolysis for transparent electrode applications},
volume = {37},
issn = {0272-8842},
url = {http://www.sciencedirect.com/science/article/pii/S0272884210003986},
doi = {10.1016/j.ceramint.2010.09.042},
pages = {555--560},
number = {2},
journaltitle = {Ceramics International},
author = {Muiva, C. M. and Sathiaraj, T. S. and Maabong, K.},
urldate = {2014-10-18},
date = {2011-03},
keywords = {A: Thin films, D: {ZnO}, Spray pyrolysis},
}
答案1
做不是在文件上运行 BibTeX .bib
。相反,假设您的主 tex 文件名为mytexfile.tex
,您应该运行以下命令序列:
pdflatex mytexfile
bibtex mytexfile
pdflatex mytexfile
pdflatex mytexfile
请注意,没有提供文件扩展名。当然,如果您使用 xelatex 或 lualatex 而不是 pdflatex,则应相应地调整上面第 1、3 和 4 行中给出的命令名称。根据您使用的前端编辑程序,可能会有一个按钮可以单击,该按钮会自动发出此命令序列。
经过一些适当的修改(例如加载包natbib
和url
,并将date
字段类型更改为year
),如果运行 latex、bibtex、latex 和 latex,您的 MWE 会产生以下输出:
\documentclass[11pt]{article}
\usepackage{filecontents}
\begin{filecontents*}{test.bib}
@article{muiva,
title = {Effect of doping concentration on the properties of aluminium doped zinc oxide thin films prepared by spray pyrolysis for transparent electrode applications},
volume = {37},
issn = {0272-8842},
url = {http://www.sciencedirect.com/science/article/pii/S0272884210003986},
doi = {10.1016/j.ceramint.2010.09.042},
pages = {555--560},
number = {2},
journaltitle = {Ceramics International},
author = {Muiva, C. M. and Sathiaraj, T. S. and Maabong, K.},
urldate = {2014-10-18},
year = 2011,
keywords = {A: Thin films, D: {ZnO}, Spray pyrolysis},
}
\end{filecontents*}
\usepackage[round]{natbib}
\bibliographystyle{unsrtnat}
\usepackage[obeyspaces,hyphens]{url}
\begin{document}
\section{A}
Yesyesyes \cite{muiva}
\bibliography{test}
\end{document}