3

I'm wondering if there's an efficient way to cite both the author and year, similar to what you get with biblatex's \textcite i.e. Author (year), when using biblatex-mla. Right now I'm using a quite inefficient method:

\begin{filecontents*}{test.bib}
    title     = {{Seinte Katerine}},
    editor  = {S.R.T.O. d'Ardenne and E.J. Dobson},
    year      = {1981},
    publisher = {Oxford University Press},
    address   = {Oxford}
\end{filecontents*}

\documentclass{article}
\usepackage[style=mla,backend=bibtex8]{biblatex}
\bibliography{test}

\begin{document}
    According to \citeauthor{katherine} (\citeyear{katherine})...
\end{document}

If anyone knows how to do this more efficiently, suggestions would be greatly appreciated.

13
  • Well, your example doesn't have an author field, so that's the first obstacle I'd address. biblatex does have the \DeclareCiteCommandCommand, which you can use (the preferred method, but less easy to implement for a novice). Then there's always the hack: \newcommand\citeauthyear[1]{\citeauthor{#1} (\citeyear{#1})} -- which you'd use as \citeauthyear{katherine} in your example.
    – jon
    Commented Apr 18, 2015 at 21:11
  • Can't you use \textcite? It is a standard biblatex command... Please don't use minimal for examples!
    – cfr
    Commented Apr 18, 2015 at 21:27
  • @jon That's not a problem. It has an editor and that's enough. More worrying, though, is the fact that the file has no bib entries in it at all...
    – cfr
    Commented Apr 18, 2015 at 21:27
  • 1
    @cfr -- Oops! I meant bibkey, not author.... (It was meant to be somewhat tongue-in-cheek.)
    – jon
    Commented Apr 18, 2015 at 21:43
  • 1
    The very small example is absolutely the right thing to do. What @cfr meant was that the minimal class was not meant for constructing "minimal" examples by end-users (for various reasons, not important here). It is better to do exactly as you did, just with a class like article or book or as the actual problem demands. By the way, there is nothing particularly 'wrong' with my suggested hack, it's just not very flexible. (E.g., complex author lists will probably come out all mangled and not in the format you want ... but maybe not.)
    – jon
    Commented Apr 19, 2015 at 1:51

1 Answer 1

2

A quick look at the biblatex-mla documentation suggests that this kind of author-year reference is not a standard citation command as far as the MLA guidelines go, so I presume this is why no such command is provided for.

You can create your own command with:

\newcommand\citeauthyear[1]{\citeauthor{#1} (\citeyear{#1})}

This has at least one shortcoming: by default, it will not work with hyperref -- which may not be a big deal. It will also not get "tracked" by the MLA ibid-tracker -- I'm not sure if this is a good or bad thing. You need to decide what the output of this sequence should do:

\citeauthyear{<key1>} wrote about this \autocite{<key1>}

I think it depends on how you use this command. My vague memory of MLA rules (from my undergraduate days many years ago now) is that MLA expects you to "bracket" your citation sort of like: name ... <ideas from "name"> ... (page). If so, then tracking is probably a good thing.

So another solution is to create your own more orthodox command via \DeclareCiteCommand. Here's a pretty basic one:

\DeclareCiteCommand{\aycite}
  {\usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
    \usebibmacro{cite:mla:authyear}}%
  {}%
  {\usebibmacro{postnote}\citereset}

\newbibmacro*{cite:mla:authyear}%
  {\printtext[bibhyperref]{%
      \printnames{labelname}\space
      \printtext[parens]{\printdate}}}

Here, by default, hyperref will work, and the command is not tracked. You can change the tracking by removing the \citereset in the \aycite definition.

Here's a complete example:

\begin{filecontents*}{\jobname.bib}
@book{katherine,
    title     = {{Seinte Katerine}},
    editor  = {S.R.T.O. d'Ardenne and E.J. Dobson},
    year      = {1981},
    publisher = {Oxford University Press},
    address   = {Oxford}
}
\end{filecontents*}

\documentclass{article}
\usepackage[style=mla,backend=bibtex8]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{xcolor}
\usepackage[colorlinks, allcolors=red]{hyperref}

\DeclareCiteCommand{\aycite}
  {\usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
    \usebibmacro{cite:mla:authyear}}%
  {}%
  {\usebibmacro{postnote}\citereset}

\newbibmacro*{cite:mla:authyear}%
  {\printtext[bibhyperref]{%
      \printnames{labelname}\space
      \printtext[parens]{\printdate}}}

% This version does not get "tracked" by `biblatex-mla`
\newcommand\citeauthyear[1]{\citeauthor{#1} (\citeyear{#1})}

\begin{document}
\parindent0pt

% Baseline citation
\autocite[100]{katherine} \citereset


% These two paragraphs are equivalent
According to \citeauthor{katherine} (\citeyear{katherine}); \ldots
\autocite[100]{katherine} \citereset

According to \citeauthyear{katherine}; \ldots
\autocite[100]{katherine} \citereset


% These two commands paragraphs produce identical results; if you'd
% rather get the \aycite command tracked, take out the \citereset
% commands in the \aycite definition
According to \aycite{katherine}; \ldots
\autocite[100]{katherine}
\citereset

According to \aycite{katherine}; \ldots
\citereset% <-- this is the difference between this paragraph and the one above
\autocite[100]{katherine}

\printbibliography
\end{document}
2
  • Thank you, that is a very thorough answer. Needless to say that I find the \DeclareCiteCommand approach much more appealing than the "stuff several \cite...s into one \newcommand" approach.
    – moewe
    Commented Aug 3, 2015 at 19:09
  • @moewe -- Indeed. Though I must admit I preach "best practice" noticeably more often than I follow it in my own documents. (Though I do try, or at least try to try, to be good.)
    – jon
    Commented Aug 3, 2015 at 19:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .