# Visualize bibliography entry process of biblatex

I'm currently working on modifying the `verbose` `biblatex` style to my needs. In order to find out what's going on and to find the definitions I need to modify, I've been digging through a number of files, climbing higher and higher in the "hierarchy": From `verbose.bbx` to `authortitle.bbx` to `standard.bbx` to `biblatex.def` to `biblatex.sty`. Since it's pretty troublesome to find out and remember what comes from where, I've been wondering if there is a way to visualize the various levels of definition of a bibliography.

What I have in mind is a bibliography with some entries of different entry types, but instead of actual bibliographic information, only the way the different fields are definied in the various files is displayed, perhaps with different colors, depending on which file definied the current bit, e.g. the variable that eventually outputs a comma after the author. This way, it'll hopefully be easier to understand how a bibliography entry ends up being as it is and to find out what might need to be changed. I guess in the end, it would be exactly what happens when `\printbibliography` is processed during the multiple compilation: All variables from the various files replaced by their definitions except for the actual bibliographic information, but without any commands being excecuted, just the code being printed.

I hope my CS-ignorant description is somewhat clear; if not, I can try to come up with an example of what I mean.

• This is definitely a non-answer, but the BibLaTeX user documentation is extremely well written, and the code is usually very clear, with commands that have rather predictable names. But I agree that it does take some getting used to. – ienissei Jan 10 '12 at 23:21
• Are you manually reading those files or using a package like `trace`? tex.stackexchange.com/a/548/10748 may be of help – propaganda Jan 15 '12 at 2:35
• @propaganda: I was reading them manually, the `trace` package looks interesting, I'll have to look into that. If you like to, go ahead and post an answer how `trace` can be used for tracing biblatex processes. – doncherry Jan 16 '12 at 11:48

As parsing of `TeX` can only reasonably be carried out by `TeX` alone, it is highly unlikely that a full visual debugger the way you describe it can be developed in a reasonable time. All is not lost though. `Biblatex` generates two useful files during execution that give a good indication of what is happening under the hood.

The `.log` file and an `XML` file that provides useful information. The `xml` file is named as `jobname.run.xml`. A partial listing is shown below:

`````` <requires type="static">
<file>blx-compat.def</file>
<file>biblatex.def</file>
<file>debug.bbx</file>
<file>debug.cbx</file>
<file>biblatex.cfg</file>
<file>american.lbx</file>
<file>english.lbx</file>
</requires>
``````

All files and dependencies during the run are described in the XML file. It is actually not very difficult to apply an XLST style sheet and view this in the browser.

The `.log` file, as always is your friend. Here you can view for example the re-definitions and the loading of all the depended files.

``````("C:\Program Files\MiKTeX 2.9\tex\latex\biblatex\cbx\debug.cbx"
File: debug.cbx 2011/07/29 v1.6 biblatex citation style
Package biblatex Info: Redefining '\cite'.
Package biblatex Info: Redefining '\parencite'.
Package biblatex Info: Redefining '\footcite'.
Package biblatex Info: Redefining '\footcitetext'.
Package biblatex Info: Redefining '\smartcite'.
Package biblatex Info: Redefining '\textcite'.
Package biblatex Info: Redefining '\supercite'.
Package biblatex Info: Redefining '\cites'.
Package biblatex Info: Redefining '\parencites'.
Package biblatex Info: Redefining '\footcites'.
Package biblatex Info: Redefining '\footcitetexts'.
Package biblatex Info: Redefining '\supercites'.
Package biblatex Info: Redefining '\textcites'.
)
Package biblatex Info: Trying to load configuration file...
Package biblatex Info: ... file 'biblatex.cfg' found.
``````

Lastly, in many cases it is quite useful to run the file with the `biblatex` debug option.

``````\usepackage[style=debug]{biblatex}
``````

This will produce output showing all the keys. In most cases this is adequate to trace the source of problems.

As you gather there is a lot of debugging information available. It is not in nice round boxes but is all available and much is to be gained by pondering over other people's code. Useful programming techniques can be borrowed especially so from a programmer like Philip Lehman.