python-bibtexparser
python-bibtexparser copied to clipboard
Add option to adjust alignment of text of multi-line values.
A new option align_multiline_values is added to BibTexWriter to enable whether text of multiline values should be aligned on top of each other. Indentation also considered _max_field_width.
Current behaviour: BibTeX entry:
@article{test,
title = {Hello World. I'm a very very very
very very very very long title. Hello Bibtex Parser!
This is still a long title!},
}
Parsing with BibtexParser will result in:
@article{test,
title = {Hello World. I'm a very very very
very very very very long title. Hello Bibtex Parser!
This is still a long title!}
}
When align_multiline_values is set to true, the output will be the
following:
@article{test,
title = {Hello World. I'm a very very very
very very very very long title. Hello Bibtex Parser!
This is still a long title!}
}
Hi @michaelfruth
I just joined the project - sorry for the long wait.
Before I start the full review - would you mind adding some unit tests to cover this functionality? Please also make sure the already existing indentation functionality works well with this.
Also, please pull master to enable running the test suite on the PR :-)
Thanks for opening the PR!
Thanks! I'll probably add some unit tests next week or two.
Hi @michaelfruth Do you have any updates?
I'm lacking behind my schedule. I didn't forget to write some tests, try to do this until the end of this week.
No worries! Thanks for the heads up, and for your contribution.
I've added some tests to test:
- the basic functionality
- the new functionality with
align_valuesandindent
I have also encountered this behavior #315 , I'm not quite sure if this is expected.