如何在报告中包含 \nocite{*}

如何在报告中包含 \nocite{*}

我已经添加了我感兴趣的代码的链接,请访问, 如何在表格、目录等列表的第一页中添加页眉 1)在此代码中如何合并 \nocite{*},因为当我包含它时会显示各种错误......

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\pagestyle{fancy}
\makeatletter
\let\ps@plain\ps@fancy
\makeatother
\begin{document}
\nocite{*}
\pagenumbering{roman}
\fancyhead[L]{\contentsname}
\fancyhead[R]{}
\tableofcontents
\clearpage
\addcontentsline{toc}{section}{\textbf{\listfigurename}}
\fancyhead[L]{\listfigurename}
\fancyhead[R]{}
\listoffigures
\clearpage 
\addcontentsline{toc}{section}{\textbf{\listtablename}}
\fancyhead[L]{\listtablename}
\fancyhead[R]{}
\listoftables
\clearpage
\chapter{INTRODUCTION}
\fancyhead[R]{Chapter 1}
\fancyhead[L]{Introduction}
\pagenumbering{arabic}
\chapter{Particle Swarm Optimization}
\fancyhead[R]{Chapter 2}  
\fancyhead[L]{Particle Swarm Optimization}
\newpage
\addcontentsline{toc}{section}{\textbf{Bibliography}}
\bibliographystyle{plain}
\bibliography{science,s}
\fancyhead[R]{}
\fancyhead[L]{Bibliography}
\end{document}

例如显示错误:

Missing \endcsname inserted ...acefactor \accent@spacefactor n2013397}{1}
Missing \begin{document}. ...acefactor \accent@spacefactor n2013397}{1}
Missing number, treated as zero ...acefactor \accent@spacefactor n2013397}{1}
Extra }, or forgotten \endgroup ...acefactor \accent@spacefactor n2013397}{1} 
Undefined control sequence \bibcite{Ayd\OT1\i n20132456}{45}

我唯一能用的代码是,

\documentstyle{report}
\begin{document}
\nocite{*}
\bibliographystyle{plain}
\bibliography{science,s}
\end{document}

答案1

1) 有一件非常重要的事情你应该注意:\documentstyle 已经过时了二十多年。使用它会使 LaTeX 以向后兼容模式运行。你应该会收到巨大的警告。

2)尝试删除 .bbl 和 .aux 文件

非常感谢你们................. karlkoeller & johannes B

答案2

该命令\nocite{*}限制范围整个 .bib 文件

使用\nocite{<Keys>}来限制范围具体参考您想要包含在文档中的内容。

\nocite将命令放在前面\printbibliography

相关内容