Skip to content

Vimtex using Lazy.nvim causes problems with detecting the structure of the text inside a .tex file. #2698

@JxJxxJxJ

Description

@JxJxxJxJ

Description

Hello, I use LunarVim and recently there has been an update that switched from using Packer to Lazy as plugin managers. This seemed to cause problems with vimtex (as explained here, vimtex is not meant to be lazyloaded, but I'm not certain that such is the case right now).

The current problem I'm encountering is this, it's very hard to replicate (it's very inconsistent) but happens enough times to be really hard to work on .tex files. So for example with a simple align* enviroment. This should be used inside text and not in mathmode, so

\begin{align*}
  a_{11} x_1 +  \dots + a_{{1n} }x_{n}   &=  b_1  \\
   \vdots  &=  \\
   a_{m1}  x_1  +  \dots  + a_{{mn}} x_{n}  &= b_{m} 
\end{align*}

But the inconsistencies are that, if I just copy and paste it, chances are that the text is not understood properly as that it should be in mathmode
image

But it's inconsistent, for example if I put $ $ around the enviroment (which is wrong) to trigger the text to be inside mathmode and then remove it I have this, which is more correct
image

The problem of discerning text from mathmode I believe happens mostly inside inline math
image

Here the text inside \text { } should be white, as it happens when it is inside displaymath.

I'm not 100% sure that the Vimtex + Lazy combo is causing the problem, so this issue is more to ask you where to start with debugging this (if that's not the case).

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Linux 6.2.12-arch1-1
  Vim version: NVIM v0.9.0
  Has clientserver: true
  Servername: /run/user/1000/lvim.166525.0

VimTeX project: algebra
  base: algebra.tex
  root: /home/jx/Escritorio/notas-latex/algebra
  tex: /home/jx/Escritorio/notas-latex/algebra/algebra.tex
  main parser: fallback current file
  document class: report
  packages: algorithm2e amsbsy amsfonts amsgen amsmath amsopn amssymb amstext amsthm array atbegshi atbegshi-ltx atveryend atveryend-ltx auxhook babel bigintcalc bitset bookmark calc cancel catchfile centernot color comment enumitem environ epstopdf-base eso-pic etexcmds etoolbox expl3 fancyvrb float framed fvextra geometry gettitlestring graphics graphicx hycolor hyperref ifluatex ifmtarg ifoddpage ifplatform iftex ifthen ifvtex import infwarerr inputenc intcalc keyval kvdefinekeys kvoptions kvsetkeys l3keys2e letltxmacro lineno listings listingsutf8 lscape lstmisc ltxcmds mathtools mhsetup minted mleftright multicol nameref newpxmath pdfcol pdfescape pdflscape pdflscape-nometadata pdfpages pdftexcmds pgf pgfcomp-version-0-65 pgfcomp-version-1-18 pgfcore pgffor pgfkeys pgfmath pgfrcs pgfsys refcount relsize rerunfilecheck setspace shellesc stringenc tcolorbox textcomp theoremref tikz tikz-cd tikzfill-common tikzfill.image tikzsymbols titletoc transparent transparent-nometadata trig trimspaces uniquecounter upquote url varwidth verbatim xcolor xfrac xifthen xkeyval xparse xspace xstring xtemplate
  compiler: latexmk
    engine: -pdf
    options:
      -shell-escape
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 33
      output: /tmp/lvim.jx/RTEXTT/0
      cmd: max_print_line=2000 latexmk -shell-escape -synctex=1 -interaction=nonstopmode -pdf -pvc -view=none -e '$compiling_cmd = ($compiling_cmd ? $compiling_cmd . " ; " : "") . "echo vimtex_compiler_callback_compiling"' -e '$success_cmd = ($success_cmd ? $success_cmd . " ; " : "") . "echo vimtex_compiler_callback_success"' -e '$failure_cmd = ($failure_cmd ? $failure_cmd . " ; " : "") . "echo vimtex_compiler_callback_failure"' 'algebra.tex'
      pid: 176173
  viewer: Zathura
    xwin id: 0
    cmd_start: zathura  -x "/usr/bin/nvim --headless -c \"VimtexInverseSearch %{line} '%{input}'\"" --synctex-forward 2729:1:'/home/jx/Escritorio/notas-latex/algebra/algebra.tex' 'algebra.pdf'&
  qf method: LaTeX logfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions