BibTeX, biblatex and biberbiblatex | Issues with Bibliography Formatting

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
Ross Ahmed
Posts: 15
Joined: Mon Dec 17, 2012 8:56 pm

biblatex | Issues with Bibliography Formatting

Post by Ross Ahmed »

More problems have arisen with biblatex. Using the attached .bib file and .tex file, the bibliography is currently printing as in attached screenshot.

I'm aiming for following bibliography:
Andersson, S. 1999. Morphology....
Armenta, J.K., Dunn, P.O. & Whittingham, L.A. 2008. Effects.....

So three things need fixing in bibliography
  1. remove space between initials
  2. delimit first and second authors with ','
  3. delimit second and last author with '&'
.tex file as follows:

Code: Select all

\documentclass{article}
\usepackage[
  firstinits   = true ,
  style        = authoryear ,
  natbib       = true ,
  doi          = false ,
  isbn         = false ,
  url          = false ,
  uniquename   = false ,
  uniquelist   = false ,
  sorting      = nyt ,
  maxcitenames = 2
]{biblatex}

% remove comma inline citations
\renewcommand*{\nameyeardelim}{\addspace}

% delimits authors inline citations with &
\renewcommand*{\finalnamedelim}{\addspace\&\space}

% seperate multi authors by comma
\renewcommand*{\multicitedelim}{\addcomma\space}

% keep the example self-contained and let it create the bib file on the fly:
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{AnderssonS1999,
  author = {Andersson, S.},
  title = {Morphology of UV reflectance in a whistling-thrush: implications
for the study of structural colour signalling in birds},
  journal = {Journal of Avian Biology},
  year = {1999},
  volume = {30:},
  pages = {193-204}
}
@ARTICLE{armenta2008,
  author = {Armenta, J. K. and Dunn, P. O. and Whittingham, L. A.},
  title = {{Effects of specimen age on plumage color}},
  journal = {The Auk},
  year = {2008},
  volume = {125:},
  pages = {803--808},
  file = {:Users/rossahmed/Library/Application Support/Mendeley Desktop/Downloaded/Armenta, Dunn, Whittin\textit{g\textit{}}ham - 2008 - Effects of specimen age on plumage color.pdf:pdf},
  publisher = {BioOne},
  url = {http://www.bioone.org/doi/abs/10.1525/auk.2008.07006}
}
\end{filecontents}

\addbibresource{\jobname.bib}
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{#1\isdot}

\renewbibmacro{in:}{%
  \ifentrytype{article}{}{%
  \printtext{\bibstring{in}\intitlepunct}}}
 
\makeatletter
\ifcsundef{abx@macro@\detokenize{date+extrayear}}{%
  }{%
    \renewbibmacro*{date+extrayear}{%
    \iffieldundef{year}{%
      }{%
        \addperiod\space
         \printtext{\printdateextra}%
      }%
    }%
  }
\makeatother

\DeclareFieldFormat[article]{pages}{#1}
\DeclareNameFormat[article,periodical,book,electronic]{author}{%
  \mkbibbold{#5\addspace#1\addcomma\addspace#4}}


\begin{document}

\title{test}
\author{test}
\date{}
\maketitle

some text \parencite{AnderssonS1999} and more text \parencite{armenta2008}

\printbibliography

\end{document}
Attachments
Screen Shot 2013-01-26 at 19.20.18.jpg
Screen Shot 2013-01-26 at 19.20.18.jpg (21.87 KiB) Viewed 3379 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ross Ahmed
Posts: 15
Joined: Mon Dec 17, 2012 8:56 pm

biblatex | Issues with Bibliography Formatting

Post by Ross Ahmed »

I've got as far as working out that this code is stopping the final author being delimited with '&'. If block of code below is removed, the final authors in bibliography become delimited with '&':

Code: Select all

\DeclareFieldFormat[article]{pages}{#1}
\DeclareNameFormat[article,periodical,book,electronic]{author}{%
  \mkbibbold{#5\addspace#1\addcomma\addspace#4}}
How can I get the final authors delimited with '&', but also the above code block to work?
Post Reply