1

I am writing an article. MWE is given below.

\documentclass[a4paper,times,12pt,ifthen]{article}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{epstopdf}
\usepackage{nomencl}
%\makeindex
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage[top= 2.00cm,bottom = 2.00cm,left= 2.00cm,right= 2.00cm]{geometry}
\makeatletter % these following 3 command will print reference without box
\renewcommand*{\@biblabel}[1]{\hfill#1.}
\makeatother
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{authblk}
\usepackage[acronym,nonumberlist]{glossaries} % prints glossary without page number at end
\usepackage{longtable} %spans table in two pages
\usepackage{subfigure} %gives subfigures
\usepackage{array} % justify table content
\usepackage{booktabs} % will center justified table
\usepackage[authoryear]{natbib}
\usepackage{color} % will print colour text
\bibliographystyle{agsm}
\RequirePackage{ifthen}
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{G}}{\item[\textbf{Greek Symbols}]}{
\ifthenelse{\equal{#1}{S}}{\item[\textbf{Subscripts}]}{}}}
\makenomenclature
\makeglossaries

\begin{document}
Comparing results in \citep{Shigley2011} with \citet{Duffy2010} and \cite{Carslaw1959}.

\makenomenclature
\printnomenclature
\printglossaries
\bibliographystyle{unsrtnat}
\bibliography{CoalCombustion.bib}
\end{document}

Bibtex file CoalCombustion.bib is

@book{Carslaw1959,
  title={Heat in solids},
  author={Carslaw, HS and Jaeger, JC},
  volume={19591},
  year={1959},
  publisher={Clarendon Press, Oxford}
}

@book{Duffy2010,
  title={Transform methods for solving partial differential equations},
  author={Duffy, Dean G},
  year={2010},
  publisher={CRC press}
}

@book{Shigley2011,
  title={Shigley's mechanical engineering design},
  author={Shigley, Joseph Edward},
  year={2011},
  publisher={Tata McGraw-Hill Education}
}

Output is enter image description here

Why citations are not printed in text and reference?

3
  • 1
    Have you run pdflatexbibtexpdflatexpdflatex? See this question for more information about this compilation cycle.
    – sodd
    Commented Mar 24, 2016 at 14:02
  • You have two separate \bibliographystyle instructions. Which style do you wish to load: agsm or unsrtnat?
    – Mico
    Commented Mar 24, 2016 at 14:21
  • Off-topic: The subfigure package is deprecated. Don't use it. Instead, use a package such as subfig.
    – Mico
    Commented Mar 24, 2016 at 14:33

1 Answer 1

2

Some suggestions/observations:

  • Change \bibliography{CoalCombustion.bib} to \bibliography{CoalCombustion}, i.e., omit the .bib extension.

  • Choose one, and only one, bibliography style -- agsm or unsrtnat, but not both. If you choose the agsm style, load the har2nat package for maximal compatibility with packages such as hyperref.

  • Be sure to run LaTeX, then BibTeX, and then LaTeX twice more to generate the citation call-outs expected from \cite, \citep, and \citet.

6
  • Your suggestion #2 worked for me and I retained unsrtnat style. I am facing two problems. 1. In article, citation comes with [] bracket but I want () bracket. 2. Reference comes in the order of its first cited in paper. I want it in alphabetical order. I am compiling pdflatex ->bibtex -> pdflatex (twice). Commented Apr 2, 2016 at 6:21
  • @DharmeshkumarPatadiya - (i) Add the option round when loading natbib, i.e., type \usepackage[authoryear,round]{natbib}. (ii) The unsrtnat bibliography, as its name indicates, doesn't perform alphabetical sorting; use the plainnat style if you want the entries be sorted. After changing the bibliography style, be sure to run LaTeX, then BibTeX, and then LaTeX twice more to fully propagate the change.
    – Mico
    Commented Apr 2, 2016 at 7:03
  • Thanks for reply. I am getting round parenthesis but citations are not sorted out in alphabetical order after using \bibliographystyle{plainnat} style. Commented Apr 3, 2016 at 10:12
  • @DharmeshkumarPatadiya - Three questions: (i) You have only one \bibliographystyle instruction, and the argument of that instruction is plainnat, right? (ii) After changing the argument of the one-and-only \bibliographystyle instruction, did you rerun LaTeX, BibTeX, and LaTeX twice more? (iii) Are you getting any error and/or warning messages related to the bibliography style in the .log and .blg files?
    – Mico
    Commented Apr 3, 2016 at 10:28
  • Answer to your questions (i)Yes, I have only one bibliography style with plainnat as argument (ii)Yes. I run it as you suggested using terminal pdflatex, bibtex, pdflatex (twice). (iii)No, I am not getting any error message in .blg and .log file. One important observation it sort out with last name and middle name at beginning but not with first name. For example it sorts HS Carslaw and JC Jaegar..... Dean G Duffy.... Joseph Edward Shigley..... While I want it like below Carslaw, H. S. & Jaegar J. C, ..... Duffy, Dean. G.,.... Shigley, Joseph Edward,.... Commented Apr 6, 2016 at 10:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .