GithubHelp home page GithubHelp logo

Comments (6)

inkytonik avatar inkytonik commented on May 19, 2024

I have the same problem. I tracked it down to @comment entries in my .bib file. These entries are inserted by BibDesk to keep track of reference groups. The lines that cause the problem for me are:

@comment{BibDesk Smart Groups{

The completion code looks for lines that start with @ and then expects to be able to match them with this regexp:

    kp = re.compile(r'@[^\{]+\{(.+),')

which requires a comma at the end of the line. For the comment lines, this crashes producing the error that you are seeing (or at least I get the same message).

I work-around the problem by adding a ? after the comma in the regular expression. This allows completion to work, with a side-effect that the comment prefix is also offered up as a completion.

A proper fix would be to have a more complex check that lines beginning with @ are actually bib entries, not something else such as a comment.

from latextools.

msiniscalchi avatar msiniscalchi commented on May 19, 2024

Oh goodness... and I thought I had tamed bib files :-( I can't promise a quick fix but I'll take a look. I am thinking about parsing the file differently for other reasons anyway...

from latextools.

neilernst avatar neilernst commented on May 19, 2024

After seeing #50, I wanted to add that my two bib files do not have @comment, but the longer one has a 2 line header

Automatically generated by Mendeley 1.3.1
Any changes to this file will be lost if it is regenerated by Mendeley.

and the 'abbr' file is a series of @string entries (these convert 'variables' in bib files to longer strings, e.g. ACM = "Associ. Computing Machinery"

from latextools.

msiniscalchi avatar msiniscalchi commented on May 19, 2024

Closing for now, as this may be solved with new parsing code (please be patient)

from latextools.

margru avatar margru commented on May 19, 2024

I suggest the following fast fix (at least, it is working for me):
line 369 of latex_cite_completions.py
keywords = [kp.search(line).group(1).decode('ascii','ignore') for line in bib if line[0] == '@']
should be changed to
keywords = [kp.search(line).group(1).decode('ascii','ignore') for line in bib if line[0] == '@' and kp.search(line)]

from latextools.

 avatar commented on May 19, 2024

Thanks, that solved my problems with Bibdesk generated bib files.

from latextools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.