在我的 .tex 上添加“references.bib”会产生错误:命令 \bibhang 已定义。删除它,文件就能完美编译!

在我的 .tex 上添加“references.bib”会产生错误:命令 \bibhang 已定义。删除它,文件就能完美编译!

这是我第一次尝试制作类似文章的文档。

以下是我所遵循的格式和示例文本效果非常好!!

但是,参考书目的添加方式并不是我喜欢的方式;我以前是这样添加参考书目的;

@ARTICLE{2016MNRAS.457.1722R,
  author = {{Rieder}, M. and {Teyssier}, R.},
  title = "{A small-scale dynamo in feedback-dominated galaxies as the origin of cosmic magnetic fields - I. The kinematic phase}",
  journal = {\mnras},
  archivePrefix = "arXiv",
  eprint = {1506.00849},
  keywords = {MHD, turbulence, methods: numerical, galaxies: magnetic fields},
  year = 2016,
  month = apr,
  volume = 457,
  pages = {1722-1738},
  doi = {10.1093/mnras/stv2985},
  adsurl = {http://adsabs.harvard.edu/abs/2016MNRAS.457.1722R},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

为了跟进这一点,我转到我的“论文”文本并复制了其中的内容;

\usepackage[style=authoryear,sorting=none]{biblatex}
\addbibresource{references.bib}

在 .tex 文件的末尾:

\printbibliography

当然,我将 references.bib 复制到了我的文件夹中。

这两个导致以下错误:

! LaTeX Error: Command \bibhang already defined.
               Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help. ...                                                  
l.462 \newlength{\bibhang}

我尝试关注其他一些类似的问题,但找不到任何类似的命令;

\PassOptionsToPackage{square,numbers}{natbib}
\RequirePackage{natbib}

我的任何文件上。

编辑:这是我的代码的一部分:

\documentclass{aa}  
\usepackage{graphicx}
\usepackage{txfonts}
\usepackage[style=authoryear,sorting=none]{biblatex}
\addbibresource{references.bib}
\begin{document}
\printbibliography
\end{document}

答案1

如果您要向期刊提交文章,他们可能不会接受biblatex,但如果您只想使用biblatex而不aa.cls提交给期刊,那么您可以使用bibyear不加载的选项加载该类natbib。(我不知道这可能会产生什么其他副作用,但您可能可以解决它们。)

梅威瑟:

\documentclass[bibyear]{aa}
\usepackage{txfonts}
\usepackage[style=authoryear,sorting=none]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{2016MNRAS.457.1722R,
  author = {Rieder, M. and Teyssier, R.},
  title = {A small-scale dynamo in feedback-dominated galaxies as the origin of cosmic magnetic fields - I. The kinematic phase},
  journal = {\mnras},
  archivePrefix = {arXiv},
  eprint = {1506.00849},
  keywords = {MHD, turbulence, methods: numerical, galaxies: magnetic fields},
  year = {2016},
  month = {4},
  volume = {457},
  pages = {1722-1738},
  doi = {10.1093/mnras/stv2985},
  adsurl = {http://adsabs.harvard.edu/abs/2016MNRAS.457.1722R},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Filler text \autocite[1722]{2016MNRAS.457.1722R}.
\printbibliography
\end{document}

在此处输入图片描述

相关内容