3

for tl;dr check the example

I am using Biblatex (biber-backend) as bibliography tool, but I guess this question could be relevant for Bibtex as well. The style I use is: authoryear-icomp

I cite like this:

\****cite[<number>]{<bibkey>}

That way Biblatex recognizes the number as page and a repeated citation cites as:

(ibid.)

Now to the problem:
I have same sources with special page numbers like "20:16" (or postnotes like "chapter XY"), so Biblatex does not recognize it as page number and I have to cite it like:

\****cite[p.~20:16]{<bibkey>}

That of course means Biblatex does not recognize repeated citation and cites it as:

(ibid., p. 20:16)

instead of:

(ibid.)

Example (how it should be)

<text1> \cite[\ibid{chapter XY}]{authorXY}. <text2> \cite[\ibid{chapter XY}]{authorXY}
becomes:
<text1> (authorXY, chapter XY). <text2> (ibid.)

but

<text1> \cite[\ibid{chapter XY}]{authorXY}. <text2> \cite[\ibid{chapter AB}]{authorXY}
becomes:
<text1> (authorXY, chapter XY). <text2> (ibid., chapter AB)

The ibid{...} - command is just a placeholder, because I don't know how to achieve, what I described. It is just to explain the idea.
I hope that clears things up.

Help and ideas are very much appreciated :)
Many thanks in advance!

  • A MWE would be be very much appreciated (which style do you use?). Of course you could just make biblatex accept : as page number characters (via \DeclareNumChars*{:}), then there would be no need for the p.~ prefix. – moewe Jan 14 '15 at 16:22
  • thanks, this is a good idea, but doesn't exactly accomplish all I try to achieve. I want that also things like chapter are recognized. – Benutzer193 Jan 14 '15 at 16:44
  • OK, a proper MWE would still help us, especially because I always get the page number after the ibid, even if I have a bare page number. It would also help if you could include the use cases you had in mind. (More complicated constructs etc.) – moewe Jan 14 '15 at 16:51
  • Sorry, I already added it in the OP, have forgotten to mention it in the comment. – Benutzer193 Jan 14 '15 at 17:00
  • Yes, you added the style you are using, a full proper MWE is still missing though. Your edit with \cite****[\ibid{XYZ}]{<bibkey>} confuses me, sorry. Another thing you should think about is where you want to draw the line on what postnote is to be dropped when doubled (p. 14, chapter 14 etc.) and what is to be retained, you probably would not want an important postnote comment to be dropped, just because it happens to appear twice. – moewe Jan 14 '15 at 17:06
4

This solution comes pretty close to what you seem to want, the difference being that your proposed \ibid does exactly the opposite of my \noibidonly.

We modify biblatex's trackers in such a way that all postnotes are considered for the "check-if-previous-postnote-was-the-same" tracker, not just proper page numbers.

\def\blx@loccit@stricttracker#1{%
  \global\csundef{blx@lastnote@#1@\abx@field@entrykey}%
  \blx@imc@iffieldundef{postnote}
    {}
    {\blx@ifcitesingle
       {\global\cslet{blx@lastnote@#1@\abx@field@entrykey}\abx@field@postnote
           \xifinlistcs\abx@field@entrykey{blx@trackkeys@#1}
             {}
             {\listcsxadd{blx@trackkeys@#1}\abx@field@entrykey}}
       {}}}

\def\blx@loccit@numcheck#1{%
  \blx@imc@iffieldundef{postnote}
    {\@secondoftwo}
    {\blx@imc@iffieldequalcs{postnote}{blx@lastnote@#1@\abx@field@entrykey}}}

This is just the standard definition with the \ifpages check deleted.

We then define \noibidonly to allow us to reset the postnote tracker, in effect causing the current and the next postnote to appear regardless of whether it has been displayed immediately before or not.

\newrobustcmd*{\noibidonly}{%
  \iftoggle{blx@footnote}
    {\blx@loccit@reset{foot}}
    {\blx@loccit@reset{text}}%
}

We want to be able to use this command in the postnote, so we issue

\DeclarePageCommands*{\noibidonly}

(Though, thinking about it that should not be necessary any more.)

MWE

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[style=authoryear-icomp,ibidpage]{biblatex}
\addbibresource{biblatex-examples.bib}

\makeatletter
\def\blx@loccit@stricttracker#1{%
  \global\csundef{blx@lastnote@#1@\abx@field@entrykey}%
  \blx@imc@iffieldundef{postnote}
    {}
    {\blx@ifcitesingle
       {\global\cslet{blx@lastnote@#1@\abx@field@entrykey}\abx@field@postnote
           \xifinlistcs\abx@field@entrykey{blx@trackkeys@#1}
             {}
             {\listcsxadd{blx@trackkeys@#1}\abx@field@entrykey}}
       {}}}

\def\blx@loccit@numcheck#1{%
  \blx@imc@iffieldundef{postnote}
    {\@secondoftwo}
    {\blx@imc@iffieldequalcs{postnote}{blx@lastnote@#1@\abx@field@entrykey}}}

\newrobustcmd*{\noibidonly}{%
  \iftoggle{blx@footnote}
    {\blx@loccit@reset{foot}}
    {\blx@loccit@reset{text}}%
}
\makeatother
\DeclarePageCommands*{\noibidonly}

\begin{document}
\cite[20]{cicero} and \cite[20]{cicero} and \cite[20]{cicero}.

\cite[p.~20:16]{wilde} and \cite[p.~20:16]{wilde} and \cite[p.~20:16]{wilde}.

\cite[lorem]{cicero} and \cite[ipsum]{cicero} and \cite[ipsum]{cicero}.

\cite[lorem]{wilde} and \cite[lorem]{wilde} and \cite[lorem\noibidonly]{wilde} and \cite[lorem]{wilde} and \cite[lorem]{wilde}.

\printbibliography
\end{document}

which yields

enter image description here

| improve this answer | |
  • Thank you very much, it is even a better solution than the one I asked for! The \noibidonly is a very good idea, as the the times I don't want it to be considered will be near zero! Just tested, working as excepted!!! – Benutzer193 Jan 14 '15 at 18:04

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.