Skip to content
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

Allow multiple .bib files #87

Open
Oblomov opened this issue Jun 15, 2022 · 6 comments · May be fixed by #94
Open

Allow multiple .bib files #87

Oblomov opened this issue Jun 15, 2022 · 6 comments · May be fixed by #94

Comments

@Oblomov
Copy link

Oblomov commented Jun 15, 2022

Hello,

thank you very much for the useful extension.

Would it be possible to support multiple source .bib files? I keep my bib data grouped into separate files, and being able to use these directly would allow me to use it as-is rather than trying to merge it, which is not always easy (e.g. because of conflicting bibtex string macros).

I'm guessing that this could be implemented either by allowing :bibtex-file: to take multiple values (in which case the blbliography::[] macro would then output the combined data) and/or by expanding each bibliography::somefile.bib[] into the bib data taken from that specific file.

@ProgramFan
Copy link
Contributor

This sounds reasonable since bibtex also supports multiple bib files. We can support this through multiple values in :bibtex-files: attributes. Since I am running out of time, the implementation may be late. A PR is highly welcome.

@lorrden
Copy link

lorrden commented Nov 5, 2022

We often classify references in 'applicable documents' and 'reference documents' with different citation styles (e.g. AD.1, RD.1).

The ideal is to put these in separate bibliography files, and IIRC we managed to do something like this in biblatex.

Note that asciidoctor-bibliography has multiple bibliography file support already.

@lorrden
Copy link

lorrden commented Nov 25, 2023

Question, since I might have time to look at this. How would we allow multiple files being specified and what precedent would we have for duplicated bib-keys?

We could add a bibtex-files attribute that is parsed as a YAML list, or something like that. Alternatively, we can do the same with the existing bibtex-file attribute? Is there a preference here as to how to deal with lists in the attribute?

I would be inclined to first ensure we have multiple bib-files, and turn all the bibliography file reference to arrays. When citing something, the search order would be to start with he first file in the added attribute.

A later patch could group them (like supported by asciidoctor-bibliography)

@mojavelinux
Copy link
Member

that is parsed as a YAML list, or something like that.

The convention in AsciiDoc is to make it a comma-separated list. An attribute value cannot accommodate all the formatting of a YAML value, so it's best not to lead users into the belief that it can. And there are other places in the AsciiDoc ecosystem where comma-separate values are used to pass multiple items.

@lorrden
Copy link

lorrden commented Nov 25, 2023

I got something initial working with a basic unit test, I would appreciate a pre-review (it is not sufficiently tested yet, I just added one unit test for it), before I finish this.

I am not super fluent with ruby yet... 😉

master...lorrden:asciidoctor-bibtex:master

Can I create a PR and mark it as a draft or something (like with gitlab)?

@mojavelinux
Copy link
Member

Yes, GitHub has that feature.

(Please note that I am not the maintainer of this project, I am just adding my input).

@lorrden lorrden linked a pull request Nov 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants