Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim.fn["vimtex#env#is_inside"]("document") not working when working on an \include-ed files that lack a \begin{document} #3037

Open
de-mirage2 opened this issue Oct 31, 2024 · 0 comments
Labels

Comments

@de-mirage2
Copy link

Description

After writing into the main-file \include{eras/period1} to include a sub-file period1.tex stored in /eras/, VimTeX doesn't recognize how typing into the sub-file eras/period1.tex works as a document, and that the sub-file doesn't require \begin{document} nor \end{document}.

As such, my LuaSnip snippets which depend on vim.fn["vimtex#env#is_inside"]("document") don't show up when editing eras/period1, since it can't find the \begin{document}.

Steps to reproduce

  1. Create a basic document in main.tex that has an include statement i.e. \include{subfolder/chapter1}
  2. Create a folder in the same directory i.e. subfolder
  3. Within the directory create a new file i.e. chapter1.tex
  4. Evaluate vim.fn"vimtex#env#is_inside" in any way possible - I used LuaSnip snippets to verify

Expected behavior

for vim.fn"vimtex#env#is_inside" to be evaluated as true and my snippets seen

Actual behavior

this doesn't happen

Do you use a latexmkrc file?

No

VimtexInfo

Sub-file:

System info:
  OS: Linux 6.8.2-arch2-1
  Vim version: NVIM v0.10.2
  Has clientserver: true
  Servername: /run/user/1000/nvim.1001420.0

VimTeX project: period4
  base: period4.tex
  root: /home/de_mirage/Classwork/HS/11th/USH/Notes/Period4
  tex: /home/de_mirage/Classwork/HS/11th/USH/Notes/Period4/period4.tex
  main parser: fallback current file
  document class: 
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: Zathura
    xwin id: 0
  qf method: LaTeX logfile

Main-file:
System info:
  OS: Linux 6.8.2-arch2-1
  Vim version: NVIM v0.10.2
  Has clientserver: true
  Servername: /run/user/1000/nvim.1005373.0

VimTeX project: APUSH_FN
  base: APUSH_FN.tex
  root: /home/de_mirage/Classwork/HS/11th/USH/Notes
  tex: /home/de_mirage/Classwork/HS/11th/USH/Notes/APUSH_FN.tex
  main parser: current file verified
  document class: memoir
  packages: array booktabs dcolumn delarray epstopdf-base etoolbox expl3 geometry gettitlestring graphics graphicx iftex ifvtex infwarerr keyval kvoptions kvsetkeys ltxcmds nameref pgf pgfcomp-version-0-65 pgfcomp-version-1-18 pgfcore pgffor pgfkeys pgfmath pgfrcs pgfsys refcount shortvrb tabularx textcase tikz trig verbatim xcolor xparse xpatch
  source files:
    APUSH_FN.tex
    Period4/period4.tex
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: Zathura
    xwin id: 0
  qf method: LaTeX logfile
@de-mirage2 de-mirage2 added the bug label Oct 31, 2024
@de-mirage2 de-mirage2 changed the title vim.fn["vimtex#env#is_inside"]("document") not working when working on an \include-ed files that lack a '\begin{document}' vim.fn["vimtex#env#is_inside"]("document") not working when working on an \include-ed files that lack a \begin{document} Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant