无法编译 achemso 样式文档

无法编译 achemso 样式文档

我正在尝试编译我的 tex 文档以适应 achemso 样式。我已阅读了 achemso 手册,我认为我做对了。我正在使用 texstudio,以下是我编译文档的方式:

默认编译器:txs:///pdflatex | txs:///bibtex | txs:///pdflatex | txs:///pdflatex

以下是我的代码的 MWE(我认为):

\documentclass[journal = jprobs, manuscript = article, layout = twocolumn]{achemso}
%Math and font
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}

%Dependecies of achemso
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{array}
\usepackage{booktabs}
\usepackage{hypdoc}
\usepackage{listings}
\usepackage{lmodern}
\usepackage{mathpazo}
\usepackage{microtype}
%Requeirments
\usepackage{caption}
\usepackage{float}
\usepackage{geometry}
\usepackage{natbib}
\usepackage{setspace}
\usepackage{xkeyval}

%Achemos package
\usepackage{achemso}

%Meta data
%First author
\author{a1}
\affiliation[af1]{af1}
\alsoaffiliation[af2]{af2}
\email{e1}
%Last author
\author{a2}
\affiliation[af1]{af1}
\alsoaffiliation[af2]{af2}
\email{e2}

\title[Shorter title here]{Overly pompous title here}


\begin{document}
    \begin{abstract}
        A short description of the paper
    \end{abstract}
    Hello world!\cite{einstein}
    \begin{acknowledgement}
        People who helped us gets credits here
    \end{acknowledgement}
    \bibliographystyle{achemso}
    \bibliography{Cite}
    \begin{suppinfo}
        Supplemental information is put here
    \end{suppinfo}
\end{document}

我的 Cite.bib 如下所示:

@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

在此代码上仅运行 Bibtex 会产生此错误:

Process started: bibtex.exe "MWE"

This is BibTeX, Version 0.99d (MiKTeX 21.3)
The top-level auxiliary file: MWE.aux
The style file: achemso.bst
Illegal, another \bibstyle command---line 25 of file MWE.aux
 : \bibstyle
 :          {achemso}
I'm skipping whatever remains of this command
Database file #1: acs-MWE.bib
Database file #2: Cite.bib
achemso 2021-01-20 v3.13c
(There was 1 error message)

Process exited with error(s)

如果我删除,\bibliographystyle{achemso}此错误就会消失,但我仍然收到以下错误(带或不带\bibliographystyle{achemso}):

Runaway argument?
! Paragraph ended before \@BOOKMARK was complete.
<to be read again> 
                   \par 
l.1 \BOOKMARK [\par
                    ][\tex_par:D <0 ]{bib1.\par }\sloppy  \clubpenalty 4000\...
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

此错误之后是一连串错误。如果我删除\cite{einstein}bibliographystyle{achemso}和,则不会出现错误\bibliography{Cite}。所以我怀疑这与编制参考书目有关。任何帮助都将不胜感激!

答案1

achemso自动将书目样式设置为适合您的类设置的样式,因此在使用类的文档中您不需要\bibliographystyle{achemso}并且实际上不应该有任何样式。这解释了第一个错误。\bibliographystyleachemso

第二个错误具体似乎是由引起的\usepackage{hypdoc}

  • 您无需明确加载序言中列出的必需包。这些包将由类自动加载。
  • 您不应该加载列为依赖项的软件包achemso 文档不加区分地使用,除非你明确需要其中之一。

将这些更改应用到您的文档后,它看起来可能像这样

\documentclass[journal = jprobs, manuscript = article, layout = twocolumn]{achemso}
%Math and font
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}

%Meta data
%First author
\author{a1}
\affiliation[af1]{af1}
\alsoaffiliation[af2]{af2}
\email{e1}
%Last author
\author{a2}
\affiliation[af1]{af1}
\alsoaffiliation[af2]{af2}
\email{e2}

\title[Shorter title here]{Overly pompous title here}

\begin{filecontents}{\jobname.bib}
@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "10.1002/andp.19053221004"
}
\end{filecontents}

\begin{document}
    \begin{abstract}
        A short description of the paper
    \end{abstract}
    Hello world!\cite{einstein}
    \begin{acknowledgement}
        People who helped us gets credits here
    \end{acknowledgement}
    \bibliography{\jobname}
    \begin{suppinfo}
        Supplemental information is put here
    \end{suppinfo}
\end{document}

编译时没有错误。

相关内容