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

\cite completion and .bib file globbing #1658

Closed
gipert opened this issue Apr 7, 2020 · 7 comments
Closed

\cite completion and .bib file globbing #1658

gipert opened this issue Apr 7, 2020 · 7 comments

Comments

@gipert
Copy link

gipert commented Apr 7, 2020

Is your feature request related to a problem? Please describe it.

The \cite completion list is empty for me with the following MWE:

\documentclass{article}
\usepackage{biblatex}
\addbibresource{*.bib}
\begin{document}
Test
\end{document}

ref.bib

@article{Agostini2019b,
    author        = "Agostini, M. and others",
    archivePrefix = "arXiv",
    collaboration = "Gerda",
    doi           = "10.1007/JHEP03(2020)139",
    eprint        = "1909.02522",
    journal       = "JHEP",
    pages         = "139",
    primaryClass  = "nucl-ex",
    title         = "{Modeling of GERDA Phase II data}",
    volume        = "03",
    year          = "2020"
}

And it works as expected if I \addbibresource{ref.bib}. Can you reproduce?

Describe the solution you'd like

Would it be possible to add support for wildcards in the \addbibresource command? Or is there already some trick I can use to make this work?

lervag added a commit that referenced this issue Apr 7, 2020
@lervag lervag closed this as completed in 2efe806 Apr 7, 2020
@lervag
Copy link
Owner

lervag commented Apr 7, 2020

Hi. I was not aware that one could use wildcards in the \addbibresource command. Should work now, I think. Let me know if you find edge cases that do not work as expected.

@kiryph
Copy link
Contributor

kiryph commented Apr 7, 2020

For the record this requires biber and seems to behave slightly differently on Windows:

Excerpt form the manual of biblatex v3.14 Dec 2019

3.7 Bibliography Commands

3.7.1 Resources

\addbibresource[<options>]{<resource>}
Adds a <resource>, such as a .bib file, to the default resource list. This command is
only available in the preamble. It replaces the \bibliography legacy command.
Note that files must be specified with their full name, including the extension. With
biber, the resource name can be a BSD-style glob pattern.
This only makes sense
when resources refer to files with an absolute or relative path and does not work when
looking for data resources in biber s input/output directories or with resources
located by <kpsewhich> etc. When running on Windows, biber will switch to a
Windows compatible globbing mode where backslashes are also useable as path
separators and case does not matter
.

@lervag
Copy link
Owner

lervag commented Apr 7, 2020

For the record this requires biber and seems to behave slightly differently on Windows:

Bah, why is everything so complicated. Perhaps a better solution is to not allow globbing, and instead add a different mechanism for this? Also related to #1653, I guess?

@kiryph
Copy link
Contributor

kiryph commented Apr 7, 2020

IMHO if people collaborate on the same tex document, they should only use a simple glob pattern, nothing platform dependent.

However, if you work on your own document on Windows, you might expect that you can use backslashes as path separator. This is something I suspect someone will eventually raise an issue. You could fix it then.

@lervag
Copy link
Owner

lervag commented Apr 7, 2020

Ok, so leave things as they are now and address future issues if they arise. Seems OK to me.

@gipert
Copy link
Author

gipert commented Apr 7, 2020

Works perfectly, as always! Thank you.

@lervag
Copy link
Owner

lervag commented Apr 7, 2020

Great, happy to hear it! )

TpmKranz added a commit to TpmKranz/vimtex that referenced this issue Apr 19, 2021
The fix in 2efe806 isn't used if biblatex
is detected, even though globbing is only possible with biblatex.

Since b7fbff1, that code path is only
used if there aren't better methods of detecting bib files.
That was okay because the only other method introduced was to parse
BibTeX's blg file and BibTeX can't handle globbing anyway.
But in 2536f04, support for biber's bcf
file was added without also adding globbing support.

Apparently, globbing can be disabled per resource, so filenames that are
candidates for globbing must be retained in the file list.
This should only have an effect with curly braces, though.
Globbing candidates that aren't actual filenames will be filtered out
with s:validate(), as before.
TpmKranz added a commit to TpmKranz/vimtex that referenced this issue Jul 7, 2021
The fix in 2efe806 isn't used if biblatex
is detected, even though globbing is only possible with biblatex.

Since b7fbff1, that code path is only
used if there aren't better methods of detecting bib files.
That was okay because the only other method introduced was to parse
BibTeX's blg file and BibTeX can't handle globbing anyway.
But in 2536f04, support for biber's bcf
file was added without also adding globbing support.

Apparently, globbing can be disabled per resource, so filenames that are
candidates for globbing must be retained in the file list.
This should only have an effect with curly braces, though.
Globbing candidates that aren't actual filenames will be filtered out
with s:validate(), as before.
TpmKranz added a commit to TpmKranz/vimtex that referenced this issue Jul 8, 2021
The fix in 2efe806 isn't used if biblatex
is detected, even though globbing is only possible with biblatex.

Since b7fbff1, that code path is only
used if there aren't better methods of detecting bib files.
That was okay because the only other method introduced was to parse
BibTeX's blg file and BibTeX can't handle globbing anyway.
But in 2536f04, support for biber's bcf
file was added without also adding globbing support.

Apparently, globbing can be disabled per resource, so filenames that are
candidates for globbing must be retained in the file list.
This should only have an effect with curly braces, though.
Globbing candidates that aren't actual filenames will be filtered out
with s:validate(), as before.
lervag pushed a commit that referenced this issue Jul 11, 2021
The fix in 2efe806 isn't used if biblatex
is detected, even though globbing is only possible with biblatex.

Since b7fbff1, that code path is only
used if there aren't better methods of detecting bib files.
That was okay because the only other method introduced was to parse
BibTeX's blg file and BibTeX can't handle globbing anyway.
But in 2536f04, support for biber's bcf
file was added without also adding globbing support.

Apparently, globbing can be disabled per resource, so filenames that are
candidates for globbing must be retained in the file list.
This should only have an effect with curly braces, though.
Globbing candidates that aren't actual filenames will be filtered out
with s:validate(), as before.
lervag added a commit that referenced this issue Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants