The appropriate possessive suffix can be generated by examining the last few characters of the label. This is straightforward using the package xstring
.
Possessive citation commands in English are much easier to construct. An example under the the standard author-year styles is covered in another question.
authoryear and its variants
In response to a feature request on possessive citations, Philipp Lehman demonstrated how one could generate a possessive labelname
in English using a format alias. The code below extends this approach to other types of labels and Norwegian possessives. It should work for all variants of the standard author-year styles.
\documentclass{article}
\usepackage[norsk]{babel}
\usepackage[style=authoryear-comp]{biblatex}
\usepackage{xstring}
\usepackage{filecontents}
\newrobustcmd*{\mkbibpossess}[1]{%
\IfEndWith{#1}{s}
{'}
{\IfEndWith{#1}{sh}
{'}
{\IfEndWith{#1}{sj}
{'}
{\IfEndWith{#1}{z}
{'}
{s}}}}}
\DeclareNameFormat{labelname:poss}{% Based on labelname from biblatex.def
\ifcase\value{uniquename}%
\usebibmacro{name:last}{#1}{#3}{#5}{#7}%
\or
\ifuseprefix
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}
{\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}%
\or
\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
\fi
\usebibmacro{name:andothers}%
\ifthenelse{\value{listcount}=\value{liststop}}
{\ifmorenames
{s}
{\StrRemoveBraces{#1}[\cbxnobraces]%
\IfEndWith{\cbxnobraces}{s}
{'}
{\IfEndWith{\cbxnobraces}{sh}
{'}
{\IfEndWith{\cbxnobraces}{sj}
{'}
{\IfEndWith{\cbxnobraces}{z}
{'}
{s}}}}}}
{}}
\DeclareFieldFormat{shorthand:poss}{%
\ifnameundef{labelname}{#1\mkbibpossess{#1}}{#1}}
\DeclareFieldFormat{citetitle:poss}{\mkbibemph{#1}\mkbibpossess{#1}}
\DeclareFieldFormat{label:poss}{#1\mkbibpossess{#1}}
\newrobustcmd*{\posscitealias}{%
\AtNextCite{%
\DeclareNameAlias{labelname}{labelname:poss}%
\DeclareFieldAlias{shorthand}{shorthand:poss}%
\DeclareFieldAlias{citetitle}{citetitle:poss}%
\DeclareFieldAlias{label}{label:poss}}}
\newrobustcmd*{\posscite}{%
\posscitealias%
\textcite}
\newrobustcmd*{\Posscite}{\bibsentence\posscite}
\newrobustcmd*{\posscites}{%
\posscitealias%
\textcites}
\begin{filecontents}{\jobname.bib}
@Book{kish,
author = {Kish, Leslie},
title = {Survey Sampling},
publisher = {John Wiley and Sons},
address = {New York},
year = {1965}}
@Online{hss,
author = {{U.S. Dept. of Health and Human Services}},
url = {http://www.hhs.gov},
year = {2011}}
@Report{nasa,
title = {Fiscal Year 2012 Budget Estimates},
author = {{National Aeronautics and Space Administration}},
shortauthor = {NASA},
year = {2011}}
@Book{shorthand,
shorthand = {Shorthand sj},
year = {2010},
publisher = {Anonymous Press},
location = {New York}}
@Book{label,
label = {Label z},
year = {2011},
publisher = {Anonymous Press},
location = {New York}}
@Book{noauthors,
title = {A Book without Authors},
year = {2011},
publisher = {Anonymous Press},
location = {New York}}
@Book{noauthor,
title = {A Book with No Author},
year = {2011},
publisher = {Anonymous Press},
location = {New York}}
@Manual{dyna:browser,
title = {Dynatext, Electronic Book Indexer/Browser},
organization = {Electronic Book Technology Inc.},
address = {Providence, RI},
year = {1991}}
\end{filecontents}
\addbibresource{\jobname.bib}
\bibliography{biblatex-examples}
\renewcommand{\baselinestretch}{1.25}
\begin{document}
\subsection*{label ending in s/sh/sj/z}
Author ending in sh: \posscite[45--68]{kish} \\
Author ending in s: \posscite[45--68]{gillies} \\
Corporate author ending in s: \posscite{hss}
No author, title ending in s: \posscite[45--68]{noauthors} \\
No author or title; shorthand ending in sj: \posscite[45--68]{shorthand} \\
Author ending in z: \posscite[45--68]{gonzalez} \\
No author, title or shorthand; label ending in z: \posscites{label}{gillies}
\subsection*{label ending in other characters}
Manual by organization: \posscite{dyna:browser} \\
Shortauthor: \posscite[45--68]{nasa} \\
Shorthand: \posscite[45--68]{kant:ku} \\
No author: \posscite[45--68]{noauthor} \\
Compact labelname: \posscites{aristotle:physics}{aristotle:poetics}
\end{document}
chicago-authordate
The approach for this style is similar, but when the label is generated by the bibliography macro cite:label
it can take on many different formats depending on the entry type and available fields. So the code below redefines the macro locally for use by the possessive citation command.
\documentclass{article}
\usepackage[norsk]{babel}
\usepackage[authordate]{biblatex-chicago}
\usepackage{xstring}
\usepackage{filecontents}
\newrobustcmd*{\mkbibpossess}[1]{%
\IfEndWith{#1}{s}
{'}
{\IfEndWith{#1}{sh}
{'}
{\IfEndWith{#1}{sj}
{'}
{\IfEndWith{#1}{z}
{'}
{s}}}}}
\DeclareNameFormat{labelname:poss}{% Based on labelname from biblatex.def
\ifcase\value{uniquename}%
\usebibmacro{name:last}{#1}{#3}{#5}{#7}%
\or
\ifuseprefix
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}
{\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}%
\or
\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
\fi
\usebibmacro{name:andothers}%
\ifthenelse{\value{listcount}=\value{liststop}}
{\ifmorenames
{s}
{\StrRemoveBraces{#1}[\cbxnobraces]%
\IfEndWith{\cbxnobraces}{s}
{'}
{\IfEndWith{\cbxnobraces}{sh}
{'}
{\IfEndWith{\cbxnobraces}{sj}
{'}
{\IfEndWith{\cbxnobraces}{z}
{'}
{s}}}}}}
{}}
\DeclareListFormat{organization:poss}{%
\usebibmacro{list:delim}{#1}%
#1\isdot
\usebibmacro{list:andothers}%
\ifthenelse{\value{listcount}=\value{liststop}}
{\ifmoreitems
{s}
{\StrRemoveBraces{#1}[\cbxnobraces]%
\IfEndWith{\cbxnobraces}{s}
{'}
{\IfEndWith{\cbxnobraces}{sh}
{'}
{\IfEndWith{\cbxnobraces}{sj}
{'}
{\IfEndWith{\cbxnobraces}{z}
{'}
{s}}}}}}
{}}
\DeclareFieldFormat{shorthand:poss}{%
#1\mkbibpossess{#1}}
\DeclareFieldFormat{possess}{\mkbibpossess{#1}}
\newbibmacro*{cite:label:poss}{% Based on cite:label from chicago-authordate.cbx
\iffieldundef{label}%
{\iffieldequalstr{entrysubtype}{magazine}%
{\printtext[bibhyperref]{%
\printfield[journaltitle]{journaltitle}%
\printfield[possess]{journaltitle}}}%
{\iffieldequalstr{entrytype}{manual}%
{\printtext[bibhyperref]{\printlist{organization}}}%
{\printtext[bibhyperref]{%
\printfield[citetitle]{labeltitle}%
\printfield[possess]{labeltitle}}}}}%
{\printtext[bibhyperref]{%
\printfield{label}%
\printfield[possess]{label}}}}
\newrobustcmd*{\posscitealias}{%
\AtNextCite{%
\renewbibmacro*{cite:label}{\usebibmacro{cite:label:poss}}%
\DeclareNameAlias{labelname}{labelname:poss}%
\DeclareListAlias{organization}{organization:poss}%
\DeclareFieldAlias{shorthand}{shorthand:poss}}}
\newrobustcmd*{\posscite}{%
\posscitealias%
\textcite}
\newrobustcmd*{\Posscite}{\bibsentence\posscite}
\newrobustcmd*{\posscites}{%
\posscitealias%
\textcites}
\begin{filecontents}{\jobname.bib}
@Book{kish,
author = {Kish, Leslie},
title = {Survey Sampling},
publisher = {John Wiley and Sons},
address = {New York},
year = {1965}}
@Online{hss,
author = {{U.S. Dept. of Health and Human Services}},
url = {http://www.hhs.gov},
year = {2011}}
@Report{nasa,
title = {Fiscal Year 2012 Budget Estimates},
author = {{National Aeronautics and Space Administration}},
shortauthor = {NASA},
year = {2011}}
@Book{shorthand,
shorthand = {Shorthand sj},
year = {2010},
publisher = {Anonymous Press},
location = {New York}}
@Book{label,
label = {Label z},
year = {2011},
publisher = {Anonymous Press},
location = {New York}}
@Book{noauthors,
title = {A Book without Authors},
year = {2011},
publisher = {Anonymous Press},
location = {New York}}
@Book{noauthor,
title = {A Book with No Author},
year = {2011},
publisher = {Anonymous Press},
location = {New York}}
@Manual{dyna:browser,
title = {Dynatext, Electronic Book Indexer/Browser},
organization = {Electronic Book Technology Inc.},
address = {Providence, RI},
year = {1991}}
\end{filecontents}
\addbibresource{\jobname.bib}
\bibliography{biblatex-examples}
\renewcommand{\baselinestretch}{1.25}
\begin{document}
\subsection*{label ending in s/sh/sj/z}
Author ending in sh: \posscite[45--68]{kish} \\
Author ending in s: \posscite[45--68]{gillies} \\
Corporate author ending in s: \posscite{hss}
No author, title ending in s: \posscite[45--68]{noauthors} \\
No author or title; shorthand ending in sj: \posscite[45--68]{shorthand} \\
Author ending in z: \posscite[45--68]{gonzalez} \\
No author, title or shorthand; label ending in z: \posscites{label}{gillies}
\subsection*{label ending in other characters}
Manual by organization: \posscite{dyna:browser} \\
Shortauthor: \posscite[45--68]{nasa} \\
Shorthand: \posscite[45--68]{kant:ku} \\
No author: \posscite[45--68]{noauthor} \\
Compact labelname: \posscites{aristotle:physics}{aristotle:poetics}
\end{document}
Using a modified tufte-common.def
file you can create tufte-latex
documents with biblatex
. A limitation is that tufte-latex
modifies footnotes. So biblatex
features such as \smartcite
inside footnotes and footnote detection with \iffootnote
may not work as intended. Most of this has already been covered in another post.
As for the citation style, you can get most of the way there with some edits to the textcite
bibliography macro and \smartcite
. Both of these are defined in numeric.cbx
.
\documentclass[nobib]{tufte-handout}
\usepackage{hyphenat}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=numeric,citetracker=true,autocite=footnote]{biblatex}
\makeatletter
% If not seen, avoid compact lists and print full citation
\renewbibmacro*{textcite}{%
\ifciteseen
{}
{\clearfield{namehash}}%
\iffieldequals{namehash}{\cbx@lasthash}
{\multicitedelim}
{\cbx@tempa
\ifciteseen
{\ifnameundef{labelname}
{\printfield[citetitle]{labeltitle}}
{\printnames{labelname}}}
{\usedriver
{\DeclareNameAlias{sortname}{default}%
\clearfield{pages}%
\clearfield{pagetotal}}
{\thefield{entrytype}}}%
\addspace\bibopenbracket}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite}%
\savefield{namehash}{\cbx@lasthash}%
\gdef\cbx@tempa{\bibclosebracket\multicitedelim}}
% Make \smartcite like \textcite
\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibbrackets\mkbibfootnote]
{\let\cbx@tempa=\empty
\undef\cbx@lasthash}
{\usebibmacro{citeindex}%
\usebibmacro{textcite}}
{}
{\usebibmacro{postnote}%
\bibclosebracket}
\makeatother
\addbibresource{biblatex-examples.bib}
\begin{document}
One of the most prominent and distinctive features of this style is the
extensive use of sidenotes \autocites(See)()[10--15]{knuth:ct:a}[10]{companion}.
There is a wide margin to provide ample room for sidenotes and small figures
\autocite{knuth:ct:a,knuth:ct:b}. Any footnotes will automatically be converted to
sidenotes.\footnote{Results from \textcite{knuth:ct:a,knuth:ct:b,companion} showed
that...}
\printbibliography
\end{document}
Some notes:
- The
autocite=footnote
option setting makes \autocite
use \smartcite
as its backend citation command.
- The
\ifciteseen
test needs citation tracking enabled. In the example global tracking is enabled via citetracker=true
. Alternative settings are possible. Refer to the manual for details.
- Full citations are printed with
\usedriver
. The first argument to this command allows you to hook code in before printing. This is a good place to suppress fields with \clearfield
and friends. In the example, I suppress the pages
and pagetotal
fields to avoid confusion with page references in postnotes.
- In
numeric
, \textcite
generates compact citation lists. This complicates printing full citations. The edits to textcite
take an easy way out by simply replacing the labelname
or labeltitle
with the full citation.
- The
numeric
style isn't particularly suited to this customization. Refer to the verbose
style or any of its variants for some better alternatives.
Best Answer
To get the desired output for the first citation, you can copy the contents of the
title
field intolabeltitle
.In the second citation you need to suppress both ibidem citation labels and (in non-ibdiem labels) the
labelname
name list.biblatex-chicago
does the former by issuing\blx@ibidreset
. The latter can be done by clearinglabelname
.The following hook puts this all together. Note that it is executed at every citation command, not just
\autocite
.Just add this to your preamble. It should work with the latest
biblatex-chicago
release, which requires biber for the author-date styles.