Friends, I'm using a clever idea from Joseph, David and egreg in order to get the bibliography content displayed in both document and log (Henrique and I are trying to create a semi-automatic analyzer for biblatex styles). So far, this is the code I'm using:

  title = {My Title One},
  publisher = {My Publisher One},
  year = {2012},
  editor = {My Editor One},
  author = {Author One}

  title = {My Title Two},
  publisher = {My Publisher Two},
  year = {2012},
  editor = {My Editor Two},
  author = {Author Two}

  title = {My Title Three},
  publisher = {My Publisher Three},
  year = {2012},
  editor = {My Editor Three},
  author = {Author Three}








It works like a charm, including the .log display:

> \box26=
..\penalty -300
..\glue 15.06577 plus 4.3045 minus 0.86089
..\glue(\parskip) 0.0
..\hbox(9.93758+0.0)x345.0, glue set 271.08008fil
....\glue 0.0
...\T1/cmr/bx/n/14.4 R
...\T1/cmr/bx/n/14.4 e
...\T1/cmr/bx/n/14.4 f
...\T1/cmr/bx/n/14.4 e
...\T1/cmr/bx/n/14.4 r
...\T1/cmr/bx/n/14.4 e
...\T1/cmr/bx/n/14.4 n
...\T1/cmr/bx/n/14.4 c
...\T1/cmr/bx/n/14.4 e
...\T1/cmr/bx/n/14.4 s


I was trying to patch \printbibliography in order to "hide" these macros and make it easy for us to debug other documents. My plan was to create a debug package and include it in the main document, say mydebug.sty:

\ProvidesPackage{mydebug}[2013/01/09 Debugging biblatex styles]


But sadly, I'm failing at patching \printbibliography. Could someone enlight my path? :)


It's the usual problem: you need letltxmacro, because \printbibliography has an optional argument, see When to use \LetLtxMacro?. Here's my pick:


  \chardef\currentmode=\interactionmode % save the current interaction mode
  \batchmode % set batch mode so we won't be interrupted
  \begingroup % the changes to the parameters are local
  \interactionmode=\currentmode % restore the interaction mode

The changes to the interaction mode are always global, that's why one needs to restore it explicitly.

A different way, simply patching \blx@printbibliography:


The \biblio@inlog command redefines itself when expanded, so it will do nothing when the box to be shown is built.

  • 2
    won't bother posting mine then :-) – David Carlisle Jan 9 '13 at 16:02
  • Absolutely fantastic. Thank you very much, my friend. :) – Paulo Cereda Jan 9 '13 at 16:29

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.