使用 Chapterbib 消除了 achemso 包的选项

使用 Chapterbib 消除了 achemso 包的选项

我正在尝试使用 achemso 包来格式化我的参考书目,同时使用 chapterbib 为每个章节创建单独的参考书目。我按如下方式加载这两个包

\usepackage[sectionbib]{chapterbib} \usepackage[articletitle=true,etalmode=truncate,maxauthors=5,biblabel=fullstop,doi=true]{achemso}

我对每个章节都使用了 include

\include{Chapters/Chapter1}

我在每一章中都使用以下方法列出参考书目:

\bibliographystyle{achemso}

\bibliography{All_References}

其中 All-References 包含 bibtex 参考书目条目。当我执行此操作时,文档编译并看起来不错,但是加载 achemso 包时包含的选项被忽略。但是,如果我注释掉 chapterbib 命令,则会遵循选项,但我不会获得每个章节的参考书目。

梅威瑟:

主文本:

\usepackage[utf8]{inputenc}
%\usepackage[sectionbib]{chapterbib}
\usepackage[articletitle=true,etalmode=truncate,maxauthors=5,biblabel=fullstop,doi=true]{achemso} 
\begin{document}
\include{Section}
\end{document}

章节.tex:

Something\cite{VanOrden2015}

\section{References}
\bibliographystyle{achemso}
\bibliography{References}

参考文献.bib:

@article{VanOrden2015,
author = {Melnykov, Artem V. and Nayak, Rajesh K. and Hall, Kathleen B. and Van Orden, Alan},
title = {Effect of Loop Composition on the Stability and Folding Kinetics of RNA Hairpins with Large Loops},
journal = {Biochemistry},
volume = {54},
number = {10},
pages = {1886-1896},
year = {2015},
doi = {10.1021/bi5014276},
PMID= {25697574},
URL = { 
        https://doi.org/10.1021/bi5014276
},
eprint = { 
        https://doi.org/10.1021/bi5014276
}
}

请注意,注释掉并取消注释 main.tex 文件中的第二行会改变参考书目的显示方式(当第二行出现时,DOI 会消失)

答案1

achemso使用一种非常巧妙的方式将选项传递给参考书目样式:它将所有选项放入一个.bib名为的内部条目中achemso-control,该条目由包自动引用achemso。这允许您通过文件中的包选项控制参考书目样式的行为.tex

如果您使用,chapterbib则必须手动引用此条目。最简单的方法是将 放在\nocite{achemso-control}每个 的开头\chapter

但为了避免虚假警告,我们需要一种稍微复杂一点的方法。定义

\makeatletter
\newcommand*{\achemsocontrolbib}{%
  \immediate\write\@auxout{%
    \string\citation\string{achemso-control\string}%
  }}
\makeatother

并在每章开头调用它。

这是一个独立的示例文件,其中包括两个章节和一个.bib示例的文件。

\documentclass{report}
\usepackage[sectionbib]{chapterbib}
\usepackage[biblabel=fullstop,
            etalmode=truncate,maxauthors=5,
            articletitle=true,doi=true]{achemso}

\makeatletter
\newcommand*{\achemsocontrolbib}{%
  \immediate\write\@auxout{%
    \string\citation\string{achemso-control\string}%
  }}
\makeatother

% chapter 1
\begin{filecontents}{\jobname-1.tex}
\achemsocontrolbib
\chapter{One}
Something\cite{VanOrden2015}

\bibliographystyle{achemso}
\bibliography{\jobname}
\end{filecontents}

% chapter 2
\begin{filecontents}{\jobname-2.tex}
\achemsocontrolbib
\chapter{Two}
Something else\cite{VanOrden2015,sigfridsson}

\bibliographystyle{achemso}
\bibliography{\jobname}
\end{filecontents}

% bib file
\begin{filecontents}{\jobname.bib}
@article{VanOrden2015,
  author  = {Melnykov, Artem V. and Nayak, Rajesh K.
             and Hall, Kathleen B. and Van Orden, Alan},
  title   = {Effect of Loop Composition on the Stability
             and Folding Kinetics of {RNA} Hairpins with Large Loops},
  journal = {Biochemistry},
  volume  = {54},
  number  = {10},
  pages   = {1886-1896},
  year    = {2015},
  doi     = {10.1021/bi5014276},
  PMID    = {25697574},
}
@article{sigfridsson,
  author       = {Sigfridsson, Emma and Ryde, Ulf},
  title        = {Comparison of Methods for Deriving Atomic Charges from the
                  Electrostatic Potential and Moments},
  journal      = {Journal of Computational Chemistry},
  year         = 1998,
  volume       = 19,
  number       = 4,
  pages        = {377-395},
  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
}
\end{filecontents}

\begin{document}
\include{\jobname-1}
\include{\jobname-2}
\end{document}

第 2 章参考书目

相关内容