latex-lsp / texlab

An implementation of the Language Server Protocol for LaTeX
GNU General Public License v3.0
1.55k stars 53 forks source link

[BUG] Undefined reference even though its defined in tabularray #1159

Open peng1999 opened 4 months ago

peng1999 commented 4 months ago

The following code gives undefined reference error by texlab even though its defined:

\documentclass{article}

\usepackage{tabularray}

\begin{document}
\begin{tblr}[
    tall,
    caption = {A Caption},
    note{a} = {This is a note.},
    label = {tbl:long},
]{ccc}
    \hline
    Alpha & Beta & Gamma \\
    Delta & Epsilon & Zeta \\
    Eta & Theta & Iota \\
    \hline
\end{tblr}

See Table~\ref{tbl:long}.
\end{document}
brunobmello25 commented 4 months ago

can confirm this is also happening with biber:

% main.tex

\documentclass{article}

\usepackage[backend=biber]{biblatex}

\addbibresource{references.bib}

\begin{document}

\nocite{ref1}
\printbibliography

\end{document}
% references.bib

@book{ref1,
  title = {Title},
  author = {Author},
  year = {2024},
  publisher = {Publisher},
}

This results in an undefined reference error in the main.tex file

lnay commented 1 month ago

This results in an undefined reference error in the main.tex file

I believe this is a different issue. Your example works fine for me, try adding an empty .texlabroot file in the same directory.

lnay commented 1 month ago

The original error also happens with labels defined in square brackets for an lstlisting:

\lstinputlisting[
    caption={A caption},
    label={listing:ref},
]{snippet}

The error is texlab: Undefined reference as opposed to a warning relayed from a build.

I'm assuming texlab only picks up labels from explicit \label{...} commands and not ones implicitly created by another package.