5

Since the answer to the original question is "This is not possible", my new question is:

How do I write a shell script, in which I can define the original bib file, the fields in which new line characters should be replaced, the string with which they should be replaced and the name of the new bib file? I feel this should be possible using automated expressions. (If this question is not sufficiently tex-related, feel free to close it.)

The idea is to run this script before I call latexmk, to still be able to substitute new line characters with the \par command automotically instead of having to do it manually each time the bib file changes (the bib file itself is already created by an automated script).

Original Question:

In my bibliography, the abstract and annote fields will typically be several paragraphs long. The paragraphs are separated by two newlines

I want to print a reading list using biblatex.

If I parse the bib file with biber, biber will remove all newlines and render the fields as one long line.

This is expected behaviour and apparently has been the same in bibtex.

The question is: Is there an automatic way around it? More precisely, is there a way around it short from me manually adding macros instead of newlines into the bib file.

Initially, I filed a bug report on the biber development site because I assumed it must be a bug, but Philipp Kime suggested I ask whether there is a known way around it without changing biber.

3
  • I don't' see how a solution is possible without changing the bib files. Playing with sourcemap in biber does not seem to help, i.e., searching for \n\n, apparently the fields are already "normalised" at that stage.
    – Guido
    Nov 3, 2012 at 22:02
  • 1
    Yes, the data is already normalised in the bibtex way by the underlying btparse C library by this point. The only way round this is to put some sort of paragraph marker in the .bib files and then search/replace this with sourcemap.
    – PLK
    Nov 27, 2012 at 12:37
  • 1
    @PLK Can you make your comment into an answer?
    – egreg
    Mar 2, 2013 at 22:34

1 Answer 1

7

Biber uses the btparse C library for parsing bibtex data. In the usual bibtex way, whitespace and linebreaks are normalised in field values and so the only way to do this is to put some sort of special marker in for paragraph breaks and then use the biber sourcemapping feature to replace this with TeX macros to generate paragraph breaks when reading the bib data source. See the biblatex manual (for how to do source mapping via biblatex macros) or the biber manual (if you want to do the source mapping in the biber config file).

1
  • The source mapping route seems a bit of an overkill. If I put in a special marker, I might as well simply use \par or define a short \newcommand --- which is what I am doing so far as a workaround. Less code than the source mapping.
    – jjbornheim
    Mar 3, 2013 at 23:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .