texlab
texlab copied to clipboard
paths of bibliography and bibliography styles
How can I set the path of the bibliography and bibliography styles to be searched by texlab
. More specifically, when I go with the cursor under each of the bibliography file and hit M-enter
in emacs, texlab
opens the underlying file. How does it know about the path? It seems that texlab
searches in the path texlive/2021/texmf-dist/doc/latex/translation-europecv-de/templates
and give it a higher priority.
Also, texlab
does not suggest bibliography style files nor bring a documentation for it.
Thanks for the report.
texlab
uses the following mechanism to resolve paths when including files:
- First, it tries to find the referenced file inside the current workspace. The workspace is basically a dependency graph of all user-defined files. To find the root file,
texlab
walks up the directory tree until it finds a TeX file with adocument
environment. The child files are found using the location of the parent file, the working directory, the optional "root directory" setting and the optional "aux directory" setting. - If
texlab
does not find a suitable file in the workspace, then it looks for a file that is part of the TeX distro. It does so by parsing thekpsewhich
database (thels-R
files intexlive
). Generally, executingkpsewhich somefile.tex
should yield the same result. For packages and classes,texlab
does not consultkpsewhich
for performance reasons. Instead, it has a custom built cache that contains the exposed commands and environments for each package and document class.
Concerning bibliography styles: currently, texlab
does not provide completion for those but it should not be too complicated to add them to the completion and the hover requests.
Thanks for detailed reply. I think there is some ambiguty in the way that texlab
populates these file names. For instance, I have defined this directory ~/texmf
to follow the same latex tree. Under this folder, I put my bib
files, exactly here: ~/texmf/bibtex/bib/base
. This later folder includes the following bib files booksIhave, AAtmpAA, NewPublications, Books
(all with extension bib
). However, only the first two are recognized by texlab
(so that when I click M-enter
underneath it opens them). Please, see the attached snap for visual interpretation.
Do you have the files mentioned listed in the kpsewhich database? What happens if you call kpsewhich NewPublications.bib
? Does it output the correct path? Where do you have your TeX file located? Is it part of the same directory tree or somewhere else?
The kpsewhich
when applied to each of these files, gives the correct path of each of them. The tex
file is not located in the same directory tree (/texmf/bibtex/bib/base
) as the four bib
files. It is located in ~/Downloads/SomeFolder
Hi, is there some solution for this issue? I have the same problem that I have a folder with many bib files while the tex files are at a different location. kpsewhich
is able to detect them as I put the bibtex folder into the BIBINPUTS variable in my .zshrc
. The vimtex plugin is also able to find them. Only texlab shows Error:11:Undefined reference
all over the place.
@JaRoSchm With #912, texlab
will now load the bibliographies from the BIBINPUTS
environment variable.
Thank your very much! From my point of view this could be closed. However, I don’t really now about the original issue.
I tried the new version today and it works indeed. However, I didn't mention that the bib files in this folder contain around 20000 items as it is shared by a group of people. This slows down texlab extremely. The completion using vimtex works much faster after the second completion as they are using some kind of caching of bibtex items. Would this also be possible to implement here?
Would this also be possible to implement here?
@JaRoSchm Thanks for testing it out! Large bibliographies currently have the following problems:
- Unnecessary reparses when editing those files due to duplicate file watcher events (can be fixed with a debouncer)
- Checking for diagnostics can be slow if there are too many errors/warnings in the file (can be fixed by limiting the number of reported errors (easy fix)
- Filtering the completion items is very slow (switching to
fst
for the filtering should help here). Caching the items is not the issue here (this is already done).
I am currently working on this issue.
@JaRoSchm Can you try out #917, please? It should speed up completion by a lot.
@pfoerster I just tried it and this actually improved the performance such that there is no noticeable delay anymore. Thank you very much!