-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Bibliography package improvements on BibTeX syntax #2048
Bibliography package improvements on BibTeX syntax #2048
Conversation
404719d
to
ebbfd5d
Compare
c1fb0c7
to
37c050f
Compare
37c050f
to
cf4f446
Compare
433bce2
to
9e4e8fd
Compare
So this first PR is focused low-hanging fruits, regarding the support of more Bib(La)TeX syntax elements without breaking existing working behavior yet:
Later, I'll want to refactor some of the code and reorganize the files differently, in order to tackle properly with issues that will change the output, but this first step should be a decent base for the work to come, and it remains minimally readable (which would become harder after reshuffling some of the logic in different files). Ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I'm fine with this as is, the comments I made were more because I didn't understand why you did something than because it has to change. You decide.
The commits I pushed are just automatically generated code formatting from stylua
with git absorb
. The fixup commits should apply to touchup the original commits if you rebase this branch for any reason, or I can too before merging.
I'll be out of pocket for the next week so I can't do much work (maybe a couple of mobile phone based scanning), but if having this merged will facilitate the ongoing work in this direction I can make that happen.
Just a side note on the Lua style thing.... when you see me push those kind of fixups just know there is absolutely no need to to make an effort to preserve them. If you happen to have other work in a commit or branch and my style fixups are causing rebase conflicts or anything like that just keep the work you have and blow the code formatting fixes away. They are 100% automated and next to zero work to redo at any point, so don't stress if they are causing conflicts. And don't stress about getting the formatting right while writing code either, whatever is easier to write you can write, the auto formatter can take it from any Lua code that runs. |
7a549e1
to
bf7fd96
Compare
… bibliography Note that we do not support here expanding "xdata=" contructs inside other fields i.e. the "granular" per-field inheritance supported by BibLaTeX and originally Biber, expanding xdata=key-field-index inside other field values, which requires list fields (e.g. author) to already have been split and parsed...
Skip `@preamble` as done for `@comment`. The `@preamble` command is used to provide TeX or LaTeX macros that are processed by BibTeX program, but it is unspecified what to do with these when converting to a format that does not use TeX. See sile-typesetter#2051
Support `@string` blocks in a bibtex file, and the use of the thus defined strings in other entry fields. Supports concatenation with the "#" operator. As part of the syntax clean-up, all content between entries is now skipped (it doesn't need to start with a percent sign, everything that is not an entry is a comment. See sile-typesetter#2051
Add (a part of) the BibLaTeX data inheritance rules for cross-references. Use BibLaTeX field names, but still support the legacy BibTeX file names. As part of these refactors, allow loading more than one bibliography file.
Accept `\&` for compatibility with legacy BibTeX, but do not mandate it to be escaped for compatibility with other engines. Support unescaped `~` as a non-breaking space for compability with TeX, this is often found in existing bibliography files. Support `\~` to render a tilde. XML-escape the input so it can safely be wrapped in a `<sile>` construct. Closes sile-typesetter#2050 Closes sile-typesetter#1860 (replaced by this implementation)
Test `@preamble`, `@xdata`, `@string`, string concatenation with hash `#`, `xdata` and `crossref` fields. This test file is already insanely long, so rather than adding new tests, I preferred hacking a few existing entries: The result should thus meet the same expectation although the bibtex file encodes the information slightly differently.
bf7fd96
to
d59535e
Compare
Branch for some bibliography package fixes and improvements
Let's start gently and see where / how it goes.
Closes #2021
Closes #2051
Closes #2050
Closes #1860