0

I am trying to create a custom bibliography file to use with natbib. I have used

latex makebst

During running makebst I have selected the numerical style (default) option:

STYLE OF CITATIONS:
(*) Numerical as in standard LaTeX

However, the style does not work with the \citet command. Instead of

Whitney [2] has demonstrated ...

I get

(author?) [2] has demonstrated ...

screenshot

along with the following warning

Package natbib Warning: Author undefined for citation`Whi65'(natbib) on page 1 on input line 6.

What am I doing wrong?

MWE:

\documentclass{article}
\usepackage[square, numbers, comma, sort, compress]{natbib}
\begin{filecontents}{database.bib}
@article{MP74,
author = "Robert MacPherson",
title = "Chern classes for singular algebraic varieties",
journal = "Ann. of Math.",
volume = 100,
year = 1974,
pages = "423--432"}

@article{Whi65,
author = "Hassler Whitney",
title = "Tangents to an analytic variety",
journal = "Ann. of Math.",
volume = 81,
year = 1965,
pages = "496--549"}
\end{filecontents}

\begin{document}

For more information read \citep{MP74}.
\citet{Whi65} has demonstrated ...

\bibliographystyle{mystyle}
\bibliography{database}

\end{document}
  • See texdoc natbib page 7 (author?) is the documented behaviour if you use \citet with a bst file that only supports numeric citations. – David Carlisle Jan 12 '17 at 11:57
  • @DavidCarlisle: I see now. Is there a solution? – user122874 Jan 12 '17 at 12:05
  • there's always a solution (although not from me at the moment) basically you need to look how the natbib supplied styles support this then see if makebst can make that style (or modify the bst by hand, so compare plain.bst to plainnat.bst etc – David Carlisle Jan 12 '17 at 12:21

1 Answers1

1

I have found the solution following another thread:

  1. In makebst the author-year citation style should be selected (not the numerical).
  2. Keep using the natbib numbers option, i.e. \usepackage[numbers]{natbib}

The linked answer states that one needs to uncomment a line in the .dbj file produced by merlin.mbs, but for some reason the line was already uncommented in the gnerated dbj.

Now it works:

enter image description here