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?

Mico
  • 506,678

1 Answers1

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.

Mico
  • 506,678
  • 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).

    – Dharmeshkumar Patadiya Apr 02 '16 at 06: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 Apr 02 '16 at 07:03
  • Thanks for reply. I am getting round parenthesis but citations are not sorted out in alphabetical order after using \bibliographystyle{plainnat} style. – Dharmeshkumar Patadiya Apr 03 '16 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 Apr 03 '16 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,....

    – Dharmeshkumar Patadiya Apr 06 '16 at 10:54
  • @DharmeshkumarPatadiya - Please post a new question, asking which bibliography style might be providing the formatting you need. – Mico Apr 06 '16 at 10:59