Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the same situation as the following user: biblatex: Enhancing \autocite in case of would-be nested footnotes

I want to use \autocite within a \footnote. This results in the citation being wrapped in parenthesis. I want to change the behavior of \autocite used within \footnote to print the citation without the parenthesis like a simple call of \cite would do.

How can I change the behavior of \autocite within the \footnote?

share|improve this question
    
Which citation style (authoryear, authortitle, ...) do you use? –  lockstep Aug 22 '12 at 8:10
    
I use biblatex-juradiss. –  Michael Aug 22 '12 at 8:34

1 Answer 1

up vote 6 down vote accepted

The solution depends on the citation style. For styles like authortitle, verbose and their respective variants (and also for biblatex-juradiss) that execute autocite=footnote, we only need to redefine the underlying \smartcite macro so that it does not add parentheses in footnotes (by replacing \mkbibparens with \textnormal).

\documentclass{article}

\usepackage[style=authortitle]{biblatex}

\DeclareCiteCommand{\smartcite}[\iffootnote\textnormal\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\smartcites}
    [\iffootnote\textnormal\mkbibfootnote]{\smartcite}{\multicitedelim}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\null\vfill% just for the example

Some text \autocite{A01}.

Some text.\footnote{A footnote \autocite{A01}.}

\printbibliography

\end{document}

enter image description here

For styles like authoryear that by default execute autocite=inline (which uses \parencite), we need to declare a new autocite option value (say, inlineplainfootnote) that points to a new underlying macro (say, \mysmartcite) that does what you want (add parentheses in normal text, don't add them in footnotes).

\documentclass{article}

\usepackage[style=authoryear]{biblatex}

\DeclareAutoCiteCommand{inlineplainfootnote}{\mysmartcite}{\mysmartcites}

\DeclareCiteCommand{\mysmartcite}[\iffootnote\textnormal\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\mysmartcites}
    [\iffootnote\textnormal\mkbibparens]{\mysmartcite}{\multicitedelim}

\ExecuteBibliographyOptions{autocite=inlineplainfootnote}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\null\vfill% just for the example

Some text \autocite{A01}.

Some text.\footnote{A footnote \autocite{A01}.}

\printbibliography

\end{document}

enter image description here

share|improve this answer
    
Thank you. That was wonderfully helpful. –  Michael Aug 22 '12 at 9:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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