Closed setchin closed 4 months ago
Thank you for the feature request. Unfortunately, this feature will very likely pollute the suggestion list if the class file does not include these bibs. Can you please help check whether the said bib file is present in the .fls file after compilation? If so, the extension should be able to pick it up.
Thank you for the feature request. Unfortunately, this feature will very likely pollute the suggestion list if the class file does not include these bibs. Can you please help check whether the said bib file is present in the .fls file after compilation? If so, the extension should be able to pick it up.
Hi, at least for the biblatex package with \addbibresource command, it will not input the file into .fls. The file name is however specified in .bcf with
`
We do not parse the .bcf
file but we do parse the .tex
files to look for \addbibresource
.
If I understand correctly your issue. It seems to come from custom dir location of your .bib
file. I think the setting latex-workshop.latex.bibDirs
should be helpful.
Manually adding \bibresource{path} to main.tex can solve the problem, however, it likely to cause package option clashes if the .cls file has loaded related packages, and it will cost much effort to modify the .cls file to make Intellisense work.
Surround the command\bibresource{path}
with \iffalse ... \fi
. It will be ignored by the LaTeX compiler but LW will take it into account.
Pre-checks*
The Missed*
Some latex templates include codes that set bibliography style, resolve bibliography file path, etc. In this case, LaTeX workshop cannot determine which bib file has been loaded, and Intellisense is disabled, similar to #3479.
Manually adding \bibresource{path} to main.tex can solve the problem, however, it likely to cause package option clashes if the .cls file has loaded related packages, and it will cost much effort to modify the .cls file to make Intellisense work. (Or you have to always comment out the line before compiling)
The Solution*
Would it be possible to allow Intellisense for all detected bib files defined in bibDirs? It is possible that users do forget to set sthe correct file path and cite bib items from a not included file, but LaTeX will throw explicit warnings about undefined references, which I believe is much more easier to debug. A safer way could be adding a switch to turn this feature on.
Anything Else?