natbib 和 aaai 命名

natbib 和 aaai 命名

我必須使用aaai-named樣式

我想在 Overleaf 中使用它。我嘗試使用該.bst文件並以這種方式集成它:

\documentclass{article}

\usepackage[style=authoryear]{natbib}
\bibliographystyle{aaai-named}

\begin{document}

  \citep{latexcompanion}

  \bibliography{references.bib}

\end{document}

這工作正常但是

  1. 我想用biblatexnatbib
  2. 引文沒有整合,因為我透過執行\cite(), \citep{}, ...只得到 (作者) 而不是 [作者,年份]

任何人都可以幫助整合嗎?或者有人知道 Overleaf 支援類似的風格嗎?

答案1

biblatex.bst與BibTeX 使用的檔案不相容。所以不能biblatex與 一起使用aaai-namedaaai-named然而,兼容,natbib因此以下 MWE 對我來說效果很好。

natbib的作者年份模式透過選項輸入authoryear 沒有 style=字首。natbibsquare選項為您的引文提供方括號。

\documentclass{article}

\usepackage[authoryear,square]{natbib}
\bibliographystyle{aaai-named}

%\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{latexcompanion,
  author    = {Michel Goossens and Frank Mittelbach
               and Alexander Samarin},
  title     = {The \LaTeX\ Companion},
  year      = {1993},
  publisher = {Addison-Wesley},
  location  = {Reading, Massachusetts}
}
\end{filecontents}

\begin{document}
\citep{latexcompanion}
\bibliography{\jobname}
\end{document}

[古森斯等人,1993]

此指令\bibliography採用不含檔案副檔名的檔名參數。


natbib預設情況下,不會在參考書目中顯示作者年份標籤(大概是因為它們通常與作者年份兼容的參考書目樣式是多餘的,但我承認年份臨近年底的事實aaai-named使標籤更具吸引力)。

如果您不需要 的擴充功能,您可以使用評論中建議的natbib以下修改\citeaaai-named.bst

\documentclass{article}

\bibliographystyle{aaai-named}

\makeatletter
\let\@internalcite\cite
\def\cite{\def\citename##1{##1}\@internalcite}
\def\shortcite{\def\citename##1{}\@internalcite}
\def\@biblabel#1{\def\citename##1{##1}[#1]\hfill}
\makeatother

%\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{latexcompanion,
  author    = {Michel Goossens and Frank Mittelbach
               and Alexander Samarin},
  title     = {The \LaTeX\ Companion},
  year      = {1993},
  publisher = {Addison-Wesley},
  location  = {Reading, Massachusetts}
}
\end{filecontents}

\begin{document}
\cite{latexcompanion}
\bibliography{\jobname}
\end{document}

相關內容