6

I wonder how to change the way that references are listed so that it is of the format 1. rather than [1]? I give a slightly complicated example where I am also reversing the numbers and adding a prefix. So, I want [J1] to appear instead as J1.

The example below produces...

[J2] John C. Doe and Jane Smith. “The article”. In: Journal (Sept. 10, 2013).

[J1] Shelly Jones. “Another article”. In: Another Journal (Aug. 14, 2013).

But I want it to be...

J2. John C. Doe and Jane Smith. “The article”. In: Journal (Sept. 10, 2013).

J1. Shelly Jones. “Another article”. In: Another Journal (Aug. 14, 2013).

\documentclass{article}
\begin{filecontents}{\jobname.bib}
  @article{B,
    author = {Shelly Jones},
    title = {Another article},
    journal = {Another Journal},
    date = {2013-08-14},
  }
  @article{C,
    author = {John C. Doe and Jane Smith},
    title = {The article},
    journal = {Journal},
    date = {2013-09-10},
  }
\end{filecontents}
\usepackage[style=numeric,sorting=nyt,backend=biber]{biblatex}

% Count total number of entries in each refsection
\AtDataInput{%
  \csnumgdef{entrycount:\therefsection}{%
    \csuse{entrycount:\therefsection}+1}}

% Print the labelnumber as the total number of entries in the
% current refsection, minus the actual labelnumber, plus one
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}    
\newrobustcmd*{\mkbibdesc}[1]{%
  \number\numexpr\csuse{entrycount:\therefsection}+1-#1\relax}


\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography[sorting=nyt,title={Bibliography},prefixnumbers={J}]
\end{document} 
1

1 Answer 1

5

I think you can just change the field format as follows:

\documentclass{article}
\begin{filecontents}{\jobname.bib}
  @article{B,
    author = {Shelly Jones},
    title = {Another article},
    journal = {Another Journal},
    date = {2013-08-14},
  }
  @article{C,
    author = {John C. Doe and Jane Smith},
    title = {The article},
    journal = {Journal},
    date = {2013-09-10},
  }
\end{filecontents}
\usepackage[style=numeric,sorting=nyt,backend=biber]{biblatex}

% Count total number of entries in each refsection
\AtDataInput{%
  \csnumgdef{entrycount:\therefsection}{%
    \csuse{entrycount:\therefsection}+1}}

% Print the labelnumber as the total number of entries in the
% current refsection, minus the actual labelnumber, plus one
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\newrobustcmd*{\mkbibdesc}[1]{%
  \number\numexpr\csuse{entrycount:\therefsection}+1-#1\relax}

\DeclareFieldFormat{labelnumberwidth}{#1.}

\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography[sorting=nyt,title={Bibliography},prefixnumbers={J}]
\end{document}

Numeric labels with a difference

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .