Closed randolf-scholz closed 6 months ago
\subfix
is not supported. You may consider file a feature request on that and showing an example of the directory structure with latex examples indicating how the bib file should be located.
@James-Yu I assume some form of pattern matching is used? Because the following ridiculous workaround seems to function:
\usepackage[backend=biber]{biblatex}
\addbibresource{\subfix{bibliography.bib}}
\newcommand{\ignore}[1]{\relax}
\ignore{\addbibresource{bibliography.bib}}
To detect the name of the .bib
file, we scan the content of the command \addbibresource
, which fails if the content is a macro.
I thought the .fls
could help but maybe not. I will look into it.
Can't one just add an optional capture group here to add \subfix
support:
I modified the line in my local ~/.vscode/extensions
to
const bibReg = /(?:\\(?:bibliography|addbibresource)(?:\[[^[\]{}]*\])?){(?:\\subfix{)?([\s\S]+?)}(?:\})?|(?:\\putbib)\[(.+?)\]/gm;
and that seems to work.
No. Also need to consider compiling from subfile.
@James-Yu The simple patch
const bibReg = /(?:\\(?:bibliography|addbibresource)(?:\[[^[\]{}]*\])?){(?:\\subfix{)?([\s\S]+?)}(?:\})?|(?:\\putbib)\[(.+?)\]/gm;
seems to work, I can compile both main and chapters and I get autocomplete for \cite
in both main and chapters.
Pre-checks*
Environment*
The Issue*
I am using a multi-file project via
subfiles
. Following the manual, I include the bibliography via:However, then citation autocomplete fails, both in the main file and in included chapters.
Reproduction Steps
main.tex
chapters/chapter1.tex
Notably, autocomplete becomes available again, if
\addbibresource{bibliography.bib}
is used instead of\addbibresource{\subfix{bibliography.bib}}
(even in the subfiles!), but then only themain.tex
file can be compiled successfully.