如何消除极其丑陋的 AAS 引用风格?

如何消除极其丑陋的 AAS 引用风格?

我正在写一篇论文,想尝试一下 AASTeX 引用样式(https://mirror.clientvps.com/CTAN/macros/latex/contrib/aastex/aasjournal.bst)。

然而,我发现,当作者超过两位时,在年份后添加其他作者姓名的方式完全令人震惊(例如,https://www.bibtex.com/s/bibliography-style-aastex-aasjournal/)。

因此,我更希望通过强制引用在括号中的年份后结束来使其更令人愉快。例如,[Fan et al.(2020)Fan, Jiang, Tang, Jin, and Wei]应该简单地变成[Fan et al.(2020)]。但是,我不明白在哪里编辑aasjournal.bst才能实现这一点。

有人知道快速解决方法吗?

更改为 biblatex 的 authoryear-style 不是一个首选选项,因为我不想手动插入方括号,而且我喜欢 AASTeX 将名称和年份转换为单个超链接的方式。

编辑:因此有了这些 bib 条目:

@ARTICLE{Flanagan:1998,
      author = {{Flanagan}, {\'E}anna {\'E}. and {Hughes}, Scott A.},
       title = "{Measuring gravitational waves from binary black hole coalescences. I. Signal to noise for inspiral, merger, and ringdown}",
     journal = {\prd},
        year = 1998,
       month = apr,
      volume = {57},
      number = {8},
       pages = {4535-4565},
         doi = {10.1103/PhysRevD.57.4535},
archivePrefix = {arXiv},
      eprint = {gr-qc/9701039}
}

@ARTICLE{Gao:2020,
      author = {{Gao}, He and {Ai}, Shun-Ke and {Cao}, Zhou-Jian and {Zhang}, Bing and {Zhu}, Zhen-Yu and {Li}, Ang and {Zhang}, Nai-Bo and {Bauswein}, Andreas},
       title = "{Relation between gravitational mass and baryonic mass for non-rotating and rapidly rotating neutron stars}",
     journal = {Frontiers of Physics},
    keywords = {gravitational waves, Astrophysics - High Energy Astrophysical Phenomena},
        year = 2020,
       month = jan,
      volume = {15},
      number = {2},
         eid = {24603},
       pages = {24603},
         doi = {10.1007/s11467-019-0945-9},
archivePrefix = {arXiv},
      eprint = {1905.03784},
primaryClass = {astro-ph.HE}
}

和这个标题

\documentclass[12pt,a4paper, titlepage,twoside]{article}
\usepackage{aasmacros}
\usepackage{fullpage}
\usepackage{hyperref}
\usepackage{cleveref}                   %Referencing with \cref{}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{ dsfont }
\usepackage{enumitem}
%\usepackage[authoryear]{natbib}
\hypersetup{%
  colorlinks=true,
  linkcolor=blue,
  linkbordercolor={0 0 1}
}
\begin{document}
Lorem \cite{Flanagan:1998} and cite \cite{Gao:2020}
% \printbibliography
\bibliography{refs}
\bibliographystyle{aasjournal.bst}
\end{document}

我得到了 Flanagan 所需的输出,但 Gao 太丑而且太长了。当包含 时\usepackage[authoryear]{natbib},aastex 特性会丢失:我丢失了输出周围的方括号,在年份前插入了一个空格,超链接被拆分为两个超链接,分别用于名称和年份。

答案1

前面的扩展评论:你似乎认为在bibtex.com具有权威性。遗憾的是,这种信任严重放错地方。首先,bibtex.com 网站与 BibTeX 的作者没有任何关联,也未获得其授权。bibtex.com 网站版权所有者提供的建议经常存在缺陷 —— 有时甚至是完全错误的。可以肯定的是,您提供链接的页面的作者似乎完全没有意识到 bib 样式aasjournal需要使用引文管理包,例如natbib别让他们的无能欺骗了你。你已被警告。

aasjournal我声称围兜样式有什么依据需要使用引文管理包,如natbib?嗯,该文件的序言aasjournal.bst包含以下段落:

 % This is an author-year citation style bibliography. As such, it is
 % non-standard LaTeX, and requires a special package file to function properly.
 % Such a package is    natbib.sty   by Patrick W. Daly

总结一下:给自己一个大恩惠(a)学会忽视你所遇到的bibtex.com以及 (b) 加载natbib引文管理包。完成此过程后,您还会意识到aasjournalbib 样式生成的引文标注与您帖子中的断言相反,既不是“极其丑陋”,也不是“完全令人震惊”。


我猜你喜欢作者年份风格的引文标注用方括号括起来。如果是这样,请考虑使用\citep纳特比布引文管理包。

在此处输入图片描述

\documentclass[12pt,a4paper,titlepage,twoside]{article}
\begin{filecontents}[overwrite]{refs.bib}
@ARTICLE{Flanagan:1998,
      author = {Flanagan, {\'E}anna {\'E}. and Hughes, Scott A.},
       title = {Measuring gravitational waves from binary black hole 
                coalescences. {I.} {Signal} to noise for inspiral, 
                merger, and ringdown},
     journal = {Physical Review~D},
        year = 1998,
       month = apr,
      volume = {57},
      number = {8},
       pages = {4535--4565},
         doi = {10.1103/PhysRevD.57.4535},
archivePrefix= {arXiv},
      eprint = {gr-qc/9701039}
}
@ARTICLE{Gao:2020,
      author = {Gao, He and Ai, Shun-Ke and Cao, Zhou-Jian and 
                Zhang, Bing and Zhu, Zhen-Yu and Li, Ang and 
                Zhang, Nai-Bo and Bauswein, Andreas},
       title = {Relation between gravitational mass and baryonic 
                mass for non-rotating and rapidly rotating neutron 
                stars},
     journal = {Frontiers of Physics},
    keywords = {Gravitational waves, Astrophysics - High Energy Astrophysical Phenomena},
        year = 2020,
       month = jan,
      volume = {15},
      number = {2},
         eid = {24603},
       pages = {24603},
         doi = {10.1007/s11467-019-0945-9},
archivePrefix= {arXiv},
      eprint = {1905.03784},
primaryClass = {astro-ph.HE}
}
\end{filecontents}

%\usepackage{aasmacros} % I don't seem to have this package

\usepackage{fullpage}

\usepackage{xurl} % <-- new
\usepackage{hyperref}
\hypersetup{%
  colorlinks=true,
  allcolors =blue % <-- new
  %linkbordercolor={1 0 1} % irrelevant since 'colorlinks' option is set
}
\usepackage{cleveref} 
\usepackage[english]{babel}
%\usepackage[utf8]{inputenc} % That's the default nowadays.
\usepackage{dsfont}
\usepackage{enumitem}

\usepackage[authoryear,square]{natbib} % note the "square" option
\bibliographystyle{aasjournal}

\begin{document}
Lorem \citep{Flanagan:1998} and Ipsum \citep{Gao:2020}.
\bibliography{refs}
\end{document}

答案2

@Mico 对我所陷入的谬论的看法完全正确。

尽管如此,他建议的解决方案并不是我想要的,因为它仍然与其他 AAS 要求不同。我重读后终于找到了解决办法本介绍多次,是为了注释掉FUNCTION {output.bibitem}其中的某些部分aasjournal.bst

FUNCTION {output.bibitem}
{ newline$
  "\bibitem[{" write$
  label write$
  ")" %make.full.names duplicate$ short.list =
   %   { pop$ }
   %   { * }
   % if$
  "}]{" * write$
  cite$ write$
  "}" write$
  newline$
  ""
  before.all 'output.state :=
}

即使没有加载,这也对我来说有效natbib:)

相关内容