GithubHelp home page GithubHelp logo

hesstobi / atom-autocomplete-latex-cite Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 8.0 195 KB

Autocomplete+ Support for Bibtex References in Latex

License: MIT License

CoffeeScript 46.97% CSS 4.13% TeX 7.37% JavaScript 41.53%
atom atom-package autocomplete-plus bibtex latex

atom-autocomplete-latex-cite's People

Contributors

aerijo avatar bbbrumley avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hesstobi avatar mayhewsw avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

atom-autocomplete-latex-cite's Issues

I am also having this exact problem, on the most recent versions of atom and autocomplete-latex-cite:

I am also having this exact problem, on the most recent versions of atom and autocomplete-latex-cite:

Atom: 1.45.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.3
Thrown From: autocomplete-latex-cite package 0.3.5

Stack Trace

Failed to activate the autocomplete-latex-cite package

At Total of weights cannot exceed 1

Error: Total of weights cannot exceed 1
    at e.value (/packages/autocomplete-bibtex/node_modules/fuse.js/dist/fuse.js:9:3409)
    at /packages/autocomplete-bibtex/node_modules/fuse.js/dist/fuse.js:9:2634)
    at /packages/autocomplete-latex-cite/lib/cite-manager.coffee:41:13)
    at /packages/autocomplete-latex-cite/lib/cite-provider.coffee:12:16)
    at Object.provide (/packages/autocomplete-latex-cite/lib/main.coffee:21:19)
    at Package.activateServices (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:3224971)
    at Package.activateNow (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:3222013)
    at string.e.trim.length.activationHookSubscriptions.add.packageManager.onDidTriggerActivationHook (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:2607)
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1214120)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1215561)
    at PackageManager.triggerDeferredActivationHooks (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:382896)
    at activatePromise.Promise.all.then (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:381647)

Commands

Non-Core Packages

advanced-open-file 0.16.8 
atom-beautify 0.33.4 
atom-python-run 0.9.7 
autocomplete-latex-cite 0.3.5 
busy-signal 2.0.1 
ex-mode 0.18.0 
Hydrogen 2.14.1 
hydrogen-python 0.0.8 
hydrogen-run 0.1.1 
ide-python 1.5.0 
intentions 1.1.5 
language-fortran 2.1.10 
language-latex 1.2.0 
latex 0.50.2 
linter 2.3.1 
linter-gfortran 1.0.0 
linter-spell 0.15.0 
linter-spell-latex 0.11.0 
linter-ui-default 1.8.1 
python-tools 0.6.9 
vim-mode-plus 1.36.4 
vim-mode-plus-macros 0.1.2 

Originally posted by @mmmikemon in #19 (comment)

An in-range update of fuse.js is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The dependency fuse.js was updated from 3.5.0 to 3.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

fuse.js is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 2 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Support `@...` syntax

I think it would be really neat if your citation provider could activate following a @, much like referencing people in markdown. If you were to include this as an optional feature, it should not cause any harm to those who just disable it.

Having said that, it would probably take some a lot of effort. I'm willing to help out where I can, but I'm not too familiar with coffeescript. I've already implemented a basic version in my autocomplete-latex package, but it lacks the power of your parsing of the .bib file and formatting the resulting completions. Currently, when the prefix is detected to start with an @, it looks for a path to the .bib file. If found, it takes the valid labels and presents them in the autocomplete popup. Choosing one replaces something like @1.1 with \parencite{1.1}, or whatever citation command the user sets.

Maybe your completions functions can be bundled up and exposed as a provider? This way, I could consume it and give it the prefix, and it would return the correct completions. You also wouldn't have to worry about replacing the @ with the correct cite command, as I would do that on my end.

I understand if you feel this isn't worth the effort. I think that being able to make things like this is part of what makes Atom good though. And if you don't have any time to spare, I'll give my best shot at it and make a PR :)

Unable to parse bibtex file...

It appears that the bibtex parser is unable to handle string substitutions: i.e., the entry

@string{ prd = "Phys. Rev. D"}
@Article{	  alexander:2000:bgi,
  author	= "S. Alexander and Robert H. Brandenberger and D. Easson",
  title		= "Brane gases in the early universe",
  journal	= prd,
  volume	= 62,
  pages		= "103509",
  year		= 2000,
}

causes the error

Unable to parse Bibtex file /Users/lsfinn/Documents/Repositories/git/Research/GWAstro/Manuscript/bib/art.bib. It will be ignored for autocompletion. (Value expected: single_valueprd, volume = 62, pages = "103509", year = 2000, } for key: prd)
But,

@Article{	  alexander:2000:bgi,
  author	= "S. Alexander and Robert H. Brandenberger and D. Easson",
  title		= "Brane gases in the early universe",
  journal	= "Phys. Rev. D",
  volume	= 62,
  pages		= "103509",
  year		= 2000,
}

parses without problem.

Failed to activate the autocomplete-latex-cite package

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.38.2 x64
Electron: 2.0.18
OS: Mac OS X 10.13.6
Thrown From: autocomplete-latex-cite package 0.3.2

Stack Trace

Failed to activate the autocomplete-latex-cite package

At Cannot find module './ts-compiled/command-aliases'

Error: Cannot find module './ts-compiled/command-aliases'
    at Module._resolveFilename (module.js:543:15)
    at Module._resolveFilename (/Applications/Atom.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:155156)
    at Module.require (/app.asar/static/index.js:53:43)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146462)
    at /packages/autocomplete-latex-cite/node_modules/latex-to-unicode-converter/index.js:6:10)
    at /packages/autocomplete-latex-cite/node_modules/latex-to-unicode-converter/index.js:17:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147172)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150720)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:60:45)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146462)
    at /packages/autocomplete-latex-cite/lib/lite-bibtex-parse.js:32:31)
    at /packages/autocomplete-latex-cite/lib/lite-bibtex-parse.js:373:40)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147172)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150720)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:60:45)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146462)
    at /packages/autocomplete-latex-cite/lib/cite-manager.coffee:7:15)
    at /packages/autocomplete-latex-cite/lib/cite-manager.coffee:1:1)
    at /packages/autocomplete-latex-cite/lib/cite-manager.coffee:1:1)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147172)
    at Object.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150720)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)

Commands

Non-Core Packages

autocomplete-json 5.5.2 
autocomplete-latex-cite 0.3.2 
docker 0.8.0 
gpp-compiler 3.0.7 
language-latex 1.2.0 
latex 0.50.2 
latex-autocomplete 1.1.1 
pdf-view 0.71.0 

Manually trigger re-cache of database

Hi,
I really like using this package, since it works extremely well in a large project where multiple files are edited without each one having the \bibliography added.
But one thing would be really helpful:
I work with one .bib file where all references are stored. When I add publications to it, this package does not have any knowledge about the change. The only way I have so found so far to re-parse the .bib file is to restart atom, which is rather impractical.
It would be great to have a keybind or searchable action to trigger re-caching once I added a couple of references to the .bib file, so I can continue writing without needing to restart atom.
Cheers!

autocomplete only picking up cite keys, not author or title words

Greetings,

I stumbled on your package today, and if I can get it to work, I may switch from TexShop (I am running on a mac). In the example shown in the readme, the autocomplete suggestions seem to show cite keys where the name of the cite key does not match at all the word being typed in the doc. Specifically, you type \cite{Kundur} and one of the suggestions is Anonymous:2005p1240. I am guessing that Kundur is one of the authors of the paper associated with Anonymous:2005p1240. Am I correct? If so, then my autocomplete seems to be not working properly and only picks up the cite keys where the text I type matches the key (if I type An then Anonymous:2005p1240 would be a suggestion).

If this is not supported behavior, it would be nice to have the autocomplete match against all fields in a citation, such as authors and title etc. I'd be happy to try and do this, but this is my first foray into modifying atom packages, so suggestions are welcome, such as what file would I even modify to add these options? My guess was lib/lite-bibtex-parse.js, but I wasn't sure.

Regards,
Andre

this.string is not a function

I just installed this package and immediately received the message

Unable to parse Bibtex file /Users/dpo/tex/reports/working/sqd-ssy-overleaf/sqd-ssy.bib. It will be ignored for autocompletion. (this.string is not a function)

My BibTeX file defines several @strings.

The only occurence of this.string in the code is here. I don't see any method named string. Is there a typo? Or something missing?

No autocomplete, no errors/warnings

I installed autocomplete-latex-cite via the Atom package installer. It doesn't present any errors or warnings, but I get no autocomplete suggestions. It works on a separate computer.

Anything I can try, or place to look for errors that could identify what is going on? Running macOS high sierra.

Markdown?

I'd be very interested in using this package for markdown documents -- is this something you plan in the future?

An in-range update of latex-to-unicode-converter is breaking the build 🚨

The dependency latex-to-unicode-converter was updated from 0.5.2 to 0.5.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

latex-to-unicode-converter is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Fails to activate

The package fails to activate upon installation.

Atom: 1.37.0 x64
Electron: 2.0.18
OS: Mac OS X 10.14.5
Thrown From: autocomplete-latex-cite package 0.3.2

Stack Trace

Failed to activate the autocomplete-latex-cite package

At Cannot find module './ts-compiled/command-aliases'

Error: Cannot find module './ts-compiled/command-aliases'
    at Module._resolveFilename (module.js:543:15)
    at Module._resolveFilename (/Applications/Atom.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:154765)
    at Module.require (/app.asar/static/index.js:40:43)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146072)
    at /packages/autocomplete-latex-cite/node_modules/latex-to-unicode-converter/index.js:6:10)
    at /packages/autocomplete-latex-cite/node_modules/latex-to-unicode-converter/index.js:17:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146782)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150329)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146072)
    at /packages/autocomplete-latex-cite/lib/lite-bibtex-parse.js:32:31)
    at /packages/autocomplete-latex-cite/lib/lite-bibtex-parse.js:373:40)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146782)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150329)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146072)
    at /packages/autocomplete-latex-cite/lib/cite-manager.coffee:7:15)
    at /packages/autocomplete-latex-cite/lib/cite-manager.coffee:1:1)
    at /packages/autocomplete-latex-cite/lib/cite-manager.coffee:1:1)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146782)
    at Object.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150329)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146072)
    at /packages/autocomplete-latex-cite/lib/cite-provider.coffee:1:15)
    at /packages/autocomplete-latex-cite/lib/cite-provider.coffee:1:1)
    at /packages/autocomplete-latex-cite/lib/cite-provider.coffee:1:1)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146782)
    at Object.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150329)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146072)
    at Object.provide (/packages/autocomplete-latex-cite/lib/main.coffee:20:22)
    at Package.activateServices (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:3424358)
    at Package.activateNow (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:3421479)
    at string.e.trim.length.activationHookSubscriptions.add.packageManager.onDidTriggerActivationHook (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:2445)
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1174290)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1175731)
    at deferredActivationHooks.triggeredActivationHooks.forEach.e (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:382852)
    at Set.forEach (<anonymous>)
    at PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:382814)
    at /Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:901281
    at r (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:895887)
    at n (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:1043884)
    at ChildProcess.o.process.on.e (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:1044090)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

Commands

     -2:35.9.0 core:cancel (input.hidden-input)
  2x -2:35.4.0 core:move-down (input.hidden-input)
  2x -2:34.3.0 core:move-up (input.hidden-input)
     -2:33.6.0 core:move-down (input.hidden-input)
     -2:31.3.0 core:save (input.hidden-input)
     -2:18.6.0 intentions:show (input.hidden-input)
  2x -2:17.6.0 core:move-down (input.hidden-input)
     -2:14.6.0 core:move-up (input.hidden-input)
     -2:14.2.0 intentions:confirm (input.hidden-input)
  3x -2:13.2.0 core:move-down (input.hidden-input)
     -2:11 core:save (input.hidden-input)
 42x -2:07.2.0 core:move-up (input.hidden-input)
 58x -2:05.1.0 core:move-down (input.hidden-input)
 14x -2:02.3.0 core:move-up (input.hidden-input)
  2x -1:47.3.0 linter-ui-default:toggle-panel (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-dark-ui)
     -0:53 core:backspace (input.hidden-input)

Non-Core Packages

atom-latex 0.8.5 
atom-terminal-panel 4.4.4 
autocomplete-latex-cite 0.3.2 
busy-signal 2.0.1 
intentions 1.1.5 
language-latex 1.2.0 
latex 0.50.2 
linter 2.3.0 
linter-spell 0.15.0 
linter-spell-latex 0.11.0 
linter-ui-default 1.7.1 
multi-wrap-guide 1.1.6 
script 3.18.1 

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.