[Tex/LaTex] biblatex: strictly identical footnote citations following each other

biblatexciting

I'm using the verbose-trad2 citation style of biblatex and trying to change some things around. In my style, Idem is more restricted than just identical author name, so I set idemtracker=false. I also redefined the appropriate bibliography string (ibidem), so that I get, for example,

  1. Author name, « Title », op cit., p. X

  2. Idem, p. Y.

if two citations following each other share the same author and title, but differ in the page number in the postnote. That's all well.

Now, if the page is the same in the two citations, I'd like the page reference to be suppressed in the second citation (that's taken care of with ibidpage=true). Moreover, in this case only, I'd like the Latin abbreviation to be Ibid. instead of Idem. Is there a way to do this?

Here are links to some files:

Thanks for your time and any help!

Best Answer

With ibidpage=true you also get loccittracker=constrict. The case where you want Ibid instead of Idem is detected by the \ifloccit test. Under verbose-trad2, this test is executed in the cite:ibid bibliography macro. Here is its definition from verbose-trad2.cbx:

\newbibmacro*{cite:ibid}{%
  \printtext{%
    \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
      \bibstring[\mkibid]{ibidem}}}%
  \ifloccit
    {\global\toggletrue{cbx:loccit}}
    {}}

You can redefine this macro to print Idem when \ifloccit yields false.

\documentclass{report}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=verbose-trad2,ibidpage,idemtracker=false]{biblatex}
\usepackage[colorlinks]{hyperref}

\renewcommand*{\mkibid}[1]{\emph{#1}}

\makeatletter
\renewbibmacro*{cite:ibid}{%
  \printtext{%
    \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
      \ifloccit
        {\bibstring[\mkibid]{ibidem}%
         \global\toggletrue{cbx:loccit}}
        {\bibstring[\mkibid]{idem\thefield{gender}}}}}}
\makeatother

\addbibresource{biblatex-examples.bib}
\begin{document}
\null\vfill
Filler text \autocite{knuth:ct:a}.
Filler text \autocite{knuth:ct:b}.
Same labelname, different work \autocite{knuth:ct:a}.
Same work, different postnote \autocite[16]{knuth:ct:a}.
Same work, same postnote \autocite[16]{knuth:ct:a}.
Same labelname, different work \autocite[10]{knuth:ct:b}.
Same work, same postnote \autocite[10]{knuth:ct:b}.
Same work, different postnote \autocite[10--15]{knuth:ct:b}.
\printbibliography
\end{document}

enter image description here

Related Question