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

bib variables with '.' in name #54

Open
courtney-bryce-hilton opened this issue Mar 14, 2022 · 2 comments
Open

bib variables with '.' in name #54

courtney-bryce-hilton opened this issue Mar 14, 2022 · 2 comments

Comments

@courtney-bryce-hilton
Copy link

Hi, thanks for the great package.

I have found an edge-case that causes an issue with writing valid .bib files with df2bib. Specifically, I had a .bib entry that had 2 DOI values, like the following:

@Article{test2022,
doi = {DOI_PLACEHOLDER},
doi = {DOI_PLACEHOLDER2}
}

parsing this with bib2df, and then rewriting it with df2bib, then results in something like:

@Article{test2022,
doi = {DOI_PLACEHOLDER},
doi.1 = {DOI_PLACEHOLDER2}
}

However, '.' is not a valid character for a variable name for .bib files (I think; at least had issues knitting a .rmd).

I suspect this would be an easy fix, where you could substitute '.' in variable names with '_' or something?

Cheers

@HedvigS
Copy link
Contributor

HedvigS commented Apr 3, 2024

I think this is caused by a tidyverse assumption when getting duplicate col names, reading through bib2df code now to see where this could be fixed.

@HedvigS
Copy link
Contributor

HedvigS commented Apr 3, 2024

On second though, I'm not sure this is really a bug. You shouldn't have duplicate fields in entries to start with, so the fact that something is breaking here may actually be a good thing as it alerts you to it.

You should be getting this warning:


Some BibTeX entries may have been dropped.
            The result could be malformed.
            Review the .bib file and make sure every single entry starts
            with a '@' 

What do you think @giabaio ?

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

No branches or pull requests

2 participants