Skip to content

VimtexTocOpen sometimes adds a spurious extension to filenames #2126

@alexandreroberts

Description

@alexandreroberts

I am experiencing an issue similar to this one: sometimes (not always) :VimtexTocOpen adds a spurious .tex to the end of filenames; for example, the line \import{FILEPATH}{general.header.tex} results in a TOC entry tex incl: general.header.tex.tex.

Relatedly, sometimes it ignores FILEPATH in the command \import{FILEPATH}{FILENAME}, printing only FILENAME rather than FILEPATH/FILENAME.

So the issue seems to be how vimtex parses \import commands. Curiously, it sometimes works and sometimes does not work. I haven't been able to discern what is different about those cases (they all involve the same FILEPATH, which reads, in my case /Users/alexandre/Dropbox/TeX-Alex-custom-files/).

The reason I noticed this problem is that it makes vimtex sometimes unaware of the .bib files I load, thus making citation completion not work.

Output from VimtexInfo

System info
  OS: Mac OS X 10.15.6 (19G2021)
  Vim version: NVIM v0.5.0
  Has clientserver: true
  Servername: /var/folders/92/6c80fs_55hnf_1s2ybgbv5c40000gn/T/nvim5VO5rw/0

vimtex project: _souda-chemeia
  base: _souda-chemeia.tex
  root: /Users/robe941/Dropbox/Projects/1c-ABOUT-TO-SUBMIT/souda-chemeia-AlchByzVol
  tex: /Users/robe941/Dropbox/Projects/1c-ABOUT-TO-SUBMIT/souda-chemeia-AlchByzVol/_souda-chemeia.tex
  out: /Users/robe941/Dropbox/Projects/1c-ABOUT-TO-SUBMIT/souda-chemeia-AlchByzVol/_souda-chemeia.pdf
  log: /Users/robe941/Dropbox/Projects/1c-ABOUT-TO-SUBMIT/souda-chemeia-AlchByzVol/_souda-chemeia.log
  aux: /Users/robe941/Dropbox/Projects/1c-ABOUT-TO-SUBMIT/souda-chemeia-AlchByzVol/_souda-chemeia.aux
  fls: 
  tex program: xelatex
  source files:
    _souda-chemeia.tex
    sections/0-to-add.tex
    sections/1-intro.tex
    sections/2-body.tex
    sections-compiled-by-Makefile.tex
    sections/3-conclusion.tex
    _outline.tex
  compiler: latexmk
    backend: nvim
    output: /var/folders/92/6c80fs_55hnf_1s2ybgbv5c40000gn/T/nvim5VO5rw/1
    configuration: 
      continuous: 1
      callback: 1
      latexmk options:
        -verbose
        -file-line-error
        -synctex=1
        -interaction=nonstopmode
      latexmk engine: -xelatex
  viewer: General
  qf: LaTeX logfile
    config: 
      packages: 
        default: 1
      default: 1
  document class: memoir
  packages:
    chemformula
    geometry
    import

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions