BibTeX 的错误消息:“非法,另一个 \bibstyle 命令”

BibTeX 的错误消息:“非法,另一个 \bibstyle 命令”

BibTeX(而非 BibLaTeX)与以下产品兼容:achemso包。当我运行下面的 MWE 时(首先运行 pdfLaTeX,然后运行 ​​BibTeX),BibTeX 给出了以下错误消息:

Running `BibTeX' on `test2' with ``bibtex "test2"''
This is BibTeX, Version 0.99d (TeX Live 2020/W32TeX)
The top-level auxiliary file: test2.aux
The style file: achemso.bst
Illegal, another \bibstyle command---line 8 of file test2.aux
 : \bibstyle
 :          {achemso}
I'm skipping whatever remains of this command
Database file #1: acs-test2.bib
Database file #2: test2.bib
achemso 2020-05-27 v3.13a
(There was 1 error message)

TeX Output exited abnormally with code 2 at Mon Jan 24 15:19:42

错误消息是什么意思?为什么说我有多个\bibstyle命令?我该如何纠正这个问题?

这是我的 MWE:

\documentclass[journal=jacsat,manuscript=article]{achemso}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
  @ARTICLE{Hirao2022,
    author = {Hirao, Yasukazu and Ihara, Keiji and Ishibashi, Yukihide and Tiu, Elisha Gabrielle and Asahi, Tsuyoshi and Kubo, Takashi},
    title = {Mechanism and Kinetics of Fluorescence Quenching of Fluorene-Endcapped Butatriene: A Microspectroscopic Study of the Discrete State Constructed in Microcrystals},
    journal = {J. Phys. Chem. C},
    year = {2022},
    volume = {126},
    pages = {1196--1203}
  }
\end{filecontents*}

\author{First A. Author}
\affiliation[University A]{Department, University A, Address A}
\author{Second B. Author}
\affiliation[University B]{Department, University B, Address B}
\author{Third C. Author}\email{[email protected]}
\affiliation[University C]{Department, University C, Address C}

\title{Article Title}

\SectionNumbersOn

\begin{document}

\begin{abstract}
Abstract goes here.
\end{abstract}

\section{Introduction}

\section{Methods}

\section{Results and Discussion}

Reference a paper.\cite{Hirao2022}

\section{Conclusion}

\begin{suppinfo}
  Advertisement for, and description of, Supporting Information goes here.
\end{suppinfo}

\begin{acknowledgement}
  The authors thank funding sources.
\end{acknowledgement}

\begin{tocentry}
  Graphical TOC goes here.
\end{tocentry}

% References
\bibliographystyle{achemso}
\bibliography{test2}

\end{document}

答案1

大卫卡莱尔 (David Carlisle) 在评论中指出我错误地发出了两个\bibliographystyle{achemso}命令:一个在我的文档中,一个在课堂上。

事实上,我意识到achemso-demo.tex(发布这里achemso),其中有一个关于包中参考书目的注释以及示例代码:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% The appropriate \bibliography command should be placed here.
%% Notice that the class file automatically sets \bibliographystyle
%% and also names the section correctly.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliography{achemso-demo}

因此,显然我应该使用仅有的命令\bibliography{achemso-demo}achemso-demo.bib我的 BibTeX 文件在哪里(或者test2.bib在原始问题中的 MWE 中)。当我执行该操作时,pdfLaTeX 和 BibTeX 运行时没有错误。

相关内容