1

I have to use the aaai-named style.

I want to use it in Overleaf. I tried to use that .bst file and integrated it in that way:

\documentclass{article}

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

\begin{document}

  \citep{latexcompanion}

  \bibliography{references.bib}

\end{document}

This is working fine but

  1. I want to use biblatex not natbib
  2. The citations aren't integrated because I get only (author) instead [author, year] by doing \cite(), \citep{}, ...

Can anyone help to integrate that? Or does anyone knows a similar style which is supported by Overleaf?

  • aaai-named is a BibTeX style file (a .bst file) and can not be used together with biblatex. The style is compatible with natbib's authoryear style, though. That style, however, must be loaded as \usepackage[authoryear]{natbib} and not with the style=prefix. If natbib does not work for you, we need to see an example how exactly things fail. Please prepare an MWE: tex.meta.stackexchange.com/q/228/35864 – moewe Mar 9 '19 at 17:25
  • \bibliography needs the file without extension, so it should be \bibliography{references}. Though that is unlikely to be an issue. What does the entry latexcompanion in references.bib look like? – moewe Mar 9 '19 at 17:45
  • @book{latexcompanion, author = {Michel Goossens and Frank Mittelbach and Alexander Samarin}, title = {The \LaTeX\ Companion}, year = {1993}, publisher = {Addison-Wesley}, location = {Reading, Massachusetts} } – user182410 Mar 9 '19 at 17:47
  • 1
    @moewe that isn't that problem anymore. thank you. The problem now is that the refenreces in the bibliography look like this: Donald Knuth. Knuth: Computers and typesetting, 1984. instead [Knuth, 1984] Donald Knuth. Knuth: Computers and typesetting, 1984. – user182410 Mar 9 '19 at 17:53
2

biblatex is not compatible with the .bst files used by BibTeX. So you can't use biblatex together with aaai-named. aaai-named is, however, compatible with natbib and so the following MWE works just fine for me.

natbib's author-year modus is entered with the option authoryear without style= prefix. natbib's square option gives you square brackets for your citation.

\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}

[Goossens et al., 1993]

The command \bibliography takes the file name argument without file extension.


natbib does not show the author-year labels in the bibliography by default (presumably because they are normally redundant with author-year-compatible bibliography styles, but I admit that the fact that the year comes towards the end in aaai-named makes the label more attractive).

If you don't need natbib's extended features you can use the following modifications of \cite that are suggested in the comments in aaai-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}
| improve this answer | |
  • Thank you. After I took a new Overleaf Document, I got it. I seems that the failure was in the references.bib which is normally bigger in that real project. But now, are you sure that the references shouldn't look like this: with that brackets [] in front of it ?: [Aamport, 1986] L[eslie] A. Aamport. The gnats and gnus document prepa- ration system. G-Animal's Journal, 41(7):73+, July 1986. This is a full ARTICLE entry. ? – user182410 Mar 9 '19 at 18:02
  • @user182410 natbib does not display the citation labels in the bibliography again for authoryear styles. So it is kind of expected that you don't see the "[Aamport, 1986]". I couldn't find a quick way to make natbib show the label and I will only have time to investigate if that is possible tomorrow or the day after. – moewe Mar 9 '19 at 18:07
  • would be great ! thanks for your time, sorry for my mistake here , I couldn't now that there is a failure in my references.bib , I don't now where the failure is there .. next time i will do directly an MME. thanks for you help ! – user182410 Mar 9 '19 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.