Vimtex: Unmatched “}” on tabular cell format options for paragraph

Created on 5 Feb 2021  ·  11Comments  ·  Source: lervag/vimtex

Issue
Closing curly-bracket undetected on tabular cell format options for paragraph, with output "<- unmatched “}”" (see image below);

issue screenshot

isolated issue code: https://pastebin.com/5A6gMfhP

Context
The code is following a tutorial on latex and it compiles correctly outside vim (i.e. with texmaker), so my hypothesis is that it may be related to vimtex;

:VimtexCompileOutput
https://pastebin.com/8rGn9fQn

.vimrc (content relevant to the issue only)
https://pastebin.com/w746K5dw

I would like to know if I am missing something and/or if you could provide me with a solution for this problem.
Thank you.

All 11 comments

Hmm. I've thought the p{..} was only available when you used the tabularx package. Notice that the syntax works if you add this package.

I'll update and add this as part of the core syntax.

Essentially, the following is allowed:

\documentclass{minimal}

\begin{document}

\begin{tabular}{|l|p{2cm}|}
  \hline
  Lorem ipsum & Lorem ipsum dolor  \\ \hline
\end{tabular}

\end{document}

I updated vimtex and now the tabular p{..} format option works as intended (i.e. the .tex file compiles correctly). Using the tabularx package, as you suggested, corrects the highlighting.

The syntax error message for unmatched “}” still remains though, along with others that are raised as a consequence from the unmatched “}”, thus hindering the whole syntax checking process.

I installed neomake and used it instead of syntastic, the output is the same and i’m in doubt if this has to do with the syntax checkers (or even any other component) and not vimtex itself.

vim screenshot:
vim_neomake_screenshot

compiled file screenshot:
compiled_tex_file_excerpt

It would be neat if the syntax checkers did not call on this error, since it is not valid. Wondering if this is possible and if it is indeed a vimtex issue?

The syntax error message for unmatched “}” still remains though, along with others that are raised as a consequence from the unmatched “}”, thus hindering the whole syntax checking process.

Ah, but that is not Vimtex. I suspect you use ALE or something similar with lacheck as a linter. At least, the message implies lacheck here, and Vimtex does not have any auto linting features (you can run lacheck with compiler lacheck then make, see :help vimtex-lint).

That is correct, I was using syntastic, switched to neomake (both of them using lacheck) and the problem still persisted.

I disabled all linting plugins, ran :compiler lacheck|lmake, as you've suggested and still got the same result:

vim_lwindow

I disabled all linting plugins, ran :compiler lacheck|lmake, as you've suggested and still got the same result:

Yes, exactly as expected. lacheck is _not_ Vimtex. So if you think this is wrong by lacheck, then you should contact lacheck's maintainer, not me. :)

That’s all. Thank you for answering and developing Vimtex.

Btw, as noticed earlier, the tabular environment was not supported correctly. I have made some corrections that at the very least should make Vimtex more consistent with a plain LaTeX file and with the array and tabularx packages.

That’s all. Thank you for answering and developing Vimtex.

Great, and my pleasure. I'm happy you find it useful.

Btw, as noticed earlier, the tabular environment was not supported correctly. I have made some corrections that at the very least should make Vimtex more consistent with a plain LaTeX file and with the array and tabularx packages.

I’ve updated Vimtex and can confirm that. Now, without importing tabularx, the highlighting is correct and it does not present an issue.

I am new to TeX and hadn’t covered the checkers yet, that was what I was missing. Meanwhile, I’ve switched from lacheck to chktex, which does not display any warning or error for unmatched “}” and although I have just started using it, personally find chktex output more fitting.

Great, and my pleasure. I'm happy you find it useful.

Bridging Vim and TeX is extremely useful. Thank you.

Btw, as noticed earlier, the tabular environment was not supported correctly. I have made some corrections that at the very least should make Vimtex more consistent with a plain LaTeX file and with the array and tabularx packages.

I’ve updated Vimtex and can confirm that. Now, without importing tabularx, the highlighting is correct and it does not present an issue.

Thanks, I appreciate that you also tested and confirmed this.

I am new to TeX and hadn’t covered the checkers yet, that was what I was missing. Meanwhile, I’ve switched from lacheck to chktex, which does not display any warning or error for unmatched “}” and although I have just started using it, personally find chktex output more fitting.

Thanks for the info. I don't really use these checkers myself, but it is useful to know of you experience.

Great, and my pleasure. I'm happy you find it useful.

Bridging Vim and TeX is extremely useful. Thank you.

Agreed; your welcome!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carloabelli picture carloabelli  ·  3Comments

LuxGiammi picture LuxGiammi  ·  3Comments

adimanea picture adimanea  ·  5Comments

itsShnik picture itsShnik  ·  5Comments

lervag picture lervag  ·  5Comments