What exactly is the relationship Biblatex refers to as an alias of an entry type? And how should the formatting of aliased entry types be configured?
According to the biblatex
documentation, p. 126, \DeclareBibliographyAlias{alias}{type}
does the following:
If a bibliography driver covers more than one entry type, this command may be used to define an alias where
entrytype
is the name of a defined driver.
When you use \DeclareBibliographyAlias{alias}{type}
what happens internally (see biblatex2.sty
) is
\newrobustcmd*{\DeclareBibliographyAlias}[2]{%
\csedef{blx@bbx@#1}{%
\expandafter\noexpand\csname blx@bbx@#2\endcsname}}
So \blx@bbx@alias
just expands to \blx@bbx@type
. The command \blx@bbx@<type>
is used when printing bibliography lists (and friends) and "calls" the driver declared via \DeclareBibliographyDriver{type}
.
For all other purposes biblatex
still knows the actual entry type. It is just that the driver is rerouted.
The differences you noted were due to different \DeclareFieldFormat
directives. @article
gets special handling, namely
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[article,periodical]{volume}{#1}% volume of a journal
while @review
doesn't and defaults to the standard
\DeclareFieldFormat{title}{\mkbibemph{#1}}
\DeclareFieldFormat{volume}{\bibstring{volume}~#1}% volume of a book
The formatting code is spread throughout biblatex2.sty
. It mostly contains calls to \blx@getformat
, which breaks down to a switch on a host of definitions of the form abx@#2@\blx@imc@thefield{entrytype}@#4
(where here #2
is a field "id" and #4
a field name). Here we can see that the actual entry type is used for formatting.
All in all, \DeclareBibliographyAlias
really only is an alias for bibliography purposes and actually even less: only for the driver, formatting is still done with the usual (non-aliased) type.
For full aliasing, a Biber sourcemapping such as the ones defined in biblatex.def
would be more appropriate (abridged code from biblatex.def
)
\DeclareDriverSourcemap[datatype=bibtex]{
\map{
\step[typesource=conference, typetarget=inproceedings]
\step[typesource=electronic, typetarget=online]
\step[typesource=www, typetarget=online]
}
}
moewe has provided a great answer to which I append this as a mere footnote, but I thought it might be useful to add details of the way I've now configured this for the @review
type specifically.
In my biblatex.cfg
, I added the following lines to configure the format of the volume
and title
fields. volume
follows the format for @article
; title
follows that for @suppperiodical
:
\DeclareFieldFormat[review]{volume}{#1}
\DeclareFieldFormat[review]{title}{#1}
Because I also have custom configuration of the in:
macro for @article
(from here), I also adjusted this code:
% https://tex.stackexchange.com/a/10686/
\renewbibmacro{in:}{%
\ifentrytype{article}{}{%
\ifentrytype{review}{}{% apply to @review entries, too
\printtext{\bibstring{in}\intitlepunct}%
}%
}%
}
For the MWE in question (which lacks the in:
modification), this produces:
\begin{filecontents}{\jobname.bib}
@article{article,
author = {Mouse, A.},
title = {A Tall Tail},
journal = {Tales to Nibble By},
pages = {1--9},
volume = 31,
number = 4,
year = 1989,
}
@review{review,
author = {Vole, Adrian},
title = {Review of \emph{Great Grasses}, by A. N. Other-Mouse},
journal = {Tales to Nibble By},
pages = {23--4},
volume = 32,
number = 2,
year = 1990
}
\end{filecontents}
\documentclass{article}
\usepackage{biblatex}
\DeclareFieldFormat[review]{volume}{#1}
\DeclareFieldFormat[review]{title}{#1}
\bibliography{\jobname}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
I'm not sure whether this is the best way to format the titles of reviews. (I realise it depends on the style.) But neither book-type formatting nor article-type seemed quite right.