Anyone know if the @techreport
type will pick up the volumes
field in Biblatex so that one can indicate the number of volumes of a technical report?
[Tex/LaTex] Biblatex use of Volumes field with Techreport
biblatex
Related Solutions
tl;dr: A universal solution is very nearly impossible, biblatex
offers the bookpagination
(and pagination
field) and a well-coded style will make use of those, so bookpagination = {none}
seems a good way to go for biblatex
.
The Long Answer
A solution that works for both natbib
and biblatex
is almost impossible (one might say all but impossible) for the simple reason that it is not natbib
or biblatex
that decides what is printed and how the bibliography looks like, but the bibliography style (\bibliographystyle
in "BibTeX packages"for lack of a better name [the .bst
styles]; style
, bibstyle
with biblatex
[the .bbx
styles]); so a universal solution would have to work with all the styles (.bst
as well as .bbx
) available today - that is quite a lot of styles.
While most of the styles adhere to a general semantics and best practice, we cannot be sure that all styles will display, say, the pages
field in a certain way (well, we can be quite sure with the pages
field as it is so essential and standard, but the eid
field is a different matter altogether).
Most of the "exotic" fields such as eid
, eprint
etc. are bound to be unsupported by a number of styles - even the more basic (and arguably quite un-exotic - by modern standards at least) URL field is lacking in some styles, simply because they were completed before the advent of the URI, which was standardised in 1994 (RFC1738), case in point: ieeetr.bst
seems to have been the same since 1988 (save for a clarification of the licence).
Having said all that, the pages
field is probably your best bet for a widely applicable solution, plus it does not seem to be too far off semantically.
But even the treatment of the pages
field is not standardised or normalised across bibliography styles: Some .bst
styles check whether the pages
field contains multiple pages in order to decided whether to print "p." or "pp." (plain.bst
and ieeetr.bst
), but there is no need to do that in a German style since in both cases the abbreviation will be "S.", consequently natdin.bst
does not care to check for "multiple pages", it behaves differently if a URL is present, though.
biblatex
offers a lot of these functionalities out of the box, so almost all styles make use of them (that is also thanks to the fact that a lot of the biblatex
styles out there are coded quite well), I have yet to come across a style that tries to implement these checks itself.
biblatex
will check if the pages
field actually contains a "page range", page ranges consist of characters recognised as numbers (see \DeclareNumChars
) and those recognised as range separators/indicators (see \DeclareRangeChars
) as well as certain other commands (see \DeclareRangeCommands
and \DeclarePageCommands
). If the pages
field contains only characters and commands declared there, it passes the \ifpages
test. If a pages
field passes the \ifpages
test and it is printed with \mkpageprefix
, the page prefix "p."/"pp." will be added if it does not, the pages
field is printed as is without a prefix. In fact, we can control the prefix added to the pages
field as described in ยง2.3.10 Pagination, p. 35, of the biblatex
documentation, we can even define our own prefix (as shown in Citing specific slides of a presentation).
The "pagination scheme" is even settable on a per-entry basis with pagination
(controls how in-text citations have the postnote
formatted if it passes \ifpages
) and bookpagination
(controls the pages
and pagetotal
fields).
So what you could do for these special pages
fields is to add bookpagination = {none}
to the corresponding entry (or hope for a character that throws \ifpages
to false, the e
in the PLoS entries does exactly that).
An example with bookpagination = {none}
:
@article{Clune22032013,
author = {Clune, Jeff and Mouret, Jean-Baptiste and Lipson, Hod},
title = {The Evolutionary Origins of Modularity},
volume = {280},
number = {1755},
pages = {20122863},
bookpagination = {none},
date = {2013},
doi = {10.1098/rspb.2012.2863},
eprint = {http://rspb.royalsocietypublishing.org/content/280/1755/20122863.full.pdf+html},
journal = {Proceedings of the Royal Society B: Biological Sciences}
}
The MWE
\documentclass{article}
\usepackage[style=authoryear, backend=biber]{biblatex}
\usepackage{filecontents}
\usepackage{hyperref}
\begin{filecontents*}{\jobname.bib}
@article{Clune22032013,
author = {Clune, Jeff and Mouret, Jean-Baptiste and Lipson, Hod},
title = {The Evolutionary Origins of Modularity},
volume = {280},
number = {1755},
pages = {20122863},
bookpagination = {none},
date = {2013},
doi = {10.1098/rspb.2012.2863},
eprint = {http://rspb.royalsocietypublishing.org/content/280/1755/20122863.full.pdf+html},
journal = {Proceedings of the Royal Society B: Biological Sciences}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\cite[3]{Clune22032013}
\printbibliography
\end{document}
yields, note that for in-text references the pages prefix is enabled (and the default page
one), while the prefix for the journal pages is disabled.
I would argue that a "last modified" field for websites is not really necessary. The date
field will contain this information. If you cite a book you always use the year of your print version for the year
field, not the year of some other edition (be it the first or just one you like, if you insist on giving information like this there is origdate
).
You can add information like "last modified" in the note
or addendum
fields, which are designed to hold miscellaneous information.
There is also the urldate
for last visited (which is not exactly what you seem to want, but deserves a mention anyway).
But who am I to deny you the joy of having a lastmodifieddate
field. It won't come for free though. We will follow the more complex example in How can I create entirely new data types with BibLaTeX/Biber?.
We will need a new data model for this.
Save the following in a file called lastmod.dbx
(in the MWE below this file is automatically created via filecontents
).
\DeclareDatamodelFields[type=field, datatype=datepart]{
lastmodifiedyear,
lastmodifiedmonth,
lastmodifiedday,
lastmodifiedhour,
lastmodifiedminute,
lastmodifiedsecond,
lastmodifiedtimezone,
lastmodifiedseason,
}
\DeclareDatamodelFields[type=field, datatype=date, skipout]{
lastmodifieddate}
\DeclareDatamodelEntryfields{
lastmodifieddate}
Note that we will later load biblatex
with the option datamodel=lastmod
.
Now Biber knows lastmodifieddate
.
We can even have localisation features (save this in english-lastmod.lbx
)
\ProvidesFile{english-lastmod.lbx}[2015/05/10 english with edditions for last modified]
\InheritBibliographyExtras{english}
\NewBibliographyString{lastmodified}
\DeclareBibliographyStrings{%
inherit = {english},
lastmodified = {{last modified}{last mod\adddot}},
}
Finally, we enable printing the new date via
\DeclareFieldFormat{lastmodifieddate}{\bibstring{lastmodified}\space#1}
\newbibmacro*{lastmodifieddate}{\printlastmodifieddate}
\renewbibmacro*{url+urldate}{%
\usebibmacro{url}%
\iffieldundef{lastmodifiedyear}
{}
{\setunit*{\addcomma\space}%
\usebibmacro{lastmodifieddate}}
\iffieldundef{urlyear}
{}
{\setunit*{\addspace}%
\usebibmacro{urldate}}}
The MWE
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@online{webs,
author = {Anne Uthor},
title = {A Website from the Future},
url = {https://example.com},
urldate = {2014-12-12},
lastmodifieddate = {2015-06-06},
}
\end{filecontents*}
\begin{filecontents}{lastmod.dbx}
\DeclareDatamodelFields[type=field, datatype=datepart]{
lastmodifiedyear,
lastmodifiedmonth,
lastmodifiedday,
lastmodifiedhour,
lastmodifiedminute,
lastmodifiedsecond,
lastmodifiedtimezone,
lastmodifiedseason,
}
\DeclareDatamodelFields[type=field, datatype=date, skipout]{
lastmodifieddate}
\DeclareDatamodelEntryfields{
lastmodifieddate}
\end{filecontents}
\documentclass[english]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[datamodel=lastmod,backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}
\begin{filecontents*}{english-lastmod.lbx}
\ProvidesFile{english-lastmod.lbx}[2015/05/10 english with edditions for last modified]
\InheritBibliographyExtras{english}
\NewBibliographyString{lastmodified}
\DeclareBibliographyStrings{%
inherit = {english},
lastmodified = {{last modified}{last mod\adddot}},
}
\end{filecontents*}
\DeclareLanguageMapping{english}{english-lastmod}
\ExecuteBibliographyOptions{lastmodifieddate=short}
\DeclareFieldFormat{lastmodifieddate}{\bibstring{lastmodified}\space#1}
\newbibmacro*{lastmodifieddate}{\printlastmodifieddate}
\renewbibmacro*{url+urldate}{%
\usebibmacro{url}%
\iffieldundef{lastmodifiedyear}
{}
{\setunit*{\addcomma\space}%
\usebibmacro{lastmodifieddate}}
\iffieldundef{urlyear}
{}
{\setunit*{\addspace}%
\usebibmacro{urldate}}}
\begin{document}
\cite{webs}
\printbibliography
\end{document}
gives
The answer was updated to reflect changes in biblatex
's internals that make defining date fields easier. If you are using a very old version of biblatex
you may have to check the edit history.
Best Answer
You could alter the bibliography style. For
verbose-trad2
it is defined primarily bystandard.bbx
. The code below will incorporatevolumes
,volume
,maintitle
andpart
fields for@report
in a manner consistent with@book
. Note that@techreport
is just an alias for@report
withtype = {techreport}
.