1

I wanted to cite the same Author and same year of publication paper and I want to cite them like (Rupke,2005a,b,c) or (Rupke,2005a),(Rupke,2005b) etc. The latex code i added below is giving me an error. Any help? Thanks!

\documentclass[a4paper,11pt,twoside,openright]{report}
\usepackage[round]{natbib}
\usepackage{hyperref}

\begin{document}
\citep{Rupke2005a},\citep{Rupke2005b,Rupke2005c}
\end{document}

Here is also the .bib file in my file name called proj.bib:

@article{Rupke2005a,
author = {Rupke, David S and Veilleux, Sylvain and Sanders, D B},
file = {:home/melaku/Documents/Master project/papers/petri4444me.pdf:pdf},
pages = {87--114},
title = {{Keck High-Resolution Spectroscopy of Outflows in Infrared-luminous Galaxies}},
year = {2005}
}

@article{Rupke2005b,
author = {Rupke, David S and Veilleux, Sylvain and Sanders, D B},
file = {:home/melaku/Documents/Master project/papers/petri 4 pr.pdf:pdf},
pages = {115--148},
title = {{Outflows in Infrared-Luminous Starbursts at z 〈 0.5. I. Sample, Na I D Spectra, and Profile Fitting

Show affiliations
}},
year = {2005}
}

@article{Rupke2005c,
author = {Rupke, David S and Veilleux, Sylvain and Sanders, D B},
file = {:home/melaku/Documents/Master project/papers/petri 3 pr out flow.pdf:pdf},
pages = {751--780},
title = {{Outflows in active galactic nucleus/starburst-composite ultraluminous infrared galaxies 1,2,3}},
volume = {3},
year = {2005}
}
  • Your sample code is missing both a \bibliographystyle directive and a \bibliography directive. Unsurprisingly, BibTeX throws error messages in such cases. – Mico Oct 30 '17 at 15:39
2

For that, you should specify an author-year style for your bibliography. For example the apalike:

\documentclass[a4paper,11pt,twoside,openright]{report}
\usepackage[round]{natbib}
\usepackage{hyperref}

\begin{document}
\citep{Rupke2005a},\citep{Rupke2005b,Rupke2005c}

\bibliography{proj} % <== you must say where your bib entries are
\bibliographystyle{apalike} % <== and here you specify the style for your bibliography
\end{document}

enter image description here

For other options of author-year styles, see the natbib documentation.

| improve this answer | |
  • 1
    The apalike bibliography style can generate only authoryear-type citation call-outs. Other styles, including plainnat and abbrvnat, can generate numeric-style and authoryear-style citation call-outs. In such cases, it's necessary to set the option authoryear explicitly while loading natbib. If authoryear-style citation call-outs are needed, I think it's always a good idea to specify the option authoryear when loading natbib. If the bibliography style you happen to use cannot generate authoryear-style citatino call-outs, you'll get a helpful warning message. – Mico Oct 30 '17 at 15:37
  • @Mico, thanks for your comment. I'm a biblatex person myself, so not very acquainted with natbib styles. If you feel like editing the question to add this information, please be welcome. Or if you care to provide another more complete one, I woudn't be troubled at all, on the contrary. – gusbrs Oct 30 '17 at 15:49
  • @Mico Thanks but still not working, seems you have changed something from .bib file coz I already did that, doesn't make any difference though.What did u change exactly to .bib file? – Melaku Sisay Oct 30 '17 at 16:02
  • @MelakuSisay, I just copy-pasted your entries to a file named proj.bib in the same directory as the main tex file. Are you aware that you must build your document with pdflatex -> bibtex -> pdflatex -> pdflatex ? – gusbrs Oct 30 '17 at 16:07
  • 1
    @MelakuSisay, then we need more details as to what means "still not working". What exactly goes wrong? Do you get errors? Or results are different from the expected? Do the problems appear even if you use the above simplified example, or only in your full document? – gusbrs Oct 30 '17 at 16:37

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.