Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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} 
share|improve this question
1  
See also Removing brackets from biblatex references for lncs (mdoulo the bolding, remove \mkbibbold). –  moewe Apr 16 at 5:06

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
That worked. Thanks! –  user937840 Apr 16 at 2:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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