I have a .bib file containing about 100+ publications references. I want to generate the pdf file with all the references in descending order of publication year, just as it appears in journals?
Is this possible to do?
biblatexbibliographiescross-referencing
I have a .bib file containing about 100+ publications references. I want to generate the pdf file with all the references in descending order of publication year, just as it appears in journals?
Is this possible to do?
Instead of fighting with the sorting procedures there is---in my opinion---an easier way.
You can use a bibliography style which does not sort the entries in the bib files, for example style unsortdin
.
Then you can write your bib files and sort the entries by your own: the first paper is the lowest, the next paper you write above etc. Same for Theses or other works.
For example see this changed bib file of you:
@ARTICLE{xxd3,
author = {A and B and C},
title = {Article title April 2014},
journal = {Journal name},
year = {2014},
volume = {3},
pages = {1-5},
number = {2},
month = {April}
}
@ARTICLE{xxd2,
author = {A and B and C},
title = {Article title October 2013},
journal = {Journal name 2},
year = {2013},
volume = {1},
pages = {1-10},
number = {1},
month = {October}
}
@ARTICLE{xxd1,
author = {A and B and C and D},
title = {Article title March 2013},
journal = {Journal name 3},
year = {2013},
volume = {2},
pages = {2-5},
number = {2},
month = {March}
}
I added by using package filecontents
both changed bib files into the following MWE.
At last this sorting in the BiB files is mutch more easier than to write an own .bst
file or change an existing one.
No you have only to change the BiB style in the MWE to unsortdin
to get the result you want (See marks <=======
in the MWE).
MWE:
\RequirePackage{filecontents}
\begin{filecontents*}{209082-journal.bib}
@ARTICLE{xxd3,
author = {A and B and C},
title = {Article title April 2014},
journal = {Journal name},
year = {2014},
volume = {3},
pages = {1-5},
number = {2},
month = {April}
}
@ARTICLE{xxd2,
author = {A and B and C},
title = {Article title October 2013},
journal = {Journal name 2},
year = {2013},
volume = {1},
pages = {1-10},
number = {1},
month = {October}
}
@ARTICLE{xxd1,
author = {A and B and C and D},
title = {Article title March 2013},
journal = {Journal name 3},
year = {2013},
volume = {2},
pages = {2-5},
number = {2},
month = {March}
}
\end{filecontents*}
\begin{filecontents*}{209082-conf.bib}
@INPROCEEDINGS{xxdc3,
author = {LastnameC, firstnameC},
title = {Title (2012)},
booktitle = {Conference 1},
year = {2012},
pages = {1-5}
}
@INPROCEEDINGS{xxdc2,
author = {LastnameB, firstnameB},
title = {Title (2011)},
booktitle = {Conference 3},
year = {2011},
pages = {30-35}
}
@INPROCEEDINGS{xxdc1,
author = {LastnameA, firstnameA},
title = {Title (2010)},
booktitle = {Conference 2},
year = {2010},
pages = {9-10}
}
\end{filecontents*}
\documentclass[10pt,legalpaper,roman]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{red}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[scale=0.75]{geometry}
\name{John}{Doe}
\title{Resum\'{e}}
\makeatletter
\renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]}
\makeatother
\usepackage{multibib}
\newcites{jrnl}{Journal papers} % ================ needs bibtex jrnl.aux
\begin{document}
\makecvtitle
\section{Selected publications}
\nocitejrnl{*}
\bibliographystylejrnl{unsrtdin}% plainyrrev <==========================
\bibliographyjrnl{209082-journal}
\renewcommand{\refname}{Conference papers}
\nocite{*}
\bibliographystyle{unsrtdin}% plainyrrev <==============================
\bibliography{209082-conf}
\end{document}
and the result:
It's not TeX, but I use this python 3 code to do something like this:
from isbnlib import meta
from isbnlib.registry import bibformatters
import sys
import urllib.request
from urllib.error import HTTPError
import time
### PARA DOI
#BASE_URL = 'http://dx.doi.org/'
BASE_URL = 'https://www.doi.org/'
ListaDOI = ['10.1119/1.5124814',
'10.1103/PhysRevB.100.245121',
'10.1103/PhysRevB.100.224507',
'10.1103/PhysRevE.100.052303',
'10.1103/PhysRevFluids.4.124002',
'10.1103/PhysRevD.100.126011',
'10.1103/PhysRevA.100.052322']
### PARA ISBN
SERVICE = 'openl'
getInfoISBN = bibformatters['bibtex']
ListaISBN = []
#timestamp=time.strftime("%d-%m-%Y-%H%M%S")
timestamp=time.strftime("%d-%m-%Y-%H")
filename='bibliography-'+timestamp+'.txt'
g=open(filename,'a')
for doi in ListaDOI:
url = BASE_URL + doi
req = urllib.request.Request(url)
req.add_header('Accept', 'application/x-bibtex')
time.sleep(2)
try:
with urllib.request.urlopen(req) as f:
bibtexDOI = f.read().decode()
print(bibtexDOI)
g.write('\n' + bibtexDOI + '\n\n')
except HTTPError as e:
if e.code == 404:
print('\n DOI {} nao encontrado. DOI not found.\n'.format(doi))
g.write('DOI: {}'.format(doi)+' não encontrado. Not found.\n\n')
else:
print('Serviço indisponível. Service unavailable.')
sys.exit(1)
for isbn in ListaISBN:
try:
bibtexISBN = getInfoISBN(meta(isbn, SERVICE))
print(bibtexISBN)
g.write('\n' + bibtexISBN + '\n\n')
except:
print('\n ISBN {} nao encontrado. ISBN not found.\n'.format(isbn))
g.write('ISBN: {}'.format(isbn)+' não encontrado. Not found.\n\n')
g.close()
It uses the site http://dx.doi.org/ to get the information. So, you list the doi number in 'ListaDOI' (how many you need) and just run with your python. It will show the bib entry and save it into a 'bibliography.txt'.
Edit: added isbn search. It uses a specific python lib, the isbnlib. The same way you put isbn into 'ListaISBN', like in 'ListaDOI'.
Best Answer
With
biblatex
this is easily possible. You basically only need two ingredients.sorting=ydnt
in thebiblatex
package options will sort your bibliography descending by year of publication. Moresorting
options are at Biblatex citation order. For a more fine-grained sorting see biblatex sorting by date.\nocite{*}
in your document will just add all entries in your.bib
file to the bibliography without them having to be cited explicitly. See Using BibTeX to make a list of references without having citations in the body of the document?.Now
produces a six-page document containing all works in
biblatex-examples.bib
in reverse chronological order.For example parts of page 2 of the resulting PDF read
The style
biblatex-publist
is a dedicated style for lists of publications