-
Notifications
You must be signed in to change notification settings - Fork 391
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
VimtexTocOpen sometimes adds a spurious extension to filenames #2126
Comments
It is very difficult to debug a problem if I can't reproduce it. Could you try to find a reliable manner in which you can reproduce the problem you are experiencing and provide a minimal example? |
Edit: @lervag has updated this comment to inline the minimal example. Given the following files:
With the following contents: main.tex \documentclass[12pt,article,draft]{memoir}
\usepackage{import}
\import{/some/path/other-dir/}{file-that-calls-bib-file.tex}
\begin{document}
Hello.
\end{document} other-dir/file-that-calls-bib-file.tex \usepackage{biblatex-chicago}
\addbibresource{/some/path/test.bib} test.bib @book{testkey,
author = {Me},
title = {A Book},
year = {2021}
} If you open |
First: I took the liberty of cleaning up your comments by inlining the example and deleting the unnecessary content. This helps me quickly refresh the context when I again consider the issue. Thank you for providing a minimal example! However, I still can't reproduce any issues. Can you
|
Thank you, I wasn't sure what information might be useful, but it is certainly clearer without every step in my thought-process. Here is a minimal vimrc file: test.vim
The issueThe issue is that when I open There are actually two problems with the output. The first is that the list of Included files in the TOC has only one entry, for If you widen the TOC, you see the second problem: the single entry in the TOC reads Maybe these two issues are related? |
Thanks for the update! I've tested with the test files provided by you. I have used the following structure: pwd
# /home/lervag/.local/plugged/vimtex/test/issues/2126
tree
# .
# ├── main.tex
# ├── sub
# │ └── imported.tex
# ├── test.bib
# └── test.vim Where the contents of the files are as specified by you, except with the paths changed according to the above file names and locations. I now open with As you can see, everything looks right. Can you test with a similar structure as the one I've used here (change the file names accordingly, and so on)? Perhaps I'm missing a minor detail? |
At the line Whether this slash can be omitted depends on the version of the package: https://tex.stackexchange.com/questions/44480/using-import-correctly |
Ah, yes: From 2020, the import package allows to remove the trailing I've fixed this now. |
That fixed it -- thank you! |
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 entrytex incl: general.header.tex.tex
.Relatedly, sometimes it ignores
FILEPATH
in the command\import{FILEPATH}{FILENAME}
, printing onlyFILENAME
rather thanFILEPATH/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 sameFILEPATH
, 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
The text was updated successfully, but these errors were encountered: