2

While using biblatex I want to display the full citations in footnotes, and in the text the following format author (year)^citation number. For now I am using as it is in the MWE. Is there a better way to achieve the same format and also for the citations for the same book, use the same number, i.e., use just 1 in the rappaport:2002 instead of 1 and 3?

\documentclass{article}

\usepackage[backend=biber,style=footnote-dw]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{xparse}
\DeclareDocumentCommand{\myfootcite}{ O{} O{} m }{\citeauthor*[#1][]{#3}~(\citedate[][]{#3})\cite[][#2]{#3}}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{rappaport:2002,
    title={Wireless Communications: Principles and Practice},
    author={Theodore S.~Rappaport},
    publisher={Prentice Hall},
  month=jan,
    year=2002,
  isdn={978-0130422323},
  edition=2,
}

@book{goldsmith:2004,
    title={Wireless Communications},
    author={Andrea Goldsmith},
    publisher={Stanford University},
    year=2004,
    url={http://www.cs.ucdavis.edu/~liu/289I/Material/book-goldsmith.pdf},
    urldate={2013-06},
}
\end{filecontents*}


\begin{document}
Test1~\myfootcite[p.~165][]{rappaport:2002}
\par
Test2~\myfootcite[p.~230][]{goldsmith:2004}
\par
Test3~\myfootcite[][]{rappaport:2002}
\end{document}
  • 1
    This problem has been covered in a previous post. The solution there can be adapted to your case by replacing \cite with the new \superfootcite. The biblatex-dw styles do all kinds of tracking, so you'll at least have to add \citetrackerfalse to the first (<precode>) argument in the definition of \superfootcite. – Audrey Jul 8 '13 at 14:29
  • @Audrey I will check the solution later. Thanks for pointing out the post. I only use biblatex-dw because of the footnote-dw, it can be replaced by any other style, if I can still have references in footnotes. I saw in the post that pages are cited as \superfootcite[<page number>]{<citekey>}. How would tables and figures be cited? – cacamailg Jul 8 '13 at 17:38
  • The usual format is \cite[<prenote>][<postnote>]{<keys>}. Page references go in <postnote>. So can references to tables or figures. In <prenote> prefixes like "e.g." or "cf." are used. \superfootcite checks for recurrent \strfield{postnote}+entrykey combinations. The solution could be extended to prenote. BTW: Use of xparse isn't necessary for multi-pass citation commands. \textcite in the more recent verbose styles exploits the citation command interface. Under this approach you can access and move trailing punctuation and compress citation labels. – Audrey Jul 8 '13 at 17:55
  • @Audrey I tested the solution in the other post, but I want prenotes and postnotes to be added in the main text rather than in the bibliography itself, like in my MWE. – cacamailg Jul 12 '13 at 3:43
  • Well, you're actually using only the prenote argument in the MWE. The example passes page references to prenote when typically they go in the postnote. Your desired format is unclear, which is why I've been commenting this whole time instead of simply answering. Are you wanting output like: <prenote> <name label> (<year label>, <postnote>)^<footnote mark>? – Audrey Jul 12 '13 at 16:55
1

The \textcite command implemented in footnote-dw does almost what you want if we combine it with Multiply cited reference in footnotes, it doesn't print the year and the positions of the pre- and postnotes are different. Fortunately though, with a bit of help from authoryear.cbx we can implement your desired output.

This is from authoryear.cbx (with a few modifications)

\newbool{cbx:parens}

\newbibmacro*{ay:textcite}{%
  \printnames{labelname}%
  \setunit{%
    \global\booltrue{cbx:parens}%
    \addspace\bibopenparen}%
   \printdate}

\newbibmacro*{ay:textcite:postnote}{%
  \iffieldundef{postnote}
    {\ifbool{cbx:parens}
       {\bibcloseparen}
       {}}
    {\ifbool{cbx:parens}
       {\setunit{\postnotedelim}}
       {\setunit{\addspace\bibopenparen}}%
     \printfield{postnote}\bibcloseparen}}

Then

\DeclareCiteCommand{\etextcite}[\footnotecheck\cbx@textcite\superfootcite]
  {\usebibmacro{prenote}%
   \gdef\cbx@savedkeys{}}
  {\usebibmacro{ay:textcite}%
   \ifciteseen
     {\global\boolfalse{cbx:textcitefull}}
     {\global\booltrue{cbx:textcitefull}}%
   \xappto\cbx@savedkeys{\thefield{entrykey},}}
  {\multinamedelim}
  {\usebibmacro{ay:textcite:postnote}%
   \protected@xappto\cbx@savedcites{{\cbx@savedkeys}}}

is a modification of \textcite in footnote-dw.cbx.

Finally, we need Audrey's \superfullcite from Multiply cited reference in footnotes.

MWE

\documentclass{article}
\usepackage[backend=biber,style=footnote-dw]{biblatex}
\addbibresource{biblatex-examples.bib}

\newbool{cbx:parens}

\newbibmacro*{ay:textcite}{%
  \printnames{labelname}%
  \setunit{%
    \global\booltrue{cbx:parens}%
    \addspace\bibopenparen}%
   \printdate}

\newbibmacro*{ay:textcite:postnote}{%
  \iffieldundef{postnote}
    {\ifbool{cbx:parens}
       {\bibcloseparen}
       {}}
    {\ifbool{cbx:parens}
       {\setunit{\postnotedelim}}
       {\setunit{\addspace\bibopenparen}}%
     \printfield{postnote}\bibcloseparen}}

\makeatletter
\DeclareCiteCommand{\etextcite}[\footnotecheck\cbx@textcite\superfootcite]
  {\usebibmacro{prenote}%
   \gdef\cbx@savedkeys{}}
  {\usebibmacro{ay:textcite}%
   \ifciteseen
     {\global\boolfalse{cbx:textcitefull}}
     {\global\booltrue{cbx:textcitefull}}%
   \xappto\cbx@savedkeys{\thefield{entrykey},}}
  {\multinamedelim}
  {\usebibmacro{ay:textcite:postnote}%
   \protected@xappto\cbx@savedcites{{\cbx@savedkeys}}}


\DeclareCiteCommand{\superfootcite}[\cbx@wrap]
  {\gdef\cbx@keys{}\citetrackerfalse}
  {\xappto\cbx@keys{\thefield{entrykey},}}
  {}
  {\ifcsundef{cbx@lastin@\cbx@keys @\strfield{postnote}}
     {\csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{-1}}{}%
   \ifsamepage{\value{instcount}}{\csuse{cbx@lastin@\cbx@keys @\strfield{postnote}}}
     {\footnotemark[\csuse{cbx@lastfn@\cbx@keys @\strfield{postnote}}]}
     {\xappto\cbx@cite{\noexpand\footcite%
        [\thefield{prenote}][\thefield{postnote}]{\cbx@keys}%
        \csnumgdef{cbx@lastfn@\cbx@keys @\strfield{postnote}}{\value{\@mpfn}}%
        \csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{\value{instcount}}}}}

\newrobustcmd{\cbx@wrap}[1]{#1\cbx@cite\gdef\cbx@cite{}}
\def\cbx@cite{}
\makeatother


\begin{document}
Lorem \etextcite[cf.][12]{sigfridsson} ipsum \etextcite{geer}
dolor \etextcite{sigfridsson} sit \etextcite{geer} amet \etextcite{wilde}.
\end{document}

example output

  • Thank you very much! It is ways good to learn something every day :). – cacamailg Oct 23 '15 at 15:45

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.