0

I use biber and I like the output most of the time; but it seems to be hard (if at all possible) to modify the created bbl-file by hands.

Is there a way to use biber (or an other program like that) to produce a readable tex-file with the bibliography?

From the comments it seems that the answer is "no". But maybe there is at least partial "yes"?

  • 1
    The .bbl is not something you should modify by hand. (There have been some very complicated questions here where it was necessary to modify the .bbl, that can be done by a script.) There are many ways to tweak what Biber does though, the most famous one being Biber's sourcemaps. If you can point to a specific problem, I'm sure there are better solutions that to modify the .bbl manually. – moewe Nov 25 '15 at 15:17
  • @moewe, sure you are right, but still: creating a readable tex-file does not seem too much to ask, and I am sure it could be useful (not only for me). Say maybe there is a way to create a readable tex-file from the created .bbl? – Anton Petrunin Nov 25 '15 at 15:21
  • A readable .tex file would be next to useless I think, because you can get an output in the actual document, and any modifications to it would not have an effect on the document. In fact the .bib format is the human readable and editable format of the bibliography. – moewe Nov 25 '15 at 15:23
  • 1
    The bbl is readable tex and you could modify it. So where exactly is your problem? – Ulrike Fischer Nov 25 '15 at 15:33
  • Yes, bbl is readable, but sometimes you get unexpected output which would be easy to modify assuming biber would produce a readable file. – Anton Petrunin Nov 25 '15 at 15:38
  • 1
    Unexpected output is normally a problem at the source (.bib file) and that is where it should be corrected. In some cases source-mapping can help us there. All the information and formatting in the .bbl is needed for biblatex to work correctly and as expected, anything you throw away for readability's sake will obstruct one of biblatex's functions. You also need to remember that only the .bbl is consumed by biblatex, changing something that comes after the .bbl is not going to have an effect on other output. – moewe Nov 25 '15 at 15:45
  • @moewe You keep saying that biber and biblatex are better than me --- I do not agree. – Anton Petrunin Nov 25 '15 at 16:00
  • What I'm saying is that biblatex and Biber are the better tools in this case. I cannot really think of a case where it would be useful to edit the .bbl file (except for the one I hinted at above, but you wouldn't want to do that manually). Maybe your use case can convince me that it is really necessary to modify the .bbl? Most of the stuff that ends up in the .bbl comes more or less directly from the .bib, why not edit that? – moewe Nov 25 '15 at 16:05
  • 3
    The bbl-file is a temporary file which is recreated and overwritten quite often. Even if you don't get the wanted output: changing the bbl to get some output is error prone and tedious manual work and so should be done only in desperate cases. It is imho quite good that biber doesn't make it easy to you: it force you to find a better solution. – Ulrike Fischer Nov 25 '15 at 16:24
  • @UlrikeFischer Biber/biblatex does very simple task converting one format to an other --- I do not understand why not to make it human-readable and I hope there is a human-readable alteranitive (For sure I do not want it to be a .bbl-file) – Anton Petrunin Nov 25 '15 at 20:54
  • Simple Task? Biber is doing unicode sorting, hashing and comparing author lists, creates initals of names and unique labels. And biblatex is then doing some very sophisticated formatting. I don't see what you would gain to get some other format - biblatex formats the bbl, another file would not be used. – Ulrike Fischer Nov 25 '15 at 21:42
  • @UlrikeFischer biber is good, but could you explain me, why it is done this human-unfriendly way? Why not to make a tex-file as an output with readable bibliography? – Anton Petrunin Nov 25 '15 at 22:00
  • 2
    Because biblatex has to process the bbl and biblatex is not a human. It is biblatex that does all the formatting, it inserts the punctuation etc not biber. This make it possible to configure the output on the latex side and not -- as with bibtex through bst-files. – Ulrike Fischer Nov 25 '15 at 22:24
  • @UlrikeFischer in other words because those who wrote biblatex did not want to think :) – Anton Petrunin Nov 26 '15 at 11:29
  • 1
    That's a very impolite remark. Write something better if you feel so superior. – Ulrike Fischer Nov 26 '15 at 11:31
  • Do you mean that you just want a readable bibliography? You can just use the biblatex reading or verbose styles in your document. They basically present the .bbl data as verbosely and "readable" as possible. – PLK Nov 28 '15 at 08:01
  • @UlrikeFischer Would you like to compile your comments here into an answer? – moewe Nov 28 '15 at 10:01
  • Can you explain your question more clearly? Normally, you modify the .bbx and .cbx files if you want to modify the output. But it sounds like you're looking for something like bibtex-to-plain.el (note: emacs required). Is this because you want to make some ad hoc interventions in your (printed) bibliography rather than use the normals means of fixing your .bib and/or adjusting the .bbx/.cbx or using the "user-level" biblatex commands? – jon Nov 28 '15 at 19:06

1 Answers1

4

I can't answer your question as it is quite unclear, what exactly you would like to change.

In general it is not a good idea to change the bbl manually as it is a temporary file which is recreated and overwritten quite often. Changing the bbl to get some special output is error prone and tedious manual work and so should be done only in desperate cases.

Some background regarding the format of the bbl generated by biber:

At the begin most of the work to format the bibliography was done by bibtex: It not only selected and sorted the entries themselves but inserted also commas, semicolons, commands like \em, \newblock, etc. This gave what you probably name a "human readable" bbl:

\bibitem{doody}
Terrence Doody.
\newblock Hemingway's style and {Jake's} narration.
\newblock {\em The Journal of Narrative Technique}, 4(3):212--225, 1974.

The problem with this approach was that is rather difficult to change the format. Normally you needed a new bst-file if you e.g. wanted the authors in small caps, or a space instead of a colon. But adapting bst-files is not easy.

So people created bst-file which gave a more generic output. E.g. \titlefont instead of a hardcoded \em etc.

The jurabib package did go one step further: With special bst-files it tried to give better access to the core data and to move some the formatting to the latex code. This gave better configuration features but a quite "unreadable" bbl output: It is a curious mix of bare data (numbers, names) and generic formatting instructions (\bibapifont):

\bibitem[{Doody\jbdy {1974}}%
         {The Journal of Narrative Technique, \Numbername~3, \volname~4, \jbsy
  {1974}}%
         {{0}{}{article}{1974}{}{}{}{212--225}%
          {1974}}%
         {{Hemingway's Style and {Jake's} Narration}%
          {}{}{2}{}{}{}{}{}}%
        ]{doody}
 \jbbibargs {\bibnf {Doody} {Terrence} {T.} {} {}} {Terrence Doody} {au}
  {sexless} {\bibapifont {Hemingway's Style and {Jake's} Narration}\bibatsep {}
  \bibJTsep \bibjtfont {The Journal of Narrative Technique}\ajtsep {}
  \artvolumeformat {4} \artyearformat {1974}\artnumberformat {3}
  \jbPages{212--225}} {\bibartperiodhowcited} \jbdoitem
  {{Doody}{Terrence}{T.}{}{}} {} {} \bibAnnoteFile {doody}

While jurabib was quite powerful the complicated mix of data and formatting in the bbl limited its use.

Then came biblatex. biblatex removed all formatting instructions from the bbl to style and tex code. bibtex and now biber are used only to prepare the bare data: They select and sort the bib-entries, extract the fields, compute hashes etc. The result is a (readable) bbl which shows the data but no formatting as all formatting is done later:

 \entry{doody}{article}{}
      \name{author}{1}{}{%
        {{hash=936cee5fdd47aac6238f650db8b23a07}{Doody}{D\bibinitperiod}{Terrence}{T\bibinitperiod}{}{}{}{}}%
      }
      \strng{namehash}{936cee5fdd47aac6238f650db8b23a07}
      \strng{fullhash}{936cee5fdd47aac6238f650db8b23a07}
      \field{sortinit}{D}
      \field{sortinithash}{78f7c4753a2004675f316a80bdb31742}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{annotation}{An \texttt{article} entry cited as an excerpt from a \texttt{collection} entry. Note the format of the \texttt{related} and \texttt{relatedstring} fields}
      \field{journaltitle}{The Journal of Narrative Technique}
      \field{langid}{english}
      \field{langidopts}{variant=american}
      \field{number}{3}
      \field{relatedstring}{\autocap{e}xcerpt in}
      \field{title}{Hemingway's Style and {Jake's} Narration}
      \field{volume}{4}
      \field{year}{1974}
      \field{related}{1e63d4bbc14872275675171be2dfa906}
      \field{pages}{212\bibrangedash 225}
      \range{pages}{14}
    \endentry

This clear separation between the data processing and the formatting has shown to be very powerful and extensible. It is e.g. easily possible to output an entry in different formats in one document. But it also mean that if you want to change the formatting you will have to do differently than with an old plain bbl.

Ulrike Fischer
  • 327,261
  • Thank you very much. The historical background is most illuminating. – moewe Nov 28 '15 at 14:40
  • Thank you great answer indeed. As the last hope: do you know what is happening between .bbl and the output. Is it possible to extract from it the intermediate form which contains all formatting, but still readable; ideally a tex-file which looks like ordinary bibliography? – Anton Petrunin Nov 28 '15 at 16:40
  • 3
    Yes I know what is happening, and no you will not get such a tex-file unless you want to invest much time to write an "output filter". You should really drop this idea. Whatever your real problem is: get on another track to solve it. – Ulrike Fischer Nov 28 '15 at 16:54