3

I created my own cmu2014.bst by makebst. My cites go well including \citep except the \citeauthor and \citet. They show (author?) in my citation in both \citeauthor and \citet.

I compile by XeLaTeX because I changed the font.

This is part of my TeX file

\usepackage[sort,compress,numbers]{natbib}
\bibliographystyle{./bst/cmu2014}
\bibliography{./bib/Ref}
  • @Mico, well, there is a possible way to solve that. In the natbib documentation they explain it (see Section 3 in osl.ugr.es/CTAN/macros/latex/contrib/natbib/natbib.pdf). – Vicent Nov 28 '14 at 8:17
  • istm that we can’t actually tell what’s going on, unless you show us (a) the code of your \cite command (at least: a full minimum example would be better), and (b) of the relevant entry in the the bibtex file. – wasteofspace Nov 28 '14 at 8:36
  • @Mico, you are partially right. See my answer to the question. I am going to edit it right now. – Vicent Nov 28 '14 at 8:42
3

There is a solution for that. I had to address this very same problem some days ago. The solution is given in http://osl.ugr.es/CTAN/macros/latex/contrib/natbib/natbib.pdf, Sections 2.4 and 3.

First of all, you need to create the .bst file (with makebst) as an author-year reference style. This is important. So maybe you'll have to run makebst again.

Then, as far as I remember, you don't have to change anything in your .tex code, that is:

\usepackage[sort,compress,numbers]{natbib}
\bibliographystyle{./bst/cmu2014}  % created as author-year
\bibliography{./bib/Ref}

Just make sure to compile the code several times, as usual when you change things related to bibliography.

If this doesn’t work for you, try to add

\setcitestyle{numbers}  

after including natbib, but this would be redundant.

Please, let me know if this worked for you.

EDIT: I changed the reference to the natbibdocumentation, thanks to @Mico. To be more precise, it is in section 2.4 where I got the information. Regarding \citeauthor and other similar commands, there it clearly says:

Note: these commands may also be used with numerical citations, provided an author-year .bstfile is being employed.

I had the same problem as @BonSai. The problem that @BonSai has is that he is trying to get author information from a .bst file that was created as a number reference style. If you create a .bst file as an author-year style (and only then), it is possible to get correct results when you use things like \citeauthor even when you use natbib with the numbers option. And this is also related to the Section 3 of the documentation, which specifies how you can use author-year reference styles with number citation styles.

EDIT: As @Mico pointed out, this answer wouldn't solve the problem with \citet that the Post Owner (PO; @BonSai) reported. Nevertheless, I still think that the problem is related with the .bst file. It has to be created again as an author-year reference style.

Anyway, a MWE would be desirable on the part of the PO, of course.

  • @Mico, honestly, I can't answer that. But I think the problem the PO has is somehow related to what I said in my answer. Let us see what he says. I mean, my answer could solve the issue with \citeauthor, but \citet should work well also with numbers option. Anyway, I think he has to run makebst again in any case. – Vicent Nov 28 '14 at 8:52
  • Thanks. I change the dbj file to author-year by adding 'ay' and then compile. It works with \citet and \citeauthor. – Bon Sai Dec 1 '14 at 3:42
  • @BonSai, if my solution worked to you, then you should "accept" it. That is how this site works. – Vicent Dec 1 '14 at 11:55
  • Sorry, I'm very new to this community, how I accept your solution ? – Bon Sai Dec 4 '14 at 15:13
  • @BonSai, I guess you already found it out: Just enable the green big check symbol close to the beginning of my answer, at the left-hand side. :) – Vicent Dec 5 '14 at 12:03
3

You haven't told us which options you passed to the makebst utility when you created your own bibliography style file. Based on the bits of information you've provided, though, I suspect you told makebst that you want numerical-style citation callouts (which is the utility's default style). To wit, consider the following output, generated with the plain bibliography style, which is known not to be compatible with authoryear-style callouts. Observe that \citep and \cite produce a number in brackets, whereas \citet and \citeauthor produce "(author?)".

enter image description here

This problem does not occur if the code is re-run with the style set to, say, plainnat or apalike -- both of which can produce both authoryear-style and numeric-style citation callouts. The remedy, then, is to make sure that makebst is rerun with a suitable authoryear-style callout system.

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{abc,
   author = "Anne Author",
   title  = "Thoughts",
   journal= "Circularity Today",
   year   = 3001,
}
\end{filecontents*}
\usepackage[numbers]{natbib} 
\bibliographystyle{plain}
\begin{document}
\cite{abc}, \citep{abc}

\citet{abc}, \citeauthor{abc}
\bibliography{\jobname}
\end{document}

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.