BibTeX, biblatex and biberBiblatex et al

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 et al

Post by Ross Ahmed »

I need to cite publications that have >2 authors using et al. I'm using biblatex.

My text is appearing as follows: 'some text (Anderson 1999) and more text (Armenta & Whittingham 2008)'

However I need my text to appear as follows: 'some text (Anderson 1999) and more text (Armenta et al. 2008)'.

My bib file is as follows:

Code: Select all

@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., 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}
}

My .tex file is 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=none, maxcitenames=2]{biblatex}

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

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

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





\addbibresource{test.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{#1}}


\begin{document}

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

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

\printbibliography

\end{document}
Last edited by Ross Ahmed on Thu Jan 24, 2013 8:48 pm, edited 2 times in total.

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Biblatex et al

Post by localghost »

And where exactly is the problem description? What do you get instead of the expected result?

Perhaps you should replace \& in the author field of your second database entry by \and to get it working.

And it can't do any harm to give some feedback to proposals on your other question.


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

Biblatex et al

Post by Ross Ahmed »

localghost wrote:And where exactly is the problem description? What do you get instead of the expected result?

Perhaps you should replace \& in the author field of your second database entry by \and to get it working.

And it can't do any harm to give some feedback to proposals on your other question.


Thorsten
Post now edited. I've replaced the \& in my .bib file and the same problem still occurs.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Biblatex et al

Post by localghost »

Ross Ahmed wrote:[…] I've replaced the \& in my .bib file and the same problem still occurs.
Did I tell you to replace \& with "and" (word) or with \and (command)?
Ross Ahmed
Posts: 15
Joined: Mon Dec 17, 2012 8:56 pm

Biblatex et al

Post by Ross Ahmed »

localghost wrote:
Ross Ahmed wrote:[…] I've replaced the \& in my .bib file and the same problem still occurs.
Did I tell you to replace \& with "and" (word) or with \and (command)? m(
Unfortunately, even with '\and', the problem is still occurring. I've updated the opening post to show what .bib file currently looks like.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Biblatex et al

Post by cgnieder »

If I use the code you posted in your original post and run it with an up to date TeX Live, i.e. biblatex and biber v1.5, I get the following biber warning:
WARN - Name "Armenta, J.K., Dunn, P.O. \and Whittingham, L.A." has too many commas: skipping name
and the reference you want to change isn't recognized at all in the running text.

Indeed every name should be separated with »and« (without backslash). Changing the offending line into

Code: Select all

author = {Armenta, J.K. and Dunn, P.O. and Whittingham, L.A.},
biber runs without a warning and I get
biblatex.png
biblatex.png (32.94 KiB) Viewed 12371 times
(the file still doesn't run without errors but I didn't investigate them).

Regards
site moderator & package author
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Biblatex et al

Post by localghost »

cgnieder wrote:[…] Indeed every name should be separated with »and« (without backslash). Changing the offending line into

Code: Select all

author = {Armenta, J.K. and Dunn, P.O. and Whittingham, L.A.},
[…]
Argh! My mistake. I messed that up with the \author command for \maketitle and the separation of author names.
Ross Ahmed
Posts: 15
Joined: Mon Dec 17, 2012 8:56 pm

Re: Biblatex et al

Post by Ross Ahmed »

Many thanks for your help. Problem addressed in this thread solved. There are other problem with my code, and having read board rules, I have started a different thread.
Post Reply