How to replace the second footcite "Author. Title. Year." by "Ibid"?

1,262

You are almost there, the only thing we have to do is to tell biblatex we want to be able to track "ibid" by ibidtracker=constrict (or any other option that turns on the ibidtracker, see p. 56 of the biblatex documentation for more on that, constrict is the authoryaer standard setting).

In our new cite command we then only need to check whether the citation was cited before (and whether it is not the first citation on a new page) and if so, print "ibid" instead of the whole stuff

\DeclareCiteCommand{\footpartcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
     {\usebibmacro{cite:ibid}}
     {\usebibmacro{cite:fullpartcite}}%
   \setunit{\addperiod\space}%
   \printtext[brackets]{%
     \usebibmacro{cite}}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}

where cite:ibid prints "ibid" and is defined as follows

\providecommand*{\mkibid}[1]{#1}
\newbibmacro*{cite:ibid}{%
  \printtext[bibhyperref]{\bibstring[\mkibid]{ibidem}}}

and cite:fullpartcite prints the more verbose citation

\newbibmacro*{cite:fullpartcite}{%
  \printnames{labelname}%
  \setunit{\labelnamepunct}%
  \printfield[citetitle]{title}%
  \newunit
  \printfield{year}}

MWE

\documentclass{article}
\usepackage[autolang=hyphen,backend=biber,style=numeric,ibidtracker=constrict]{biblatex}
\usepackage[bookmarks,colorlinks=true]{hyperref}

\providecommand*{\mkibid}[1]{#1}
\newbibmacro*{cite:ibid}{%
  \printtext[bibhyperref]{\bibstring[\mkibid]{ibidem}}}
\newbibmacro*{cite:fullpartcite}{%
  \printnames{labelname}%
  \setunit{\labelnamepunct}%
  \printfield[citetitle]{title}%
  \newunit
  \printfield{year}}

\DeclareCiteCommand{\footpartcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
     {\usebibmacro{cite:ibid}}
     {\usebibmacro{cite:fullpartcite}}%
   \setunit{\addperiod\space}%
   \printtext[brackets]{%
     \usebibmacro{cite}}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\footpartcites}[\mkbibfootnote]{\footpartcite}{\addsemicolon\space}

\addbibresource{biblatex-examples.bib} 

\begin{document}

Test\footpartcite{wilde,baez/article}.

Test\footpartcite{cicero} again \footpartcite{cicero}.

\printbibliography
\end{document}

enter image description here

Share:
1,262

Related videos on Youtube

asl
Author by

asl

Updated on August 01, 2022

Comments

  • asl
    asl over 1 year

    I would like to present footcites as follow:

    Author. Title of the article. Year of the article. [ref]

    or

    Ibid. [ref] (for the second times of the same cite)

    For the first presentation, I use a new Cite command defined from customized \footcite command.

    Here's some code for testing purposes:

    \begin{filecontents}{mybib.bib}
    @article{Aggarwal2004b,
    author = {Aggarwal, B. B. and Takada, Y. and Oommen, O. V.},
    journal = {Expert Opin Investig Drugs},
    month = oct,
    number = {10},
    pages = {1327--1338},
    publisher = {Informa Pharma Science},
    title = {{From chemoprevention to chemotherapy: common targets and common goals}},
    volume = {13},
    year = {2004}
    }
    \end{filecontents}    
    \documentclass{report}
    \usepackage[autolang=hyphen,backend=biber,style=numeric]{biblatex}
    \usepackage[bookmarks,colorlinks=true]{hyperref}
    
    \DeclareCiteCommand{\footpartcite}[\mkbibfootnote]
      {\usebibmacro{prenote}}
      {\usebibmacro{citeindex}%
       \printnames{labelname}%
       \setunit{\labelnamepunct}
       \printfield[citetitle]{title}%
       \newunit
       \printfield{year}
       {\adddot}
       \mkbibbrackets{\usebibmacro{cite}}}
      {\addsemicolon\space}
      {\usebibmacro{postnote}}
    
    \DeclareMultiCiteCommand{\footpartcites}[\mkbibfootnote]{\footpartcite} {\addsemicolon\space}
    
    \bibliography{mybib} 
    \begin{document}
    
    Test~\footpartcite{Aggarwal2004b}. \\
    Test~\footpartcite{Aggarwal2004b}. \\
    \printbibliography
    
    \end{document}
    

    But, this doesn't replace the footcite by "Ibid. [ref]" if the footcite is already in the document.

    The result is:

    Result

    The result should be like this:

    1 Aggarwal, Takada, and Oommen. “From chemoprevention to chemotherapy: common targets and common goals”. 2004. [ref].

    2 Ibid. [ref].

    Is there any solution to replace the second footcite by Ibid...?

  • asl
    asl about 9 years
    It would be great if the citation is still Ibid. [ref] on other pages after the first full citation. I've tried to suppress '\AND\NOT\iffirstonpage' but it's the full citation on a new page. A solution ?
  • moewe
    moewe about 9 years
    @asl If I delete the \AND\NOT\iffirstonpage I do get "ibid" for subsequent citations even if they are the first on the page. You will not get "ibid" if you do \cite{wilde}\cite{cicero}\cite{wilde}, as "ibid" essentially means: "The exact citation before." Maybe you want something like \ifciteseen instead of \ifciteibid? But then the "ibid" string is highly inappropriate.
  • asl
    asl about 9 years
    You're right. In this case, "ibid" string is inappropriate. So, I will change the string. But, if I replace \ifciteibid\AND\NOT\iffirstonpage by \ifciteseenI have no "ibid" and the next citation is a full citation. What it's wrong ?
  • moewe
    moewe about 9 years
    @asl You will have to issue citetracker=context in order for the citetracker to work (analogous to ibidtracker=constrict which you now will not need anymore as you don't use \ifciteibid).
  • asl
    asl about 9 years
    This is precisely what I was looking for; many thanks!