This question is actually a follow-up to another question of mine, Patching \printbibliography for displaying content to both document and log. The code works marvellously, and I'm able to analyze the text formatting for every entry. The tricky part is how to separate where an entry ends and the other one starts:
...
...\T1/cmr/m/n/10 2
...\T1/cmr/m/n/10 0
...\T1/cmr/m/n/10 1
...\T1/cmr/m/n/10 2
...\T1/cmr/m/n/10 .
...\penalty 10000
...\glue(\parfillskip) 0.0 plus 1.0fil
...\glue(\rightskip) 0.0
..\penalty -51
..\glue 4.0 plus 2.0 minus 1.0
..\glue(\parskip) 0.0
..\glue(\baselineskip) 4.50183
..\hbox(7.49817+2.49939)x324.44702, glue set 0.4662, shifted 20.55298
...\hbox(7.49817+2.49939)x0.0
....\glue 0.0
....\glue -10.55298
....\glue -10.0
....\hbox(7.49817+2.49939)x10.55298
.....\glue 0.0 plus 1.0fil minus 1.0fil
.....\T1/cmr/m/n/10 [
.....\T1/cmr/m/n/10 2
.....\T1/cmr/m/n/10 ]
....\glue 10.0
...\penalty 0
...\T1/cmr/m/n/10 A
...\T1/cmr/m/n/10 u
...\T1/cmr/m/n/10 t
...
Since I know beforehand that my bibliography style uses [1], [2] and so forth, I can easily spot where the new item starts. But I was thinking if I could append a keyword to every item, so I can use it as a closing markup.
In the chatroom, Marco Daniel brilliantly suggested me to go with:
\renewbibmacro*{finentry}{\finentry <keyword here>}
This will append <keyword> to every bibliography item. So far, it's an interesting approach. But there's something I'd like to avoid: the keyword will also be printed in both document and .log file.
Sadly, \wlog doesn't work here because the box content is saved for a later use. The macro will be called when the entries are added to the .aux file and not during the box trace.
My test file:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,
bibstyle=numeric-comp,
sorting=none]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{xpatch}
\makeatletter
\def\biblio@inlog#1{%
\begingroup
\let\biblio@inlog\@gobble
\chardef\current@mode\interactionmode
\showboxdepth=\maxdimen
\showboxbreadth=\maxdimen
\sbox\z@{\vbox{\printbibliography[#1]}}
\batchmode
\wlog{BEGIN BIBLIOGRAPHY}
\showbox\z@
\wlog{END BIBLIOGRAPHY}
\interactionmode=\current@mode
\endgroup}
\xapptocmd{\blx@printbibliography}{\biblio@inlog{#1}}{}{}
\makeatother
\begin{document}
\cite{companion} \cite{ctan}
\printbibliography
\end{document}
Does anybody have a suggestion if I can add any keyword or mark that indicates the end of a bibliography item in the .log output, but not in the document? I suspect this is not possible or the box saving process must be drastically altered.