0

I could finally get the the code for references in bibliography. But the numbers do no seem to appear whatever I try. What changes do I make in the following code ? There are few extra packages, please ignore them.

\documentclass[12pt,twoside,a4paper]{report}
%\documentclass[12pt,twoside,a4paper,draft]{report}
\author{S Sudheer}

\usepackage[bookmarksnumbered,colorlinks=true,citecolor=blue,linkcolor=blue,urlcolor=blue]{hyperref}
%\usepackage[bookmarksnumbered,colorlinks=true,citecolor=black,linkcolor=black,urlcolor=black]{hyperref}

\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\Huge\bfseries}
%\renewcommand{\abstracttextfont}{\normalfont\Huge}

\usepackage[hmarginratio=1:1]{geometry}
\usepackage{abstract,graphicx,color,float,amsmath,relsize,url,bm}
\usepackage[titletoc,page]{appendix}

\usepackage[raggedright]{titlesec}
\titlespacing{\section}{0pt}{1pt plus 1pt minus 1pt}{-1pt plus 1pt minus 1pt}
\titlespacing{\subsection}{0pt}{1pt plus 1pt minus 1pt}{-1pt plus 1pt minus 1pt}
\titlespacing{\subsubsection}{0pt}{1pt plus 1pt minus 1pt}{-1pt plus 1pt minus 1pt}
%\newcommand\section{\@startsection {section}{1}{\z@}%
%                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
%                                   {2.3ex \@plus.2ex}%
%                                   {\normalfont\Large\bfseries\raggedright}}


\usepackage{tabularx,multirow,array}
\usepackage{cleveref} % Load AFTER hyperref!
    \crefname{equation}{Eq.}{Eqs.}
    \Crefname{equation}{Equation}{Equations}
    \crefname{figure}{Fig.}{Figs.}
    \Crefname{figure}{Figure}{Figures}
    \crefname{table}{Table}{Tables}
    \Crefname{table}{Table}{Tables}
    \crefname{section}{Section}{Sections}
    \Crefname{section}{Section}{Sections}
    \crefname{chapter}{Chapter}{Chapters}
    \Crefname{chapter}{Chapter}{Chapters}
%   \Crefname{chapter}{Chapter}{Chapters}
%   \Crefname{appendix}{Appendix}{Appendices}
%   \crefformat{appendices}{Appendix~(#2#1#3)}
%   \Crefformat{app}{#2Appendix~(#1)#3}
%   \crefformat{app}{#2Appendix~(#1)#3}
%   \Crefformat{appendix}{\appendixname~#2#1#3}
%End of Clever Ref Package

\usepackage[justification=centering,labelfont=bf,labelsep=space]{caption}
%\usepackage[justification=centering,font=small,labelfont=bf,labelsep=space]{caption}
\captionsetup{%
    figurename=Fig.
%%  tablename=Tab.
}

%float extra space removal
% Alter some LaTeX defaults for better treatment of figures:
    \renewcommand{\topfraction}{1}  % max fraction of floats at top
    \renewcommand{\bottomfraction}{1}   % max fraction of floats at bottom
    %   Parameters for TEXT pages (not float pages)
    \setcounter{topnumber}{2}
    \setcounter{bottomnumber}{2}
    \setcounter{totalnumber}{4}     % 2 may work better
    %\setcounter{dbltopnumber}{2}    % for 2-column pages
    %\renewcommand{\dbltopfraction}{0.9}    % fit big float above 2-col. text
    \renewcommand{\textfraction}{0.01}  % allow minimal text w. figs
    %   Parameters for FLOAT pages (not text pages)
    \renewcommand{\floatpagefraction}{0.7}  % require fuller float pages MUST be less than topfraction !!
    %\renewcommand{\dblfloatpagefraction}{0.7}  % require fuller float pages
    % remember to use [htp] or [htpb] for placement
%end of extra space removal

%Page and paragraph Setup
\usepackage{parskip}
    \topmargin -0.3in
    \headheight 14.5pt
    \headsep 0.3in
    \textheight 9.4in
    \oddsidemargin 0.15in
    \evensidemargin -0.15in
    \textwidth 6.3in
    \raggedbottom
    \parskip 10pt %4pt  %6.2pt                  % sets spacing between paragraphs
    \renewcommand{\baselinestretch}{1.2}    % Uncomment for 1.5 spacing between lines
    \parindent 0pt                  % sets leading space for paragraphs 
%End of page setup

%widows and orphans
%\widowpenalty=300
%\clubpenalty=300

\usepackage[Sonny]{fncychap}
%Instead of Sonny you can try one of these: Lenny, Glenn, Conny, Rejne and Bjarne
\usepackage{fancyhdr}
    \makeatletter
    \def\headrule{{%
      \if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
      \hrule\@height\footrulewidth\@width\headwidth\vskip1pt%
      \hrule\@height\headrulewidth\@width\headwidth\vskip-\headrulewidth\vskip-4pt
    }}
    %
%   \def\footrule{{%
%     \if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
%     \vskip-\footruleskip\vskip-\footrulewidth
%     \hrule\@height\headrulewidth\@width\headwidth\vskip1pt%
%     \hrule\@height\footrulewidth\@width\headwidth\vskip\footruleskip
%   }}
    \makeatother

% Long title in TOC and short in header for chapters
    \makeatletter
        \newcommand*\std@chapter{}
        \let\std@chapter=\@chapter
        \renewcommand*\@chapter[2][]{\std@chapter[#2]{#2}\chaptermark{#1}}
    \makeatother

    \pagestyle{fancy}
    %\setlength{\headheight}{15pt}
    \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
    \lhead[{\fancyplain{}{\textit{\nouppercase\leftmark}}}]{}
    \rhead[]{\fancyplain{}{\textit{\nouppercase\leftmark}}}
    \lfoot[\thepage]{}
    \rfoot[]{\thepage}
    \cfoot{}
    \renewcommand{\headrulewidth}{0.5pt}
    \renewcommand{\footrulewidth}{0.5pt}

    \fancypagestyle{plain}{ %
    \lhead{} % remove everything
    \chead{}
    \rhead{}
    \lfoot{}
    \cfoot{\thepage}
    \rfoot{}
    \renewcommand{\headrulewidth}{0pt} % remove lines as well
    \renewcommand{\footrulewidth}{0pt}}
%end of page style

%\usepackage[utf8]{inputenc}
\usepackage{nomencl}
\makenomenclature
\RequirePackage{ifthen} 
\renewcommand{\nomgroup}[1]{% 
  \ifthenelse{\equal{#1}{A}}{\item[\textbf{Variables}]}{% 
    \ifthenelse{\equal{#1}{G}}{\item[\textbf{Greek Symbols}]}{%{}}} 
      \ifthenelse{\equal{#1}{S}}{\item[\textbf{Subscripts}]}{%}}}}  Suffixes
        \ifthenelse{\equal{#1}{T}}{\item[\textbf{Acronyms}]} 
{}}}}}

%Sample nomenclature
%\nomenclature[a]{$a$}{The number of angles per unit area}%
%\nomenclature[g]{$\alpha$}{Absorptivity}
%\nomenclature[s]{i}{Initial}
%\nomenclature[t]{$IND$}{INDIA}

% NATBIB
\usepackage[numbers]{natbib}
\bibpunct{(}{)}{,}{a}{,}{,}

%Sample of refernce scheme
% \citet{key}  ==>>  Jones et al. (1990)           (in-text form)
% \citep{key}  ==>> (Jones et al., 1990)           (parenthetical form)
% \citep{key1,key2}         ==>> (Jones et al., 1990, 1992)
% (multiple citations; common authors suppressed)
% \citep[chap. 2]{key}      ==>> (Jones et al., 1990, chap. 2)
% \citep[see][]{key}        ==>> (see Jones et al., 1990)
% \citep[see][chap. 2]{key} ==>> (see Jones et al., 1990, chap. 2)

\usepackage{bookmark}
\newcommand\norm[1]{\left\lVert#1\right\rVert}
\newcommand{\xrightarrowdbl}[2][]{%
    \leftarrow\mathrel{\mkern-14mu}\xrightarrow[#1]{#2}
}
\usepackage{tikz-cd}
%\newcommand{\nospaceperiod}{\makebox[0pt][l]{\,}}
\usepackage{adjustbox}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{amsfonts,amsmath,amssymb,bbm,amsthm}
\usepackage[english]{babel}
\newtheorem{theorem}{Theorem}


\begin{document}

    \input{content}

\end{document}     

I have created a file by name content.tex where I have input the bibliography.bib file. This is the code in .bib file

  @Book{planningalgorithms,
  author = "LaValle, Steven M",
  title = "{Planning Algorithms}",
  publisher = {Cambridge Univ. Press},
  year = "2006",
  pages = "1--570"
  }


   @Book{springer,
  author = "Lydia E Kavraki and Steven M LaValle",
  title = "{Springer handbook of Robotics}",
  publisher = {Cambridge Univ. Press},
  year = "2002",
  Place = "Cambridge",
  }


  @conference{cd10,
  author = "carlsson, Gunnar  and Silva, Vin ",
  title = "{Zigzag persistence}",
  booktitle = "{Foundations of Computational mathematics}",
  year = "2010",
  } 

 @article{dg06,
  author = "Vin De Silva and Robert Ghrist ",
  title = "{Coordinate-free coverage in sensor networks with controlled boundaries via homology.}",
  journal = "{International Journal of Robotics Eesearch}",
  year = "2006",
  }

  @Book{hat02,
  author = "Allen Hatcher",
  title = "{Algebraic Topology}",
  publisher = {Cambridge Univ. Press},
  year = "2002",
  Place = "Cambridge",
  }


  @article{kal13,
  author = "Sara Kalisnik",
  title = "{Alexander Duality for Parametrized Homology}",
  journal = "{Homology, Homotopy and Applications}",
  year = "2013",
  }

  @article{adams,
  author = "Henry Adams and Gunnar Carlsson",
  title = "{Evasion Paths in Mobile Sensor Networks}",
  journal = "{International Journal of Robotics Research}",
  year = "2013",
  }

This is the output I am getting in Bibliography section enter image description here

What changes can I make in the above code to get the numbers(or some other defined labels) beside the references ?

  • 1
    Could you please make your code a compilable MWEB (Minimal working example with Bibliography) by a) removing all unnecessary packages and other code from your preamble and b) adding the bibliographystyle that you use. Please also state if your code produces any error messages. – leandriis May 04 '19 at 16:39
  • 1
    I've voted to close this as a duplicate, because I'm assuming you want Author-Year citations not numeric, but you want the bibliography numbered. If you just want numbered citations in the text, then just add \bibliographystyle{plainnat} and remove the \bibpunct command from your preamble. – Alan Munn May 04 '19 at 16:44
  • With \bibpunct{(}{)}{,}{a}{,}{,} you request author–year type citations while you seem to want to have numerical ones. According to the manual this would correspond to n. If this is not correct and you want to use author-year citations while still having the bibliography entries numberes, you might be interested in the question, Alan Munn linked to in hie comment. However, you might be interested in changing from \bibpunct to \setcitestyle. – leandriis May 04 '19 at 16:45
  • @AlanMunn: Simply adding the plainnat bibliography style does not seem to work due to the settings in the \bibpunct command. – leandriis May 04 '19 at 16:46
  • 1
    @leandriis You're right. I didn't have the patience to wade through the code... – Alan Munn May 04 '19 at 16:47
  • Sorry for unnecessary codes there and not mentioning the '\bibliographystyle'.
      I was using  '\bibliographystyle{chapter/jmb}' to input 'jmb.bst' file. Though I wasn't sure what it does, but "\bibliographystyle{plainnat}' works for numbering. Thank you.
    
        However, I tried using '\setcitestyle' and I am getting these errors: 
    
    

    "Paragraph ended before \NAT@find@eq was complete.", "Undefined control sequence."

    – Vinay Sipani May 04 '19 at 18:03

0 Answers0