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:
\begin{filecontents}{\jobname.bib}
@BOOK{foo:2012a,
title = {My Title One},
publisher = {My Publisher One},
year = {2012},
editor = {My Editor One},
author = {Author One}
}
@BOOK{foo:2012b,
title = {My Title Two},
publisher = {My Publisher Two},
year = {2012},
editor = {My Editor Two},
author = {Author Two}
}
@BOOK{foo:2012c,
title = {My Title Three},
publisher = {My Publisher Three},
year = {2012},
editor = {My Editor Three},
author = {Author Three}
}
\end{filecontents}
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,
bibstyle=numeric-comp,
sorting=none]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\newsavebox\bibbox
\savebox\bibbox{\parbox{\textwidth}{\printbibliography}}
\showboxbreadth\maxdimen\showboxdepth\maxdimen\errorstopmode
\wlog{BEGIN BIBLIOGRAPHY}
\showbox\bibbox
\wlog{END BIBLIOGRAPHY}
\printbibliography
\end{document}
It works like a charm, including the .log display:
BEGIN BIBLIOGRAPHY
> \box26=
\hbox(65.92384+60.92383)x345.0
.\mathon
.\vbox(65.92384+60.92383)x345.0
..\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
...\hbox(0.0+0.0)x0.0
....\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:
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mydebug}[2013/01/09 Debugging biblatex styles]
\let\origprintbibliography\printbibliography
\renewcommand\printbibliography[1][]{
\newsavebox\bibbox
\savebox\bibbox{\parbox{\textwidth}{\oldprintbibliography[#1]}}
\showboxbreadth\maxdimen\showboxdepth\maxdimen\errorstopmode
\wlog{BEGIN BIBLIOGRAPHY}
\showbox\bibbox
\wlog{END BIBLIOGRAPHY}
\oldprintbibliography[#1]
}
But sadly, I'm failing at patching \printbibliography. Could someone enlight my path? :)
:)– Paulo Cereda Jan 09 '13 at 16:29