3

Consider the output below, created with biblatex and its vanilla authoryear-icomp scheme, with the citations placed in endnotes (using the enotez package).

enter image description here

There isn't much that seems wrong about it. That is, until you know that the third citation command in fact points to Malinowski rather than to Knuth.

\documentclass{scrartcl}
\usepackage{blindtext,enotez}
\usepackage[style=authoryear-icomp,notetype=endonly,autocite=footnote,backend=biber]{biblatex}
\addbibresource[location=remote]{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}

\let\footnote\endnote%

\begin{document}
\blindtext
\footcite{malinowski}

\blindtext
\footnote{That's also what \textcite{knuth:ct} says.}

\blindtext
\footcite{malinowski}

\printendnotes
\printbibliography

\end{document}

Notes 1 and 3 are produced using the regular \footcite command, which is sufficient since no comments are added to the citation. Note 2 though is a \footnote with a citation embedded in some text.

Nothing too special, but it seems that that's enough to confuse biblatex's ibid tracker. It doesn't seem to take note of what's happening inside note 2.

It may well be that there's something I've overlooked (in that case, what is it?). But if you people think it's something that I should contact the biblatex team about, I'll of course do that.

PS: just to clarify: this does not happen when foot- rather than endnotes are used. https://i.stack.imgur.com/Lc1f2.png

Nils L
  • 9,716
  • 2
    AFAICS biblatex currently doesn't patch enotez' \endnote command so that biblatex doesn't know it is in a footnote if you use \footnote/\endnote (if you use \footcite biblatex does that automatically). By default biblatex has two tracking levels and it gets tangled up in those. I couldn't figure out how to patch enotez properly, so a work-around is ibidtracker=true if you don't have citations in the text. – moewe Apr 15 '16 at 15:16

1 Answers1

3

Currently biblatex doesn't support the enotez package in that it can't patch enotez' commands for footnote (endnote) detection.

You could just ignore the distinction between footnote and text via ibidtracker=true, but that might not be the best option for you.

I managed to modify some enotez internals to include the footnote detection toggle, and it worked in the MWE

\ExplSyntaxOn
\cs_undefine:N \enotez_endnote:nn
\cs_new_protected:Npn \enotez_endnote:nn #1#2
  {
    \enotez_endnote_mark:n  {#1}
    \enotez_endnote_text:nn {#1} {\toggletrue{blx@footnote}#2}
  }
\ExplSyntaxOff

That is a bit of a kludge, though.

moewe
  • 175,683
  • 2
    This seems to work: \ExplSyntaxOn \pretocmd \enotez_get_note:nn { \toggletrue {blx@footnote} } {} {patch~failed} \ExplSyntaxOff – cgnieder Apr 15 '16 at 16:02
  • What's more bothering to me is that the log keeps telling Package biblatex Warning: Please (re)run Biber on the file – cgnieder Apr 15 '16 at 16:06
  • Thanks @clemens, will give that a try. @moewe: luckily, ibidtracker=true is a good option in my case, as I've stopped using in-text citations in all documents where I'm control over what citation scheme gets used. So there's only one level on which citations appear. – Nils L Apr 15 '16 at 20:32
  • @clemens If that is the preferred way to get the toggle in, you could ask the biblatex team to implement enotez support with that patch. The rerun message problem is a general one with enotez though, even `\documentclass{scrartcl} \usepackage{enotez} \usepackage[style=authoryear-icomp,autocite=footnote,backend=biber]{biblatex} \addbibresource{biblatex-examples.bib}

    \let\footnote\endnote%

    \begin{document} Lorem\footcite{malinowski}

    \printendnotes \printbibliography \end{document}` prompted me to rerun all the time. (I guess it has to do with how citations are handled in aux files?)

    – moewe Apr 16 '16 at 06:31
  • I could add the patch to enotez without having to bother the biblatex team... I'll try to figure out the rerun problem and fix it, too. – cgnieder Apr 16 '16 at 08:21
  • @clemens Or you can do that. I don't know about the official line about who should be doing that implementation (if you let them know they can at least add enotez to the list of supported packages.) – moewe Apr 16 '16 at 10:22
  • @clemens BTW: If you are trying to tackle the .aux file problem, be warned that some of the .aux file handling is going to change in biblatex 3.4 (currently on github dev branch). – moewe Apr 16 '16 at 10:30
  • @clemens I think I figured out the rerun problem: https://github.com/plk/biblatex/issues/707. Would it be possible to include the \toggletrue{blx@footnote} in enotez? biblatex only patches a few packages (apparently the policy was to only patch the 'big' ones) and doesn't do LaTeX3 at the moment. – moewe Feb 08 '18 at 08:45
  • @moewe Thanks for the reminder. I'll update enotez (https://bitbucket.org/cgnieder/enotez/issues/11/) – cgnieder Feb 08 '18 at 16:13