0

I'm using elsarticle-harv.bst for my thesis bibliography and, along with this, I am numbering the references based on this answer: https://tex.stackexchange.com/a/141350/149294 as follows:

% increase \bibhang to take care of the numbers (adjust at will)
\setlength{\bibhang}{2pc}
\makeatletter
% patch \@lbibitem to print the current number before the authors
\patchcmd{\@lbibitem}
  {]}
  {]\bbl@box{\theNAT@ctr} }
  {}{}
% add to the aux file the information about the last number
\apptocmd{\endthebibliography}
  {\if@filesw\write\@mainaux{\string\bbl@lastnumber{\theNAT@ctr}}\fi}
  {}{}
% allocate a length, set to a provisional value
\newlength{\bbl@lastnumberwd}
\setlength\bbl@lastnumberwd{0pt}
% this command will be in the aux file and sets the widest label width
\newcommand\bbl@lastnumber[1]{
  \settowidth\dimen@{[#1]}
  \global\bbl@lastnumberwd\dimen@}
% a command to print the number
\newcommand{\bbl@box}[1]{
  \makebox[\bbl@lastnumberwd][r]{[#1]}
}
\makeatother

However, my numbering begins from 0 instead of 1. How may I modify the code so as to make it start from 1?

References up to the 7th one

This is the cls file I am using:

% iitbthesis.cls
% LaTeX Style file for the Indian Institute of Bombay Thesis Format
%
% Many commands copied from withesis.cls from 
% http://www.ctan.org/tex-archive/macros/latex/contrib/withesis/
%
%=============================================================================
% Licensed under the Perl Artistic License.
% see: http://www.ctan.org/tex-archive/help/Catalogue/licenses.artistic.html
% for more info...
%=============================================================================
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{iitbthesis}[2007/06/25 IIT Bombay Thesis Format]
\typeout{Document Class `iitbthesis' v0.95beta <18 Sept 07>}

%============================================================================= % TBD: We need options to switch between Annual Progress Report, % Presynopsis, Synopsis and final thesis, and between different % types of reports. %============================================================================= %\DeclareOption{aps}{} %\DeclareOption{presynopsis}{} %\DeclareOption{synopsis}{} %\DeclareOption{thesis}{} %\DeclareOption{dissertation}{} %\DeclareOption{project}{}

%============================================================================= % Pass the options to report class \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}

% Defaults ... \ProcessOptions

%============================================================================= % a4paper: thesis must be printed on a4 size paper. % 12pt: font size must be 12 pt % % As iitbthesis class is a simple extension of report class, we simply % pass default options to report class. % ============================================================================= \PassOptionsToClass{12pt,a4paper}{report} \LoadClass{report}

% who is advisor? \def@advisorname{None} \newcommand{\setguide}[1]{\def@advisorname{#1}}

% and coadvisor? (initialized to empty) \global\let@coadvisorname@empty \newcommand{\setcoguide}[1]{\def@coadvisorname{#1}} \let\coguide\setcoguide % \newcommand{\show@coguide}{@coadvisorname}

% and exadvisor? (initialized to empty) \global\let@exadvisorname@empty \newcommand{\setexguide}[1]{\def@exadvisorname{#1}} \let\exguide\setexguide % \newcommand{\show@exguide}{@exadvisorname}

%============================================================================= % TITLE PAGE % - define \title{} \author{} \date{} % - The default degree is Unknown Degree'' % Degree can be changed using the command \iitbdegree{} % - The default department isUnknown Department'' % The department can be changed using the command \department{} % - The default document type is ``A preliminary report'' % The document type can be changed using the command \reporttype{} % There are some short-cuts for \reporttype{}: % * for a PhD thesis, specify \thesis % * for a M.Tech./M.Phil./M.Des./M.S. dissertation, specify \dissertation % * for a DIIT/B.Tech./M.Sc.project report, specify \project % * for a preliminary report, specify \prelim % - once the above are defined, use \maketitle to generate the titlepage %============================================================================= \newcommand@thesistitlemedskip{0.25in} \newcommand@thesistitlebigskip{0.6in} \newcommand{\rollnum}[1]{\gdef@rollnum{#1}} \newcommand{\iitbdegree}[1]{\gdef@iitbdegree{#1}} \newcommand{\department}[1]{\gdef@department{#1}} \newcommand{\reporttype}[1]{\gdef@doctype{#1}} \newcommand{\approvaltype}[1]{\gdef@approvaltype{#1}}

\newcommand{\thesis}{\reporttype{}\approvaltype{Thesis}} \newcommand{\dissertation}{\reporttype{dissertation}\approvaltype{Dissertation}} \newcommand{\project}{\reporttype{project report}\approvaltype{Report}} \newcommand{\prelim}{\reporttype{preliminary report}\approvaltype{Report}}

\gdef@rollnum{Unknown 00000000} % Default is Unknown 00000000 \gdef@iitbdegree{Unknown Degree} % Default is Unknown Degree \gdef@doctype{preliminary report} % Default is a preliminary report \gdef@department{(Unknown Department)} % Default is Unknown

\renewcommand{\maketitle}{% \begin{titlepage} %----------------------------------------------------------------------------- % -- The thesis office doesn't like thanks on title page. Put it in % -- the acknowledgments. This is here so you don't have to change % -- your titlepage when converting from report style. -> from Purdue, but I % left it here since it seems compatible with UW-Madison, Eric - % Amey - I also left it here as IITB does not say anything about it. %----------------------------------------------------------------------------- \def\thanks##1{\typeout{Warning: `thanks' deleted from thesis titlepage.}} \let\footnotesize\small \let\footnoterule\relax \setcounter{page}{1} \vspace*{0.1in} \begin{center} \mbox{}\ {\bf\expandafter\uppercase\expandafter{\LARGE@title}} \[@thesistitlebigskip] {\large @doctype\ Submitted in partial fulfillment of the requirements} \ {\large of the degree of}\[@thesistitlemedskip] {\large @iitbdegree} \[@thesistitlemedskip] {\large by} \[@thesistitlemedskip] {\large \bf @author} \ {\large \bf (Roll No. @rollnum)} \[@thesistitlebigskip] {\large Supervisor: } \ {\large \bf @advisorname} \ \ifx@coadvisorname@empty \ifx@exadvisorname@empty \mbox{}\[@thesistitlebigskip] \else {\large and } \ {\large \bf @exadvisorname} \[@thesistitlemedskip] \fi % \else \ifx@exadvisorname@empty {\large } \ {\large \bf @coadvisorname} \[@thesistitlemedskip] \else {\large \bf @coadvisorname} \%[@thesistitlemedskip] {\large and } \ {\large \bf @exadvisorname} \[@thesistitlemedskip] \fi % \fi % \includegraphics[width=0.2\textwidth]{iitblogo.png} \[@thesistitlemedskip] {\large \uppercase{@department}} \%[@thesistitlemedskip] {\large INDIAN INSTITUTE OF TECHNOLOGY BOMBAY}\%[@thesistitlemedskip] {\large @date} \end{center} \end{titlepage} \setcounter{footnote}{0} \setcounter{page}{1} %title page is NOT counted }

%============================================================================= % DEDICATION %============================================================================= % The dedication environment must do the following: % - start a new page % - center the text vertically % - include the text in a center environment %============================================================================= \def\dedication{ \newpage \thispagestyle{empty} % No page number \setcounter{page}{0} % \addtocounter{page}{-1} \chapter*{} % Required for \vfill to work \thispagestyle{empty} % No page number \null\vfil \begin{center}} \def\enddedication{\end{center}\par\vfil\newpage}

%============================================================================= % APPROVAL SHEET % - start a new page. page % - center the text vertically %============================================================================= \newcommand@thesisapprovalmedskip{0.2in} \newcommand@thesisapprovalbigskip{0.5in} \newcommand{\makeapproval}{ %\setcounter{page}{2} \cleardoublepage \thispagestyle{empty} \begin{center} {\LARGE \bf @approvaltype\ Approval}\[@thesisapprovalbigskip] {\large The @doctype\ entitled}\[@thesisapprovalmedskip] {\bf\expandafter\uppercase\expandafter{\LARGE@title}}\[@thesisapprovalmedskip] {\large by}\[@thesisapprovalmedskip] {\Large \bf @author }\ {\Large (Roll No. @rollnum)}\[@thesisapprovalmedskip] {\large is approved for the degree of} \[@thesisapprovalmedskip] {\large @iitbdegree } \[@thesisapprovalbigskip] \ifx@coadvisorname@empty \ifx@exadvisorname@empty % no co-advisor/external advisor \begin{tabular}{ccc} \rule{6cm}{1sp} &\rule{10mm}{0pt}& \rule{6cm}{1sp} \ {\Large Examiner} && {\Large Examiner} \[@thesisapprovalmedskip]\ \rule{6cm}{1sp} && \rule{6cm}{1sp} \ {\Large Supervisor} && {\Large Chairman} \[@thesisapprovalmedskip]\ {\Large Date:} \rule{4cm}{1sp} && \ && \ {\Large Place:} \rule{4cm}{1sp}&& \end{tabular} \else % only external advisor \begin{tabular}{ccc} \rule{6cm}{1sp} & \rule{10mm}{0pt} & \rule{6cm}{1sp} \ {\Large Examiner} && {\Large Examiner} \[@thesisapprovalbigskip]\ \rule{6cm}{1sp} && \rule{6cm}{1sp} \ {\Large Guide} && {\Large External Guide} \[@thesisapprovalbigskip]\ \multicolumn{3}{c}{\rule{6cm}{1sp}} \ \multicolumn{3}{c}{\Large Chairman} \[@thesisapprovalbigskip] {\Large Date:} \rule{4cm}{1sp} && \ && \ {\Large Place:} \rule{4cm}{1sp}&& \end{tabular} \fi % \else % coadvisor \ifx@exadvisorname@empty % but no external advisor \begin{tabular}{ccc} \rule{6cm}{1sp} &\rule{10mm}{0pt}& \rule{6cm}{1sp} \ {\Large Examiner} && {\Large Examiner} \[@thesisapprovalmedskip]\ \rule{6cm}{1sp} && \rule{6cm}{1sp} \ {\Large Guide} && {\Large Co Guide} \[@thesisapprovalbigskip]\ \multicolumn{3}{c}{\rule{6cm}{1sp}} \ \multicolumn{3}{c}{\Large Chairman} \[@thesisapprovalbigskip] {\Large Date:} \rule{4cm}{1sp} && \ && \ {\Large Place:} \rule{4cm}{1sp}&& \end{tabular} \else % both co-advisor and external advisor \begin{tabular}{ccc} \rule{6cm}{1sp} & \rule{10mm}{0pt} & \rule{6cm}{1sp} \ {\Large Examiner} && {\Large Examiner} \[@thesisapprovalbigskip]\ \rule{6cm}{1sp} && \rule{6cm}{1sp} \ {\Large Guide} && {\Large External Guide} \[@thesisapprovalbigskip]\ \rule{6cm}{1sp} && \rule{6cm}{1sp} \ {\Large Co Guide} && {\Large Chairman} \[@thesisapprovalbigskip]\ {\Large Date:} \rule{4cm}{1sp} && \ && \ {\Large Place:} \rule{4cm}{1sp}&& \end{tabular} \fi %exadvisor empty \fi %coadvisor empty

%change ends

\end{center} \let\thanks\relax \let\maketitle\relax \let\iitbdegree\relax \let\project\relax \let\prelim\relax \let\department\relax \gdef@thanks{}\gdef@iitbdegree{}\gdef@doctype{} \gdef@department{} }

%============================================================================= % CERTIFICATE OF COURSE WORK %============================================================================= % joining date is required for certificate of course work \newcommand{\joiningdate}[1]{\gdef@joindate{#1}} \gdef@joindate{``Unknown''} % - define counters for course numbers & credits, initialize to 0 \newcounter{@course}\setcounter{@course}{0} \newcounter{@credits}\setcounter{@credits}{0}

% - command to add a course. it accepts 3 arguments: % Course ID, Course Name, and Course Credits. \newcommand{\addcourse}[3]{% \addtocounter{@course}{1} \the@course & #1 & #2 & #3 \addtocounter{@credits}{#3} \\hline} \newcommand{\addppcourse}[3]{% \addtocounter{@course}{1} \the@course & #1 & #2 & #3 \\hline}

% - finally the environment to print course list in tabular form \newenvironment{coursecertificate}{ \newpage %\setcounter{page}{0} \cleardoublepage \thispagestyle{empty} \begin{center} {\Large INDIAN INSTITUTE OF TECHNOLOGY BOMBAY, INDIA}\ \vspace{.3in} {\Large \bf CERTIFICATE OF COURSE WORK}\ \vspace{.5in} \end{center} {\large This is to certify that {\bf @author} (Roll No. @rollnum) was admitted to the candidacy of Ph.D. degree on @joindate, after successfully completing all the courses required for the Ph.D. programme. The details of the course work done are given below.}\ \vspace{.3in}\ \begin{tabular}{|r|l|p{10cm}|r|} \hline {\bf S.No} & {\bf Course Code} & {\bf Course Name} & {\bf Credits}\ \hline\hline}% Begining of environment { \hline & & {\bf Total Credits} & {\bf \the@credits} \ \hline \end{tabular}

\vfill {\large \begin{tabular}{lp{2.2in}r} IIT Bombay &&\ Date: & &Dy. Registrar (Academic) \end{tabular}} % End of Course Certificate }

%============================================================================= % ABSTRACT %============================================================================= % The abstract should begin with two single-spaced lines describing % the author and title in a standard format. After these lines comes % the standard abstract. %============================================================================= \def\abstract{ \chapter*{Abstract} \addcontentsline{toc}{chapter}{Abstract} \relax\markboth{ABSTRACT}{ABSTRACT}} \def\endabstract{\par\newpage}

%============================================================================= % COPYRIGHTPAGE % The copyright must do the following: % - start a new page with no number % - place the copyright text centered at the bottom. %============================================================================= \def\copyrightpage{ \newpage \thispagestyle{empty} % No page number \setcounter{page}{0} % \addtocounter{page}{-1} \chapter*{} % Required for \vfill to work \begin{center} \vfill \copyright\ Copyright by @author\ @date\ All Rights Reserved \end{center}}

%============================================================================= % GLOSSARY %============================================================================= % The glossary environment must do the following: % - produce the table of contents entry for the glossary % - start a new page with GLOSSARY centered two inches from the top %============================================================================= \def\glossary{ \chapter*{Glossary} \addcontentsline{toc}{chapter}{Glossary}} \def\endglossary{\par\newpage}

%============================================================================= % NOMENCLATURE %============================================================================= % The nomenclature environment must do the following: % - produce the table of contents entry for the nomenclature section % - start a new page with NOMENCLATURE centered two inches from the top %============================================================================= \def\nomenclature{ \chapter*{Nomenclature} \addcontentsline{toc}{chapter}{Nomenclature}} \def\endnomenclature{\par\newpage}

%============================================================================= % LIST OF SYMBOLS %============================================================================= % The list of symbols environment must do the following: % - produce the table of contents entry for the list of symbols section % - start a new page with LIST OF SYMBOLS centered two inches from the top %============================================================================= \def\listofsymbols{ \chapter*{List of Symbols} \addcontentsline{toc}{chapter}{List of Symbols}} \def\endlistofsymbols{\par\newpage}

%============================================================================= % VITA %============================================================================= % The vita environment must do the following: % - produce a separator page with the word vita centered % - produce the table of contents entry for the vita % - start a new page with VITA centered two inches from the top %============================================================================= \def\vita{ \chapter*{Vita} \addcontentsline{toc}{chapter}{Vita}} \def\endvita{\par\newpage}

%============================================================================= % ACKNOWLEDGMENTS %============================================================================= % The acknowledgments environment must do the following: % - start a new page with ACKNOWLEDGMENTS centered two inches from the top %============================================================================= \def\acknowledgments{ \chapter*{Acknowledgments} \thispagestyle{empty} \doublespace} \def\endacknowledgments{% \vskip 5cm \noindent{\large Date: \rule{4cm}{1sp}\hfill@author\rule{1cm}{0pt}} \par\newpage}

%============================================================================= % @makecaption{NUMBER}{TEXT} : Macro to make a figure or table caption. % NUMBER : Figure or table number--e.g., 'Figure 3.2' % TEXT : The caption text. % Macro should be called inside a \parbox of right width, with \normalsize. %============================================================================= \long\def@makecaption#1#2{% \vskip\abovecaptionskip \sbox@tempboxa{#1: #2}% \ifdim \wd@tempboxa >\hsize \singlespace#1: #2\par \else \global @minipagefalse \hb@xt@\hsize{\hfil\box@tempboxa\hfil}% \fi \vskip\belowcaptionskip}

%============================================================================= % LIST OF FIGURES; LIST OF TABLES % These macros from report.cls have been modified to add entry in the % Contents table %============================================================================= \renewcommand\listoffigures{% \if@twocolumn @restonecoltrue\onecolumn \else @restonecolfalse \fi \chapter{\listfigurename}% \addcontentsline{toc}{chapter}{\listfigurename}% @mkboth{\MakeUppercase\listfigurename}% {\MakeUppercase\listfigurename}% @starttoc{lof}% \if@restonecol\twocolumn\fi } \renewcommand\listoftables{% \if@twocolumn @restonecoltrue\onecolumn \else @restonecolfalse \fi \chapter{\listtablename}% \addcontentsline{toc}{chapter}{\listtablename}% @mkboth{% \MakeUppercase\listtablename}% {\MakeUppercase\listtablename}% @starttoc{lot}% \if@restonecol\twocolumn\fi } %============================================================================= % These commands can be used in the thesis to switch between single % and double spacing. This is needed, for instance, in the abstract. %============================================================================= \newcommand{\oneskip}{1.0} \newcommand{\twoskip}{1.5} \newcommand{\singlespace} {\renewcommand{\baselinestretch}{\oneskip}\Large\normalsize} \newcommand{\doublespace} {\renewcommand{\baselinestretch}{\twoskip}\Large\normalsize}

%============================================================================= % Finally set the various lengths/margins as required by IITB format % Check out LaTeX Companion for more details. %============================================================================= % Paper height & width (A4 paper) - set by a4paper option to report %\setlength{\paperheight}{297mm} %\setlength{\paperwidth}{210mm} % total text area: height & width \setlength{\textheight}{245mm} \setlength{\textwidth}{160mm}

\setlength{\headheight}{3mm} \setlength{\headsep}{12mm} \setlength{\topmargin}{15mm} % left side empty space on odd- & even-numbered pages \if@twoside \typeout{Two side is true} \setlength{\oddsidemargin}{30mm} % for two side printing \setlength{\evensidemargin}{20mm} \else \typeout{Two side is false} \setlength{\oddsidemargin}{30mm} % for one side printing \setlength{\evensidemargin}{30mm} % odd side margin = even side margin \fi \setlength{\hoffset}{-1in} % already accounted for in the margins \setlength{\voffset}{-1in} % already accounted for in the margins % line, paragraphs indent & spacing \setlength{\parindent}{5ex} % indentation 5 characters approx.

\doublespace

%============================================================================= % END FILE %=============================================================================

\newcommand\quotationpage{ \begin{titlepage} \cleardoublepage %\hspace{\hfill} \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{Figure_General/quote.png} \end{figure} %\hspace{\hfill}

\end{titlepage} }

I have a separate file named mybibfile.bib in a folder named references which starts off as:

BOOKS

@book{ref06, doi = {10.1017/CBO9780511815652}, year = {1997}, place = {Cambridge}, title = {Spacecraft Dynamics and Control: A Practical Engineering Approach}, author = {Sidi, Marcel J.}, series = {Cambridge Aerospace Series}, publisher = {Cambridge University Press}, collection = {Cambridge Aerospace Series}, }

@book{ref08, doi = {10.1016/C2011-0-69685-1}, year = {2005}, place = {Amsterdam}, title = {Orbital Mechanics for Engineering Students}, author = {Curtis, Howard D.}, series = {Elsevier Butterworth Heinemann}, publisher = {Elsevier Butterworth Heinemann}, collection = {Elsevier Butterworth Heinemann}, }

@book{ref18, year = {2004}, place = {Bristol, Philadelphia}, title = {Orbital Motion}, author = {Roy, A.E.}, series = {CRC Press}, publisher = {CRC Press}, collection = {CRC Press}, }

@book{ref37, doi = {10.1007/b97612}, year = {2003}, place = {New York}, title = {The Design and Construction of Large Optical Telescopes}, author = {Bely, Pierre}, series = {Springer-Verlag}, publisher = {Springer-Verlag}, collection = {Springer-Verlag}, }

@book{ref53, year = {2009}, title = {Spacecraft Formation Flying: Dynamics, Control and Navigation}, author = {Alfriend, Kyle and Vadali, Srinivas and Gurfil, Pini and How, Jonathan and Breger, Louis}, series = {Butterworth-Heinemann}, publisher = {Butterworth-Heinemann}, collection = {Butterworth-Heinemann}, }

@book{ref56, year = {2003}, title = {Automated Rendezvous and Docking of Spacecraft}, author = {Fehse, Wigbert}, series = {Cambridge University Press}, publisher = {Cambridge University Press}, collection = {Cambridge University Press}, doi = {10.1017/CBO9780511543388}, }

I don't mind that the bibliography is in alphabetical order or anything else. My only two requirements are that the citings should be in the form A et al. (YYYY) which it is as of now and that the numbering should begin from 1.

I have tried out elsarticle-num.bst as suggested by @Mico and, although the numbering issue is solved, the citings are now in numerals and not in the above form.
I have also tried bringing the elsarticle-harv.bst file to the main directory and renaming it as MyBstFile.bst but the numbering is still from 0.

  • 1
    Welcome to TeX.SE. Just out of idle curiosity: Have you tried employing the elsarticle-num bibliography style, which provides numeric-style citation call-outs "out of the box"? – Mico Apr 07 '21 at 18:47
  • 1
    Perhaps the numbering is set to start from 0 by your thesis class? Can you provide a minimal example that replicates the behaviour on our end? – Werner Apr 07 '21 at 18:49
  • @Werner I've updated the question with the cls file. Please let me know if any other info is required. – Aaron John Sabu Apr 07 '21 at 18:54
  • @Mico thanks for the tip. I'm new to bibliography styles, so I didn't know there was something like that. I'll try that out – Aaron John Sabu Apr 07 '21 at 18:55
  • @Mico I tried that out and the numbering worked out well (starting from 1 and not 0). However, the text cites references by number and not by name. Is there any way to rectify that? – Aaron John Sabu Apr 07 '21 at 18:59
  • 1
    @AaronJohnSabu - Thanks for clarifying your formatting objectives. I had been under the erroneous impression that since you wanted to number the bibliographic entries, you also intended to create numeric-style ctation call-outs. – Mico Apr 07 '21 at 19:08
  • 1
    @Aaron John Sabu Please see my updated answer. – Simon Dispa Apr 07 '21 at 19:23
  • 1
    I'm voting to close this question as it doesn't include enough detail to replicate the problem. – Werner Apr 07 '21 at 21:15
  • @Werner I don't understand what's missing. – Aaron John Sabu Apr 07 '21 at 21:20
  • 1
    @AaronJohnSabu: The current accepted answer just points to "everything working as expected" with the information provided. And you commented that you had an outdated natbib. While using an updated version of natbib is the solution, even using natbib wasn't included in your question. So, as the question stands, it's not possible to replicate the issue. – Werner Apr 07 '21 at 21:27
  • I’m voting to close this question because it was caused by an old/modified version of a package. – Marijn Apr 08 '21 at 07:18

1 Answers1

1

I used the .bib file from the link you provided. Put the elsarticle-harv.bst in the same directory of the main file and renamed it as MyBstFile.bst.

After the several required runs, everything seems fine.

References are numbered correctly without the need to modify the style. You didn't provide a full MWE so I don't know if I'm missing something.

UPDATE

Using the class iitbthesis.cls and the same procedure

up

Cites in de document

out

\begin{filecontents}{\jobname.bib}
    @book{Labov1972,
        Address = {Philadelphia},
        Author = {William Labov},
        Publisher = {University of Pennsylvania Press},
        Title = {Sociolinguistic Patterns},
        Year = {1972}}
@book{Chomsky1957,
    Address = {The Hague},
    Author = {Noam Chomsky},
    Publisher = {Mouton},
    Title = {Syntactic Structures},
    Year = {1957}}

@article{Barker1998,
    Author = {Chris Barker},
    Journal = {Natural Language \&amp; Linguistic Theory},
    Pages = {679-717},
    Title = {Partitives, Double Genitives and Anti-Uniqueness},
    Volume = {16},
    Year = {1998}}

@book{Berwick1985,
    Address = {Cambridge, MA},
    Author = {Berwick, Robert C.},
    Publisher = {MIT Press},
    Title = {Acquisition of syntactic knowledge},
    Year = {1985}}

@phdthesis{Carlson1977,
    Author = {Carlson, Gregory N.},
    School = {University of Massachusetts, Amherst},
    Title = {Reference to Kinds in {E}nglish},
    Year = {1977}}

@book{Carlson1995,
    Address = {Chicago},
    Editor = {Carlson, Gregory N. and Pelletier, Francis Jeffrey},
    Publisher = {Chicago University Press},
    Title = {The Generic Book},
    Year = {1995}}

@article{Chierchia1998,
    Author = {Gennaro Chierchia},
    Journal = {Natural Language Semantics},
    Pages = {339-405},
    Title = {Reference to Kinds across Languages},
    Volume = {6},
    Year = {1998}}

@book{Crain1998,
    Address = {Cambridge, Massachusetts},
    Author = {Crain, Stephen and Thornton, Rosalind},
    Publisher = {The MIT Press},
    Title = {Investigations in {U}niversal {G}rammar: A Guide to Experiments on the Acquisition of Syntax and Semantics},
    Year = {1998}}

@article{Dayal2004,
    Author = {Dayal, Veneeta},
    Journal = {Linguistics and Philosophy},
    Number = {4},
    Pages = {393--450},
    Title = {Number Marking and (In)Definiteness in Kind Terms},
    Volume = {27},
    Year = {2004}}

@article{Dobrovie-Sorin1998b,
    Author = {Carmen Dobrovie-Sorin and Brenda Laca},
    Journal = {Actes de Langues et Grammaires},
    Pages = {165-179},
    Title = {La g{\'e}nericit{\'e} entre la r{\'e}f{\'e}rence {\`a} l'esp{\`e}ce et la quantification g{\'e}n{\'e}rique},
    Volume = {III},
    Year = {1998}}

\end{filecontents}

\documentclass{iitbthesis} % <<<<<<<<<<<<<<< changed from report

\usepackage{lipsum}

\usepackage{natbib} % <<<<<<<<<<<<<<< added

\usepackage{etoolbox}

\bibliographystyle{MyBstFile} % elsarticle-harv.bst renamed

%% From https://tex.stackexchange.com/questions/141003/what-should-i-change-in-a-bst-file-in-order-to-have-numbered-entries-in-the-bibl/141350#141350 % increase \bibhang to take care of the numbers (adjust at will) \setlength{\bibhang}{2pc} \makeatletter % patch @lbibitem to print the current number before the authors \patchcmd{@lbibitem} {]} {]\bbl@box{\theNAT@ctr} } {}{} % add to the aux file the information about the last number \apptocmd{\endthebibliography} {\if@filesw\write@mainaux{\string\bbl@lastnumber{\theNAT@ctr}}\fi} {}{} % allocate a length, set to a provisional value \newlength{\bbl@lastnumberwd} \setlength\bbl@lastnumberwd{0pt} % this command will be in the aux file and sets the widest label width \newcommand\bbl@lastnumber[1]{% \settowidth\dimen@{[#1]}% \global\bbl@lastnumberwd\dimen@} % a command to print the number \newcommand{\bbl@box}[1]{% \makebox[\bbl@lastnumberwd][r]{[#1]}% } \makeatother %% ***********************************************************************

\renewcommand{\bibname}{References}

\begin{document}

As \cite{Chomsky1957,Labov1972},

\citet{Chomsky1957}

\citep{Chomsky1957}

\citep[see][]{Chomsky1957}

\citet*{Chomsky1957}

\citet[chap.~2]{Chomsky1957}

\citealt{Chomsky1957}

\citealp{Chomsky1957}

\citenum{Chomsky1957}

\nocite{*}

\bibliography{\jobname}

\end{document}

Repeating the same procedure with apa.bst the output is

ap

Simon Dispa
  • 39,141
  • Hi Simon, I have updated the question. I tried bringing it to the main directory and renaming it but unfortunately it hasn't helped. – Aaron John Sabu Apr 07 '21 at 19:21
  • @Aaron John Sabu Please see my updated answer. Use a new clean directory with my example. – Simon Dispa Apr 07 '21 at 19:23
  • Ah! I figured it out. You had explicitly called natbib, so I rechecked my code. There was an outdated version of natbib that was explicitly defined as a file. I removed the file and it worked like a charm. Thanks! – Aaron John Sabu Apr 07 '21 at 20:21
  • @Aaron John Sabu Thank you for your feedback! – Simon Dispa Apr 07 '21 at 20:30