-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 align_values allows int or bool, fixes previous min alignment #316
Conversation
I have not forgotten this one - and I have also noticed your comments in the other PRs :-) Regarding this PR: There's an edge case I still need to test & lay out to you. I'm quite busy atm, but hope that I can get back with you ASAP. Sorry for the wait - and thanks for your contribution! |
Excuse my late answer and thanks again for your PR. There's an edge case of which I am not sure how it should be handled: Assume someone specifies an
I guess this would be more closely to what I'd expect given the naming What do you think? Any reasons to prefer the current implementation? |
@michaelfruth - I guess we'll be able to take this over to v2, hence I recommend we continue with this PR (also merging it into 1.x) |
Not sure if this (again) ready for review. But in case it is - could you fix the merge conflict first? Would allow to run the actions :-) |
Fixes sciunto-org#315 The `align_values` of the BibTexWriter now accepts a bool or int value. If the bool value `true` is specified, the maximal number of characters used in any fieldname is used as length. If a integer value is specified, the greater of the specified integer value and the overall maximal number of characters used in any fieldname is used. This commit also fixes the previous behaviour of align_values which results in a breaking change. The `ENTRYTYPE` entry was considered for calculating the maximal number of characters, which always lead to a minimum value of `9`. Now, keys that are not written into the BibTex output are ignored which leads to an exact computation of the fieldname lengths. Example: ``` @book{abc123, a = {test}, bb = {longvalue} } @book{abc123, a = {test}, bb = {longvalue} } ```
9025f68
to
61e895c
Compare
Now PR is ready for review again 👍 |
Fixes #315
Aligns all values according to a given length by padding with single spaces. If align_values is true, the maximum number of characters used in any field name is used as the length. If align_values is a number, the greater of the specified value or the maximum number of characters used in any field name is used as the length.