0

I am using the biblatex package. for my thesis I have the following requirements for a citation in the footer:

See "last name of the author" ("year"), "pages".

example footcite: See Miller (2010), p. 3.

example footcites: See Miller (2010), p. 3; Martin (2008), p. 23; Matthew (2000), p. 44.

I'm using the \footcite[pre][post]{citekey} and \footcites(pre)(post)[pre][post]{citekey}...[pre][post]{citekey}command respectively but it doesn't provide the braces around the "year", everything else is fine.

I found a workaround by using \footnote{See \textcite{citekey}, "pages".} that generates exactly what I need but this solution is unhandy regarding punctuation.

Therefore: Is there any solution to customize the mentioned commands? I found some similar questions here but nothing worked for me.

EDIT: MWE: EDIT2: Actually I use BibDesk to organise my references, however I used the filecontents package now. Everybody should be able to compile it now.

\documentclass[toc=listof,12p,bibintoc]{scrreprt}
\usepackage[backend=bibtex,style=authoryear]{biblatex}

\addbibresource{example.bib} 
\RequirePackage{filecontents}

\begin{filecontents}{example.bib}
@article{example2,
Author = {Author2},
Date-Added = {2014-11-10 20:00:20 +0000},
Date-Modified = {2014-11-10 20:01:29 +0000},
Journal = {Journal2},
Title = {Title2},
Year = {2012}}

@article{example1,
Author = {Author1},     
Date-Added = {2014-11-10 20:00:07 +0000},
Date-Modified = {2014-11-10 20:01:10 +0000},
Journal = {Journal1},
Title = {Title1},
Year = {2010}}

@article{example3,
Author = {Author3},
Date-Added = {2014-11-10 19:59:11 +0000},
Date-Modified = {2014-11-10 20:00:40 +0000},
Journal = {Journal2},
Title = {Title2},
Year = {2014}}
\end{filecontents}

\begin{document}
footcite\footcite[See][p. 30]{example1}
footcites\footcites(See)(){example1}{example2}{example3}

\printbibliography[heading=bibintoc]

\end{document}  

Here an example of both commands and the output in the footer: enter image description here enter image description here

Everything is fine but the missing braces around the "year".

thanks in advance!

  • Welcome to TeX.SX! Could you add some more code to make the example compilable? – egreg Nov 10 '14 at 18:18
  • What else do you need? I think I added everything necessary.. – Mike Nov 10 '14 at 19:01
  • You could add a full minimal working example (MWE) instead than snippets that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Aradnix Nov 10 '14 at 19:35
  • What's in example.bib? I cannot compile your code as it stands. biblatex-examples.bib is a ready-made database whose entries you could cite instead. – cfr Nov 11 '14 at 1:03
  • Can anybody help please? :/ – Mike Nov 11 '14 at 20:00
1

This seemed to me to be a very standard question, but I could not find an answer that dealt only with this problem (there were some combined answers that also incorporated this).

With the authoryear stle, \footcite uses the bibmacro cite (it probably does that for almost all standard styles), so we modify that to include parentheses around the year. (This will also add parentheses around the year in normal \cite and also in \parencite (not in \textcite though) - if you don't want that, a bit more work needs to be done.) I also added a check to suppress parentheses if no year is present - we don't want to end up with an empty pair of parentheses, after all.

The cite macro becomes (with the relevant lines added and changed near the end)

\renewbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{cite:label}%
        \setunit{\printdelim{nonameyeardelim}}}
       {\printnames{labelname}%
        \setunit{\printdelim{nameyeardelim}}}%
     \iffieldundef{labelyear}
       {}
       {\printtext[parens]{\usebibmacro{cite:labeldate+extradate}}}}
    {\usebibmacro{cite:shorthand}}}

MWE

\documentclass{article}
\usepackage[style=authoryear]{biblatex}

\addbibresource{biblatex-examples.bib} 

\renewbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{cite:label}%
        \setunit{\printdelim{nonameyeardelim}}}
       {\printnames{labelname}%
        \setunit{\printdelim{nameyeardelim}}}%
     \iffieldundef{labelyear}
       {}
       {\printtext[parens]{\usebibmacro{cite:labeldate+extradate}}}}
    {\usebibmacro{cite:shorthand}}}

\begin{document}
footcite\footcite[See][30]{wilde}
footcites\footcites(See)(){companion}{knuth:ct:a}{knuth:ct:b}

\printbibliography[heading=bibintoc]
\end{document}  

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.