I am using authoryear
with biblatex
.
When, for instance, I type \parencite[p.6]{gusfield2009}
, I get :
(Gusfield, 2009, p.6)
How to get also the origdate
entry in the citation in order to have :
(Gusfield, [1981] 2009, p. 6)
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIf you only want the origdate
in citations, you need
\documentclass[a4paper,british]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{test,
author = {Walter Ordsmith},
title = {An Old Work},
date = {2010},
edition = {5},
origdate = {1981},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{origdate}{\mkbibbrackets{#1}}
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}}
{\printnames{labelname}%
\setunit{\printdelim{nameyeardelim}}}%
\printorigdate
\setunit*{\addspace}
\usebibmacro{cite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}}
\begin{document}
\cite{test} and \parencite[6]{test}
\printbibliography
\end{document}
yields
The following approach incorporates the origdate
into more cite commands and the bibliography.
\documentclass[a4paper,british]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear,mergedate=maximum]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{test,
author = {Walter Ordsmith},
title = {An Old Work},
date = {2010},
edition = {5},
origdate = {1981},
}
@book{testn,
author = {Walter Ordsmith},
title = {A New Work},
date = {2013},
}
@book{testm,
author = {Walter Ordsmith},
title = {A Very Old Work},
date = {2000},
edition = {8},
origdate = {1882},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{origdate}{\mkbibbrackets{#1}}
\renewbibmacro*{cite:labeldate+extradate}{%
\iffieldundef{origyear}
{}
{\printorigdate
\setunit{\addspace}}%
\iffieldundef{labelyear}
{}
{\printtext[bibhyperref]{\printlabeldateextra}}}
\DeclareCiteCommand{\citeorigyear}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\printfield{origyear}}
{\multicitedelim}
{\usebibmacro{postnote}}
\renewbibmacro*{date+extradate}{%
\iffieldundef{origyear}
{}
{\printorigdate
\setunit{\addspace}}%
\iffieldundef{labelyear}
{}
{\printtext[parens]{%
\iflabeldateisdate
{\printdateextra}
{\printlabeldateextra}}}}
\begin{document}
\cite{test} and \parencite[6]{test}.
And \parencite[6]{testn} is nice and \textcite{testm} was written in \citeyear{testm}.
\nocite{*}
\printbibliography
\end{document}
gives
\citeyear
? In order to have for instance : [1981]2010 (Or do you think I should better do it manually ?)
\printfield{origyear}
(do not use this in your document though). I have updated the answer to provide \citeorigyear
which cites the origyear
(without brackets or anything around it). Alternatively, there is the quite cumbersome \citefield{testm}{origyear}
.
\setunit*
didn't quite work as intended. This should be fixed now.
\setunit*
after \printdate
was a bug and will be fixed in the next biblatex
release: github.com/plk/biblatex/commit/…. In the meantime the code above should work as expected (and should continue to do so even after the update).
Another option is to use the biblatex-chicago package, which comes with styles supporting origdate
.
So
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{hume_1751_enquiry,
origdate = {1751},
date = {1975-06-12},
author = {Hume, David},
title = {An Enquiry Concerning the Principles of Morals},
booktitle = {Enquiries Concerning Human Understanding and
Concerning the Principles of Morals},
editor = {Selby-Bigge, L. A. and Nidditch, P. H.},
annotation = {Selby-Bigge and Nidditch's 1975 edition is
based off a collection of Hume's essays postumously
published in 1777. Hume's ``An Equiry Concerning the
Principles of Morals" was first published in 1751.},
publisher = {Oxford University Press},
location = {New York},
edition = {3},
isbn = {978-0-19-824536-0}
}
\end{filecontents}
\usepackage[authordate,
backend=biber,
sorting=nyt,
backref=true,
alldates=iso8601,
cmsdate=both,
annotation=true]{biblatex-chicago}
\addbibresource{\jobname.bib}
\begin{document}
Lorem \autocite[179]{hume_1751_enquiry}.
\printbibliography
\end{document}
Will result in
The cmsdate
option controls how origdate
and date
are displayed both in the citation and in the reference list. My own preference is to use cmsdate=on
which has the effect of eliminating the date
field in the citation, but nevertheless displays both dates in the reference entry (the date
is moved to the end of the entry):
The Chicago Manual of Style, if that's the style guide you want to follow, specifies not using "p." to preface page numbers. But if you wanted to you could use ...
\autocite[p. 179]{hume_1751_enquiry}.
... to return ...
(Hume [1751] 1975, p. 179)
Better, however, would be to add the following code to your preamble to insert "p." and "pp." automatically (in lieu of manually specifying it) ...
\DeclareFieldFormat{postnote}{\mkpageprefix[pagination]{#1}}
\DeclareFieldFormat{volcitepages}{\mkpageprefix[pagination]{#1}}
\DeclareFieldFormat{multipostnote}{\mkpageprefix[pagination]{#1}}
... as moewe suggests in the comments.
biblatex-chicago
, one should probably better use \DeclareFieldFormat{postnote}{\mkpageprefix[pagination]{#1}}
, \DeclareFieldFormat{volcitepages}{\mkpageprefix[pagination]{#1}}
and \DeclareFieldFormat{multipostnote}{\mkpageprefix[pagination]{#1}}
. Inserting the "p."/"pp." manually should be a thing of the past with biblatex
.
authorstyle
is not a validbiblatex
style, do you meanauthoryear
? By default, theorigyear
(origdate
) is not displayed in the bibliography either, where do you want it to appear (whatmergedate
option, if any, do you use?)?mergedate
read this file.