2

This is the MWE of the latex file (Thesis).

\documentclass[11pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-sided paper
\usepackage{wrapfig}
\usepackage{lscape}
\usepackage{lmodern}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{enumerate}
\usepackage{csquotes}
\usepackage{multirow}
\usepackage[para]{threeparttable}
\usepackage{etoolbox}
\apptocmd{\AA}{\xspace}{}{}
\usepackage{adjustbox}
\usepackage{ae,aecompl}
\usepackage{amssymb}    % Extra maths symbols
\usepackage{wasysym}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{xspace}

%\usepackage{subcaption} %incompatible with subfig
\graphicspath{{Pictures/}} % Specifies the directory where pictures are stored
\usepackage[round, sort, numbers]{natbib} % Use the natbib reference 

\label{Bibliography}

\lhead{\emph{Bibliography}} % Change the page header to say "Bibliography"

\bibliographystyle{apalike} % Use the "custom" BibTeX style for formatting the Bibliography

\bibliography{Bibliography} % The references (bibliography) information 

My .bib file format is (This is taken from NASA.ADS, there is no changes made to this)

@ARTICLE{Wilhiteetal:2005ApJ,
    author = {{Wilhite}, Brian C. and {Vanden Berk}, Daniel E. and {Kron}, Richard G. and
    {Schneider}, Donald P. and {Pereyra}, Nicholas and
    {Brunner}, Robert J. and {Richards}, Gordon T. and
    {Brinkmann}, Jonathan V.},
    title = "{Spectral Variability of Quasars in the Sloan Digital Sky Survey. I. Wavelength Dependence}",
    journal = The Astrophysical Journal,
    keywords = {Galaxies: Active, Galaxies: Quasars: General, Techniques: Spectroscopic, Astrophysics},
    year = "2005",
    month = "Nov",
    volume = {633},
    number = {2},
    pages = {638-648},
    doi = {10.1086/430821},
    archivePrefix = {arXiv},
    eprint = {astro-ph/0504309},
    primaryClass = {astro-ph},
    adsurl = {https://ui.adsabs.harvard.edu/abs/2005ApJ...633..638W},
    adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

When I compile the file, the pdf output is Wilhite et al. (33)

Q1. I don't want the number (33) to be present in the text, I want only the author name and year to be there. The year doesn't appear while compiling. I want all the refernces within the thesis to be like Wilhite et al. (2005) i.e. author (year) format.

and in the Bibliography section it is

[Wilhite et al.] Wilhite, B. C., Vanden Berk, D. E., Kron, R. G., Schneider, D. P., Pereyra,
N., Brunner, R. J., Richards, G. T., and Brinkmann, J. V. Spectral Variability of
Quasars in the Sloan Digital Sky Survey. I. Wavelength Dependence.

Q2. I want the reference to be numbered and complete with the journal details. This is seen only in few references like the one below.

[52] Warwick, R. S., Done, C., and Smith, D. A. (1995). The soft X-ray spectrum of NGC
4151 revisited. Monthly Notices of the Royal Astronomical Society, 275(4):1003–1016.

I want all the references in the above format.

This is the output when using \bibliographystyle{chicago} enter image description here

4
  • Dif you try a different \bibliographystyle?
    – emeryville
    Apr 21 '20 at 10:44
  • I tried using this one but got the same thing. \bibliographystyle{plainnat}. Sometimes when compiling using this one, the cited names are all in capitals
    – BRMBU
    Apr 21 '20 at 11:04
  • What command do you use to cite the reference? Apr 21 '20 at 16:12
  • \cite and \citep when needed.
    – BRMBU
    Apr 21 '20 at 16:13
2

Choosing a bibliography style is tricky. Fortunately, here is the excellent ''Choosing a BibTeX style'', that lists a huge variety of styles, sorted into their nominal topics as well as providing a good range of examples.

  • I use \bibliographystyle{chicago} that gives the author and the name in the text.
  • Then the references give the journal details.
  • However, I don't need a number in the references because this number is not called in the text anyway. In case you need one you can add a preamble to add numbers in the references.

The following example works for me

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{etoolbox}
\newcounter{bibcount}

\usepackage{natbib}

\makeatletter 
\patchcmd{\@lbibitem}{\item[}{\item[\hfil\stepcounter{bibcount}{\thebibcount.}}{}{}
\setlength{\bibhang}{2\parindent}
\renewcommand\NAT@bibsetup%
[1]{\setlength{\leftmargin}{\bibhang}\setlength{\itemindent}{-\parindent}%
    \setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}}
\makeatother

\bibliographystyle{chicago}

\title{Bibliography management: \texttt{natbib} package}
\date{}

\begin{document}

    \maketitle

    This document is an example of \texttt{natbib} package citing \cite{latexcompanion}. 

    \bibliography{sample}

\end{document}

with the sample.bib

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley"
}

enter image description here

9
  • It doesn't work. Giving the following error Unknown option number' for package natbib'. \newcommand
    – BRMBU
    Apr 21 '20 at 16:04
  • When I change \usepackage[square, numbers]{natbib} from \usepackage[round, sort, numbers]{natbib}, it compiles but gives the following within the text "observations of some of the bright and nearby [8], [50], [30], [Simkin], [Ulrich et al.])" Some are numbers, some are names.
    – BRMBU
    Apr 21 '20 at 16:11
  • I added an example that works for me with the \bibliographystyle{chicago}
    – emeryville
    Apr 21 '20 at 16:50
  • I tried it with the example you added. It works fine but the only thing is that the output file (pdf), all the references are coming in upper case i.e. ALEXANDER ET.AL. , 1993 within the body of the text and the references are not numbered
    – BRMBU
    Apr 22 '20 at 3:02
  • I updated my example with numbers but the references were not capitalized in my example.
    – emeryville
    Apr 22 '20 at 5:03

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.