bibtool icon indicating copy to clipboard operation
bibtool copied to clipboard

Semantic Check: Unique field considers field = {value} different to field = "value"

Open kiryph opened this issue 4 years ago • 0 comments

According to http://www.bibtex.org/Format/ field values (tag content) can be written differently in a bibtex file

Title = {{Bib}\TeX} 
Title = "{Bib}\TeX" 
Title = "{Bib}" # "\TeX" 

Since the unique field check is a semantic check, IMHO it should treat them as the same and should report them as non-unique.

Example file

❯ cat unique_field_test.bib
@Manual{BibTool,
  title = 	 {BibTool},
  author =	 {Gerd Neugebauer},
  year =	 "2019"
}
@Manual{BibTool,
  title = 	 "BibTool",
  author =	 {Gerd Neugebauer},
  year =	 "2019"
}
@ARTICLE{article-minimal,
   author = {L[eslie] A. Aamport},
   title = {The Gnats and Gnus Document Preparation System},
   journal = {\mbox{G-Animal\'s} Journal},
   year = 1986
}

❯ bibtool -- 'unique.field{title}' -o '' unique_field_test.bib

~/bibtool-as-linter
❯

I have read the comment https://github.com/ge-ne/bibtool/issues/61#issuecomment-535402283. So I expect that bibtool does not want to treat them this way. Then I would argue bibtool should complain about bibtex files with curly braces that they are not fully supported. Interestingly, the upstream test directory contains bibtex data with curly braces.

kiryph avatar Apr 21 '20 08:04 kiryph