1

This question already has an answer here:

In the latex file given below, I will like to sort references in alphabetical order of the last names (of first author.) Presently, the references are cited as numbers, where the first mentioned citation is assigned number 1 in Bibliography, the second mentioned citation is assigned number 2 and so on. The picture given below shows how the ordering is presently.

enter image description here

I will like the assignment of numbers to references in Bibliography (and text in different sections) to be on the basis of alphabetical order of the last names (of first author.) In the above given example the order should be 1.> L Amendola et al., 2.> A Einstein, 3.> S Perlmutter. How can I do that?

This is my tex file.

\documentclass[a4paper,twoside]{latexclass}
\usepackage[style=numeric-comp, sorting=none, backend=bibtex, doi=false, isbn=false, natbib=true]{biblatex}
\makeatletter
\def\blx@maxline{77}
\makeatother

\newcommand*{\bibtitle}{References}

\renewcommand*{\bibfont}{\raggedright\small}

\addbibresource{ref.bib}

\providecommand\apj{The Astrophysical Journal}

\DeclareUnicodeCharacter{2009}{\,} 
\DeclareUnicodeCharacter{2212}{\,} 
\DeclareUnicodeCharacter{223C}{\,} 

\begin{document}

\section{Section}
Cite \cite{Perlmutter1999, Amendola2017, Einstein1915}

{\renewcommand*\MakeUppercase[1]{#1}%
\printbibliography[heading=bibintoc,title={\bibtitle}]}

\end{document}

Here is my cls file (latexclass.cls)

\LoadClass[openright,12pt]{report}

\newif\ifmc@nobind
\mc@nobindfalse

\DeclareOption{nobind}{\mc@nobindtrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions\relax

\ifmc@nobind

\usepackage[sort]{natbib} 

\usepackage[biblabels]{authorindex} 

\usepackage[includehead,hmargin={3.1cm, 3.1cm}, vmargin={2.5cm,2.7cm}, headsep=.8cm,footskip=1.2cm]{geometry}
\else
\usepackage[includehead,hmargin={3.6cm, 2.6cm}, vmargin={2.5cm,2.7cm}, headsep=.8cm,footskip=1.2cm]{geometry}
\fi

\usepackage{microtype}
\usepackage{nicefrac}
\usepackage{textcomp}
\usepackage{longtable} 
\usepackage[font=small,labelfont=bf]{caption} 
\usepackage{multicol,multirow,array} 
\usepackage{rotating} 
\usepackage{booktabs} 
\usepackage{pdfpages} 
\usepackage{xfrac}
\usepackage{enumitem}
\usepackage{dcolumn}
\newcolumntype{d}[3]{D{.}{\cdot}{#1} } 
\usepackage{notoccite} 
\usepackage[colorlinks=false,pdfpagelabels]{hyperref} 
\usepackage[nohints,tight]{minitoc} 
    \setcounter{minitocdepth}{2} 
\let\oldmtc@verse\mtc@verse
\renewcommand{\mtc@verse}[1]{\oldmtc@verse{#1}\setlength{\baselineskip}{\z@}}

\usepackage[nottoc]{tocbibind}

\let\@ldtoc\tableofcontents
\renewcommand*\tableofcontents{{%
\renewcommand*\MakeUppercase[1]{##1}\@ldtoc}}
\let\@ldlof\listoffigures
\renewcommand*\listoffigures{{%
\renewcommand*\MakeUppercase[1]{##1}\@ldlof}}
\let\@ldlot\listoftables
\renewcommand*\listoftables{{%
\renewcommand*\MakeUppercase[1]{##1}\@ldlot}}
\let\@ldbib\bibliography
\renewcommand*\bibliography[1]{{%
\renewcommand*\MakeUppercase[1]{##1}\@ldbib{#1}}}

\usepackage{lmodern}
\usepackage[LGR,TS1,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek,latin,english]{babel}
\usepackage{csquotes}
\hyphenpenalty=500
\def\longs{{\fontencoding{TS1}\selectfont s}}

\colorlet{shadecolor}{blue!20}

And here is my bib file (ref.bib)

@ARTICLE{Amendola2017,
   author = {{Amendola}, L. and {Kunz}, M. and {Saltas}, I.~D. and {Sawicki}, I.},
title = "{The fate of large-scale structure in modified gravity after GW170817 and GRB170817A}",
  journal = {ArXiv e-prints},
 archivePrefix = "arXiv",
  eprint = {1711.04825},
 keywords = {Astrophysics - Cosmology and Nongalactic Astrophysics, General Relativity and Quantum Cosmology, High Energy Physics - Theory},
   year = 2017,
   month = nov,
   adsurl = {http://adsabs.harvard.edu/abs/2017arXiv171104825A},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}


@article{Einstein1915,
 title = "The Field Equations of Gravitation",
journal = "Preussische Akademie der Wissenschaften, Sitzungsberichte",
volume = "844",
number = "7",
pages = "117 - 137",
year = "1915",
url = "http://einsteinpapers.press.princeton.edu/vol6-trans/129",
author = "A. Einstein"
 }

@ARTICLE{Perlmutter1999,
   author = {{Perlmutter}, S. and {Aldering}, G. and {Goldhaber}, G. and 
{Knop}, R.~A. and {Nugent}, P. and {Castro}, P.~G. and {Deustua}, S. and 
{Fabbro}, S. and {Goobar}, A. and {Groom}, D.~E. and {Hook}, I.~M. and 
{Kim}, A.~G. and {Kim}, M.~Y. and {Lee}, J.~C. and {Nunes}, N.~J. and 
{Pain}, R. and {Pennypacker}, C.~R. and {Quimby}, R. and {Lidman}, C. and 
{Ellis}, R.~S. and {Irwin}, M. and {McMahon}, R.~G. and {Ruiz-Lapuente}, P. and 
{Walton}, N. and {Schaefer}, B. and {Boyle}, B.~J. and {Filippenko}, A.~V. and 
{Matheson}, T. and {Fruchter}, A.~S. and {Panagia}, N. and {Newberg}, H.~J.~M. and 
{Couch}, W.~J. and {Project}, T.~S.~C.},
    title = "{Measurements of {$\Omega$} and {$\Lambda$} from 42 High-Redshift Supernovae}",
    journal = {\apj},
   eprint = {astro-ph/9812133},
 keywords = {COSMOLOGY: OBSERVATIONS, COSMOLOGY: DISTANCE SCALE, STARS: SUPERNOVAE: GENERAL, Cosmology: Observations, Cosmology: Distance Scale, Stars: Supernovae: General},
    year = 1999,
    month = jun,
   volume = 517,
    pages = {565-586},
     doi = {10.1086/307221},
  adsurl = {http://adsabs.harvard.edu/abs/1999ApJ...517..565P},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

marked as duplicate by Mico bibliographies Dec 31 '18 at 23:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Welcome to TeX.SE! – Kurt Dec 31 '18 at 23:25
  • 1
    @Kurt Thanks. A very Happy New Year to you. – user10853036 Dec 31 '18 at 23:31
4

You've set biblatex with option sorting=none. That will give you references sorted by citation order. If you want them sorted by alphabetical order of the first author, you should use nyt (name, year, title) or nty (name, title, year). But, as nyt is already the default, you just need to omit sorting=none from your biblatex's options.

\documentclass[a4paper,twoside]{report}
\usepackage[style=numeric-comp, backend=bibtex, doi=false, isbn=false, natbib=true]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@ARTICLE{Amendola2017,
  author = {{Amendola}, L. and {Kunz}, M. and {Saltas}, I.~D. and {Sawicki}, I.},
  title = "{The fate of large-scale structure in modified gravity after GW170817 and GRB170817A}",
  journal = {ArXiv e-prints},
  archivePrefix = "arXiv",
  eprint = {1711.04825},
  keywords = {Astrophysics - Cosmology and Nongalactic Astrophysics, General Relativity and Quantum Cosmology, High Energy Physics - Theory},
  year = 2017,
  month = nov,
  adsurl = {http://adsabs.harvard.edu/abs/2017arXiv171104825A},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}


@article{Einstein1915,
  title = "The Field Equations of Gravitation",
  journal = "Preussische Akademie der Wissenschaften, Sitzungsberichte",
  volume = "844",
  number = "7",
  pages = "117 - 137",
  year = "1915",
  url = "http://einsteinpapers.press.princeton.edu/vol6-trans/129",
  author = "A. Einstein"
 }

@ARTICLE{Perlmutter1999,
  author = {{Perlmutter}, S. and {Aldering}, G. and {Goldhaber}, G. and
{Knop}, R.~A. and {Nugent}, P. and {Castro}, P.~G. and {Deustua}, S. and
{Fabbro}, S. and {Goobar}, A. and {Groom}, D.~E. and {Hook}, I.~M. and
{Kim}, A.~G. and {Kim}, M.~Y. and {Lee}, J.~C. and {Nunes}, N.~J. and
{Pain}, R. and {Pennypacker}, C.~R. and {Quimby}, R. and {Lidman}, C. and
{Ellis}, R.~S. and {Irwin}, M. and {McMahon}, R.~G. and {Ruiz-Lapuente}, P. and
{Walton}, N. and {Schaefer}, B. and {Boyle}, B.~J. and {Filippenko}, A.~V. and
{Matheson}, T. and {Fruchter}, A.~S. and {Panagia}, N. and {Newberg}, H.~J.~M. and
{Couch}, W.~J. and {Project}, T.~S.~C.},
  title = "{Measurements of {$\Omega$} and {$\Lambda$} from 42 High-Redshift Supernovae}",
  journal = {The Astrophysical Journal},
  eprint = {astro-ph/9812133},
  keywords = {COSMOLOGY: OBSERVATIONS, COSMOLOGY: DISTANCE SCALE, STARS: SUPERNOVAE: GENERAL, Cosmology: Observations, Cosmology: Distance Scale, Stars: Supernovae: General},
  year = 1999,
  month = jun,
  volume = 517,
  pages = {565-586},
  doi = {10.1086/307221},
  adsurl = {http://adsabs.harvard.edu/abs/1999ApJ...517..565P},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\newcommand*{\bibtitle}{References}

\begin{document}

\section{Section}
Cite \cite{Perlmutter1999, Amendola2017, Einstein1915}

\printbibliography[heading=bibintoc,title={\bibtitle}]

\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.