5

Is there an established way to spell check .bib files? There's a previous question on spell checking TeX files but I could not find much about .bib files.

I use aspell to spell check my .tex files. Running aspell on a .bib file is very tedious as aspell is not aware of the syntax. I tried extracting only the title fields with bash (grep '\btitle = {' bibliography.bib | sed 's/title =//g' | sed 's/{//g' | sed 's/},//g' | sed 's/}//g'), but this is not entirely satisfactory either. My .bib file is rather long (about 26000 lines), and I have many non-English citations. Is there a good way to filter .bib files by language?

Spell checking only the citations used in a particular paper would be more manageable. I've seen recommendations to spell check the .bbl file, but aspell handles this worse than it does .bib files. Limiting just to titles is okay (grep '\field{labeltitle}\|\field{title}' file.bbl | sed 's/\\field{labeltitle}{\([^}]*\)}/\1/g' | sed 's/\\field{title}{\([^}]*\)}/\1/g' | sed 's/{//g' | sed 's/},//g' | sed 's/}//g') but I'd rather spell check the entire citation (without resorting to some absurdly long bash command to parse the .bbl file).

Any ideas would be appreciated.

  • Mhhh, I guess spell checking for .bib files is not so simple. Only very few of the fields in a .bib file can be spell checked: title, location (maybe journal). Names don't really lend themselves to spell checking, and even the titles of scientific papers may contain many words that are too much for your average spell checker (without you adding them). The second thing is that you have to double check your .bib file for correctness anyway, this is a job that can hardly be automated and involves checking the order of names, the entry type etc. ... – moewe Feb 8 '18 at 6:26
  • ... So when you are doing that you might as well check if the spelling is the same as on the work you cite. That said, Biber and I assume also bibtool can filter .bib files by language and can also remove fields you are not interested in, but they can't do a spell check for you. – moewe Feb 8 '18 at 6:26
  • I'll look into filtering and making a better script to extract the fields of interest. Thanks. – Ben Trettel Feb 9 '18 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.
https://tex.stackexchange.com/questions/414233/spell-checking-bibtex-databases
tex.stackexchange.com
crawl=CC-MAIN-2019-35
131986
application/http; msgtype=response
sha1:7FZ6DPLPTOZIMQUVKEFCCAXJWWR5KEUW
<urn:uuid:467aec06-809f-4a1b-ac89-f83901a3bbec>
2019-08-21T08:05:21Z
151.101.193.69
text/html
sha1:HAU37YL5F7PEKV6QXGUP6WSDHMZSNVNL
<urn:uuid:df51e5d3-96ac-45ef-ba12-cc2af0ab56bd>
https://tex.stackexchange.com/questions/414233/spell-checking-bibtex-databases
response
<urn:uuid:027b368c-21e1-4c25-b450-576c94ac685c>
isPartOf: CC-MAIN-2019-35
publisher: Common Crawl
description: Wide crawl of the web for August 2019
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-85.ec2.internal
software: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/