You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I do this with builddir being set to something other than the default, for example /tmp/:
$ cd /tmp/
$ mkdir -p a/a/a
$ mkdir -p b/b/b
$ vim b/b/b/b.tex
... (add "content" in)
$ vim a/a/a/a.tex
... (add some full TeX file and \input{/tmp/b/b/b/b.tex})
Example ========
%! TEX program = xelatex
\documentclass[12pt]{article}
\begin{document}
content
\input{/tmp/b/b/b/b.tex}
\end{document}
Then restart vim such that vimtex reparse the \input (why would this be necessary...?)
And start compilation in a.tex. Error message
Error detected while processing function vimtex#compiler#compile[4]..vimtex#compiler#start[7]..67[3]..70:
line 30:
E739: Cannot create directory: build_dir//../../../b
E739: Cannot create directory: build_dir//../../../b/b/b
Analysis:
\include does tell LaTeX to create new directory, \input does not.
So a program that include something outside the compilation directory and the build_dir (output directory) is unusual will fail to compile
(unless openout_a is set)
and there's no need for vimtex to handle that.
On the other hand, a program that input something outside the compilation directory is completely valid and there's no reason to support that.
Possible fix:
Silently ignore the attempts to create directories outside build directory?
Check if each included file is \input or \include, then create/not create folder accordingly?
Thanks, I can reproduce this now. I've gone for the first fix by filtering out directories that are not subdirectories of the project directory. It may not be fully appropriate, but I think it should be a sensible restriction here.
If I do this with
builddir
being set to something other than the default, for example/tmp/
:Then restart vim such that vimtex reparse the
\input
(why would this be necessary...?)And start compilation in a.tex. Error message
Analysis:
\include
does tell LaTeX to create new directory,\input
does not.(unless
openout_a
is set)and there's no need for vimtex to handle that.
Possible fix:
\input
or\include
, then create/not create folder accordingly?Originally posted by @user202729 in #2204 (comment)
The text was updated successfully, but these errors were encountered: