\documentclass[preprint,12pt,authoryear]{elsarticle}
\usepackage{amssymb}
\usepackage{lineno}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{natbib}
\bibliographystyle{elsarticle-harv}
\begin{document}
\begin{frontmatter}
\title{Wave Forces}
\end{frontmatter}
%% main text
\linenumbers
\section{Introduction}
\label{}
With tremendous population \cite{kee1997flexible}
\bibliography{bibby}
\end{document}
bibby.bib
包含
@article{kee1997flexible,
title={Flexible membrane wave barrier. {II}:~{Floating}\slash
submerged buoy-membrane system},
author={Kee, S. T. and Kim, M. H.},
journal={Journal of Waterway, Port, Coastal, and Ocean Engineering},
volume={123},
number={2},
pages={82--90},
year={1997},
publisher={American Society of Civil Engineers}
}
显示的错误是
Process started: bibtex.exe "texstudio_hN6136"
This is BibTeX, Version 0.99d (MiKTeX 2.9.6350 64-bit)
The top-level auxiliary file: texstudio_hN6136.aux
The style file: elsarticle-harv.bst
I couldn't open database file bibby.bib
---line 4 of file texstudio_hN6136.aux
: \bibdata{bibby
: }
I'm skipping whatever remains of this command
I found no database files---while reading file texstudio_hN6136.aux
Warning--I didn't find a database entry for "kee1997flexible"
(There were 2 error messages)
Process exited with error(s)
Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "texstudio_hN6136".tex
Process exited normally
有人可以帮助我哪里犯了错误吗?对于任何关于正确插入参考书目的帮助,我都非常感谢。
答案1
如果.tex
在 texstudio 中创建了一个新的无标题文件,并且用户在编译之前没有保存它,texstudio 将自动将其保存在一个临时位置,并使用一个神秘的名称,例如texstudio_hN6136
日志文件中显示的名称。
由于您的.bib
文件不存在于此临时位置,因此将出现问题中显示的错误。
解决方案:.tex
编译之前将文件保存在您选择的位置并以您选择的名称命名。