Sublime Forum

No file configured for citer error

#1

Hi

Sorry to ask this as it is probably as basic as it gets. I wrote my phd thesis for years using sublime with citer and some other packages as well, no problem at all. I switched laptops and installed things all over again, but when trying to use citer I am having this error:

WARNING: No BibTex file configured for Citer

My user settings file is as follows. This laptop is running win11.

 {
  //REQUIRED:

 "bibtex_file_path": "D:\\litrev2.bib",    

  //OPTIONAL:

  //By default Citer Search looks for your keyword in the 
  //author, title, year, and Citekey (id) fields
  "search_fields": ["author", "title", "year", "id"] ,
  //Default format is @Citekey
  "citation_format": "@%s",
  //list of scopes. Could be top level "text" or "source", or limit to
  // e.g "text.html.markdown"
  "completions_scopes": ["text"],
  "enable_completions": true,

}

I tried with both forward slash and the two backslashes. Originally my bib file was somewhere else but I moved it to the D: root to figure out what I am doing wrong, to no avail.

Would love some suggestions as I really use citer a lot in my work flow.

Thanks in advance!

0 Likes

#2

Bumping for interest. I have tried on a Windows machine and a Linux based machine to no avail either. Other forum posts about Citer seem to deal with users (and so paths) of Macs.

I have also tried “/” and “\\” with neither successful.

0 Likes

#3

Still having the same issue as you! :frowning: I’ve gone into the code for citer and it is this block. I think it’s definitely something about the python code not recognising something about the filepath, but I am not savvy enough to really understand how to fix it, or at least how to skip it (I’d just yank the file I’d use…) if anybody can take a look and help, I’d really appreciate it!!

def refresh_caches():
    global _DOCUMENTS
    global _MENU
    global _CITEKEYS
    paths = []
    if BIBFILE_PATH is not None:
        if isinstance(BIBFILE_PATH, list):
            paths += [os.path.expandvars(path) for path in BIBFILE_PATH]
        else:
            paths.append(os.path.expandvars(BIBFILE_PATH))
    if _YAMLBIB_PATH is not None:
        paths.append(_YAMLBIB_PATH)

    if len(paths) == 0:
        sublime.status_message("WARNING: No BibTex file configured for Citer")
    else:
        # To avoid duplicate entries, if any bibfiles modified, reload all of them
        modified = False
        for single_path in paths:
            modified = modified or bibfile_modifed(single_path)
        if modified:
            _DOCUMENTS = []
            for single_path in paths:
                _DOCUMENTS += load_bibfile(single_path)

    _CITEKEYS = [doc.get('id') for doc in _DOCUMENTS]
    _MENU = _make_citekey_menu_list(_DOCUMENTS)
0 Likes

#4

the1 I got a working solution! it’s not fancypants, it’s ugly as sin, but it got citer working again.

Open citer.py (citer’s source code), go to line 167, and you will see something like:

BIBFILE_PATH = get_settings('bibtex_file_path', None)

Replace the ‘None’ with the full filepath to your .bix filel using double \, for example:

BIBFILE_PATH = get_settings('bibtex_file_path', 'C:\\litrev2.bib')

Save the file and give it a shot. It’s not nice, but it got citer to work again.

0 Likes

#5

Probably for historic reasons, the plugin replaces setting key bibtex_file_path by bibtex_file.

see: https://github.com/mangecoeur/Citer/blob/c07d9fabf17a214344250c9f843394fbc2ba3d78/citer.py#L152-L153

So using "bibtex_file": "D:\\litrev2.bib" should fix your issues without code changes.

0 Likes

#6

chef’s kiss!

Thanks for solving that without having to intervene the code! You have won the internets today!

0 Likes