4

I would like to use the \textcite style: "Author (year, pages)" in the \footcite as well. I could do \footnote{\textcite}, but I was wondering if it would be possible to change the \footcite to work in the \textcite format, or better, using \autocite (so I can switch between in-line and footnote).

EDIT

This a working example:

\documentclass[a4paper,12pt]{article}

\usepackage[hyperref=true,natbib=true,style=authortitle,
citestyle=authoryear,sorting=nyt,
autocite=footnote,
%autocite=inline,
%citestyle=authoryear-ibid,  %% Eventually will use this
backend=biber]{biblatex}

\listfiles
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}

@book{Smith96,
author = {Amith, Adam},
year = {1996},
title = {Economy},
publisher = {My company} 
}

\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

This is a textcite \textcite[96]{Smith96} and this is the textcite in a footnote\footnote{\textcite[128]{Smith96}}.

This is a footcite \footcite[300-320]{Smith96} and this an autocite \autocite[98-34]{Smith96}

\printbibliography
\end{document}

The result with standard autocite=inline: enter image description here

The result with autocite=footnote: enter image description here

I would like footnote and autocite in the same format as textcite: Author (year, pages)

Thank you!

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) 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}. Probably, though, you can just specify the relevant option when loading biblatex. Without seeing an example, though, it is difficult to say. – cfr Apr 18 '14 at 1:02
  • We would need to see what style you use to be sure the modifications necessary to facilitate the output you want can actually be applied to your use case. As such it would be very helpful if you could provide a MWE. – moewe Apr 18 '14 at 6:47
3

I'm using something similar to what you're looking for. You may have a look at that as well, but first, here's what you're looking for:

\documentclass{scrartcl}
\usepackage{lipsum}
\usepackage[style=authoryear,autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}

%this is a mere copy of the \textcite definition, with added [\mkbibfootnote], and renamed to \footcite
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
  {\boolfalse{cbx:parens}}
  {\usebibmacro{citeindex}%
   \iffirstcitekey
     {\setcounter{textcitetotal}{1}}
     {\stepcounter{textcitetotal}%
      \textcitedelim}%
   \usebibmacro{textcite}}
  {\ifbool{cbx:parens}
     {\bibcloseparen\global\boolfalse{cbx:parens}}
     {}}
  {\usebibmacro{textcite:postnote}}

\begin{document}
testing.\footcite[123]{malinowski}
\end{document}

enter image description here

What I did was take the definition of \textcite, and from the one of \footcite add to it the [\mkbibfootnote] bit. Have a look at the manual, it's all there. I named it \footcite, so the result is a command that (I hope) does everything \textcite does, except it does it in a footnote. Can we use that with autocite as well? Sure, I guess all it would take is a look at what routines are trigged by \autocite (with autocite=footnote) and change them so they use the new \footcite.

That said, I think those parentheses are somewhat useless (unless you really have actual text around the citation).

  • Thank you very much for your help. Howerver, I get this error when I compile it (pdflatex,biber,pdflatex): ! Undefined control sequence. \blx@loopcode ...macro {citeindex}\iffirstcitekey {\setcounter {textcitetota... l.21 testing.\footcite[123]{malinowski} – Pep Apr 18 '14 at 8:27
  • I'm not getting that error (or any other). You're sure your TeX system is up to date? Have a look at what \showfiles does, which I just inserted into your MWE. – Nils L Apr 18 '14 at 8:31
  • Weird, I got also "Undefined control sequence" with "showfiles", and I have texlive 2013. – Pep Apr 18 '14 at 8:39
  • sorry, it's \listfiles of course... PS: you may want to evaluate that error message you're getting. What it's trying to tell you is that an update to your TeX system is in order. biblatex manual, p.247 says \iffirstcitekey (which is used by \textcite, as seen above) was introduced in July 2013, so if your version doesn't include it, it's about a year old. Which is a lot in the *TeX realm. It's a good idea to make it a habit to run tlmgr update --all prior to posting. It helps avoid confusion. – Nils L Apr 18 '14 at 8:56
  • Thanks a lot! The update and your example worked like a charm! Now it only remains to make autocite work (in style) as textcite, both in "inline" and "footnote" styles. I will try to have a look at the code, although I am not a latex expert (in case someone has the clue off the top of her/his head). Thanks! – Pep Apr 18 '14 at 12:13

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.