Tell me more ×
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.

For LaTeX citations, I use biblatex/babel. The journal for which I'm writing requires a bibliography with authors formatted as follows:

Guyton AC, Hall JE.

That is, with no "and" before the last author. I did manage this (see example below), however, in \textcite, "and" is also gone now...

Questions

  1. Is it possible to remove "and" in the bibliography, but leave it in \textcite.
  2. Previously, I used \textcite together with the authoryear style. Using a solution also posted on this website, I was able to put multiple sources in one \textcite, and biblatex would place commas and an "and" at the appropriate places. Is it possible to adapt this solution for numeric citation styles?
  3. Is there a way to make all authors (and the commas in between them) bold in the bibliography?
\documentclass[a4paper]{article}
\usepackage[american]{babel}
\usepackage[
  terseinits=true,
  firstinits=true,
  backend=biber,
  style=numeric
]{biblatex}

%Put initials after names...
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}    

%Remove "and" before last name. However, this also removes "and" in a textcite...
\renewcommand*{\finalnamedelim}{\addcomma\space}

%I also removed the commas between last names and initials (http://tex.stackexchange.com/questions/17583/biblatex-remove-commas-between-last-and-first-names-in-bibliography). This is however not needed for a minimum working example.

%Generate a test bibliography
\usepackage{filecontents}
\begin{filecontents*}{database.bib}
@BOOK{Guyton2006,
  title = {Textbook of Medical Physiology},
  publisher = {W.B. Saunders},
  year = {2006},
  author = {Arthur C. Guyton and John E. Hall},
  address = {Philadelphia, Pennsylvania},
  edition = {11th Edition}
}
\end{filecontents*}

\bibliography{database.bib}

%Some biber compatibility things (from http://tex.stackexchange.com/questions/21711/setting-up-winedt-6-0-and-miktex-to-run-biblatex-and-biber)...
\makeatletter
    \providecommand\bibstyle@faked{}
    \providecommand\bibdata@faked{}
    \AtBeginDocument{%
    \immediate\write\@mainaux{\noexpand\bibstyle@faked}%
    \immediate\write\@mainaux{\noexpand\bibdata@faked}}
\makeatother

\begin{document}
The following sentence contains a textcite example. \textcite{Guyton2006} wrote a comprehensive textbook.
\printbibliography
\end{document}
share|improve this question

3 Answers

up vote 3 down vote accepted

Ad question 1: Simply use

\AtBeginBibliography{%
  \renewcommand*{\finalnamedelim}{\addcomma\space}%
}
share|improve this answer
+1 This is better. The only reason for bringing a test into \finalnamedelim I can think of now is to handle full citations. I guess I'll make an edit to address that. – Audrey Jan 19 '12 at 3:47

Question 1 can be resolved by using the \ifcurrentname test in a redefinition of \finalnamedelim.

A solution for question 3 could be restricted to the name list at the beginning of each bibliography entry. This name list depends on the availability of author, editor and translator as well as the entry type. In the code below I've taken a lazy way out using egreg's patch commands and a flag to indicate when any given name list should be set in boldface.

Question 2 might be better addressed in another post, especially if you want a solution that will work for any standard numeric style.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=numeric,terseinits=true,firstinits=true]{biblatex}
\usepackage{hyperref}

% Define egreg's patch commands
% (or just use \xpatchbibmacro et al. with xpatch package)
\makeatletter
\def\act@on@bibmacro#1#2{%
  \expandafter#1\csname abx@macro@\detokenize{#2}\endcsname}
\def\patchbibmacro{\act@on@bibmacro\patchcmd}
\def\pretobibmacro{\act@on@bibmacro\pretocmd}
\def\apptobibmacro{\act@on@bibmacro\apptocmd}
\def\showbibmacro{\act@on@bibmacro\show}
\makeatother

% Omit commas in name:last-first bibmacro
\patchbibmacro{name:last-first}
  {\ifblank{#2}{}{\addcomma\bibnamedelimd\mkbibnamefirst{#2}\isdot}}{}{}{}
\patchbibmacro{name:last-first}{\ifblank{#2#3}{}{\addcomma}}{}{}{}

% Set first name list in boldface
\newtoggle{bbx:bold}
\AtEveryBibitem{\toggletrue{bbx:bold}}
\pretobibmacro{name:last-first}{\iftoggle{bbx:bold}{\bfseries}{}}{}{}
\apptobibmacro{name:last-first}
  {\ifnumequal{\value{listcount}}{\value{liststop}}
     {\global\togglefalse{bbx:bold}}
     {}}
  {}{}

\DeclareNameAlias{default}{last-first}
\DeclareNameAlias{sortname}{last-first}

% Omit "and" from \finalnamedelim in full citations and bibliography entries
\renewcommand*{\finalnamedelim}{%
  \ifcurrentname{labelname}
    {\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
     \addspace\bibstring{and}\space}
    {\addcomma\space}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\null\vfill\noindent
Filler text.\footfullcite{companion}
\textcite{companion,coleridge,gaonkar} show that...
\textcites{companion}[10--15]{coleridge} show that...
\citeauthor{companion} show that...
\printbibliography
\end{document}

enter image description here

share|improve this answer

Add this to your preamble:

% delimiter switching for cite and textcite
\let\olddelim\finalnamedelim
\let\oldtextcite\textcite

\newcommand{\switchdelim}[1]{\renewcommand*{\finalnamedelim}{#1}}

% set up the default
\switchdelim{\addcomma\space}

% wrap the textcite command to reversibly switch the delimiter
\renewcommand{\textcite}[1]{%
{%
\renewcommand{\textbf}{}% suppress bold faced names in the running text
\switchdelim{\olddelim}%
\oldtextcite{#1}%
\switchdelim{\addcomma\space}%
}%
}

% format the author names
\renewcommand{\mkbibnamelast}{\textbf}
\renewcommand{\mkbibnamefirst}{\textbf}
\renewcommand{\mkbibnameprefix}{\textbf}
\renewcommand{\mkbibnameaffix}{\textbf}

% sneak a textbf into the definition of addcomma. This may be
% too much of a low-level hack, I hope there is a cleaner 
% way for doing this, but it seems to work.  
\makeatletter 
\protected\def\blx@imc@addcomma{\textbf{\blx@addpunct{comma}}}
\makeatother

That gives:

enter image description here

share|improve this answer
1  
There are a few issues with this solution. The redefinition of \textcite doesn't support pre- and postnotes or citation lists. The change to \addcomma sets the punctuation in boldface everywhere, not just in the name list. – Audrey Jan 18 '12 at 19:49
@Audrey - I was actually expecting that the \addcomma hack would affect all commas in the bibliography, but at least in this example it actually doesn't. However, I agree that your solution is preferable, since it avoids questionable hacks. – Michael Palmer Jan 18 '12 at 22:50
I think the comma before the year is bold. Bold commas would also appear in citations. In any case I'd rather see the commas left as-is. Given that, your solution to Q3 is preferable. – Audrey Jan 19 '12 at 3:44

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.