-
Notifications
You must be signed in to change notification settings - Fork 388
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
Latexmk Crashes After Loading the Second File in a Multi-File LaTeX Project #176
Comments
Hi @gkapfham, and thank you for submitting this (and the other) issue(s)! This helps me to remove bugs and to improve the plugin, for which I am grateful. It seems I might have pushed a buggy commit, for which I am sorry. I just want to inform you that I don't have that much time right now. vimtex is developed on my spare time, and right now my spare time is limited. I'll look into this issue as soon as possible! Hopefully within the end of this week. Then I'll work my way through your other issues when time permits. |
One question: So far my projects usually had all tex files contained in one directory which is why I don't know how to use the texroot marker if % !TEX root = minimal.tex Would it make a difference if you declare Also, am I right in assuming that this problem should occur any time one starts |
It seems three ( #176, #177, #178) of your current issues basically rest on one problem: multi file projects with tex files in different sub dirs. But as this one here seems to be the central one, I'm going to answer here again. I can reproduce your problem of vimtex losing track of the cohesion between complex multi-file projects if I seperate the tex files over various levels of directories. This leads to On the other hand, when I keep all tex files in the same folder, there is no problem. You can switch buffers easily, Due to this, it seems that multi-directory projects are not supported by Maybe this can be a way forward for you? Otherwise, we'll have to wait until @lervag will find some time to look into this. |
Hello @nasenatmer, thanks for your feedback! I have taken your suggestion and created my own minimal working example that has all of the files in the same directory. However, I see the same behavior as I reported in the first description of this issue. That is, once I go into the subfile called There are several other key issues that I should draw out as part of my response to your points. First, I have been able to get mutli-file projects -- organized in exactly the format that I outlined in my first statement of the issue -- to work for several months of time when using vimtex. Second, this functionality only stopped working in, say, the past one to two weeks after I did an update of vimtex. Also, it may be the case that the other issue you referenced has a solution to my stated issue; however, it requires me to use different LaTeX packages and I would like to avoid rewriting a lot of LaTeX code that worked in a previous version of vimtex. Finally, if I run |
Alright, I wasn't aware that complex multi-file projects™ (as I will call them from now on to refer to those of yours that span over at least two hierarchies of directoriers) did work with vimtex before. I fully agree with you that rewriting your papers to use It is still interesting, though, that I can't observe the problematic behaviour on Arch with With
|
In addition, I am writing to let you know that I have noticed the same reported behavior when I am compiling a main file that uses a bibliography and the bibliography changes. That is, |
Ok, I think I found the problem. In c5d0066 I added some bad initialization code for the latexmk module. I've pushed an update now that seems to fix the problem. Please test and verify if this solves the present issue. |
Btw: The problem was that I reset the PID stored in vimtex. Note that this meant that the latexmk process still exists in the system and was NOT properly stopped by vimtex. Thus this will lead to more problems, especially if you then start a new latexmk process on the same project. |
After using vim-plug to update vimtex (I see "- vimtex: 2 files changed, 18 insertions(+), 12 deletions(-) That is, I still see that Later, I will also try the new fix with some much more complex LaTeX documents. But, for right now, it seems that, at least on my Ubuntu 14.04 machine, I cannot confirm that the issue is resolved. |
That is strange. When you do
|
It seems that I do have output just like what you have:
Thanks for working on this late in the evening, @lervag! I really appreciate your help. |
I'm sorry, it seems I was too quick. It now works with my usual |
Ah, I see what is happening now. If you add If your main vimrc file does |
I can confirm that adding There is one interesting wrinkle to note about the debugging output. If I run With that said, this is an extremely minor issue that does not concern me at all. I simply brought it to your attention in case you might see this as being important. I will try many more large LaTeX documents and report back on my results. At least for now, it seems as though this temporary fix of |
It seems I have already solved this problem as best I can: The code already parses all buffers to check if the current buffer is the last one for a project before it kills the process. That is, it seems Regarding the |
Hello again @lervag, I am writing to confirm that all of the changes that you made in the past few days seem to have completely resolved this issue. I can now use vimtex with the minimal working example and with several complex multiple-file LaTeX documents. As I revisit past documents that I have written (most in a similar style to the minimal working example), I will update this issue if I find a case where these fixes did not work correctly. Thanks! |
Hi @gkapfham, I am happy to hear that the issue is resolved. Thanks for raising it and for providing all the examples and settings necessary to address the issue! Btw: I think it is often better to open a new issue if you have follow-up problems and instead reference this issue. That makes it easier to keep the issues focused. |
Once again, thank you for your hard work in the vimtex plugin! I have used it in the past several months to write many papers using LaTeX and vim. Recently, I upgraded vimtex using vim-plug and found that some of the basic features on which I rely no longer work correctly.
Before I go into the details about the problem that I am facing, I will share some of the configurations of the environments in which I have noticed concerns. Currently, I am running Ubuntu 14.04 LTS and I can reproduce the problems described in this issue both with Ubuntu's standard version of vim and a new version of vim that I built from source a few days ago.
Here is the version of vim provided by Ubuntu:
Here are some more details about this version of vim:
Here is the version of vim that I recently compiled:
Here are some more details about this version of vim:
I have also created a minimal .vimrc file; you will notice that it is only slightly different than the one that people commonly use when reporting issues about vimtex.
By default, this version will call
xdg-open
and this will lead to the loading ofevince
. I also have a.latexmkrc
file that I took from @lervag's GitHub repository of configuration files and enhanced slightly with other configurations that I found in the discussion of issues for vimtex.The vast majority of the LaTeX documents that I write are divided into multiple files. I followed the vimtex guidelines to add headers to the top of a subfile so that it is clear which file is the main file. To reproduce the fault that I am having on complex LaTeX documents, I have produced the following minimal working example.
First, there is a file that is called
minimal.tex
:Then, there is the file called
first.tex
that is in thesections
directory:Now, if I load the
minimal.tex
file into vim and press<leader>ll
to start the compilation of the paper inlatexmk
I would see the following debugging output, as an example:Now, if I go into the buffer that contains the
first.tex
file and press<leader>li
to get the debugging information again, then I would produce this output:As you can see,
latexmk
has crashed and updates to this file will not be seen in the PDF that has already been loaded inevince
. Typing the<leader>lg
command also confirms thatlatexmk
is no longer running correctly.If I try to restart background compilation by going back to the main file and repeating the above steps, I find that the compiler starts running correctly for the minimal working example. However, when I try all of these steps with larger LaTeX papers that contain many files and many pages, then I have to restart
latexmk
every time I enter a new file in thesections
directory (I could not discover the reason why this behavior is different and decided that the aforementioned issues were important enough that I would go ahead and submit the issue now).Again, I should stress that this behavior only appeared after a recent update to vimtex. Before that point, I have been able to successfully work on many papers that are structured in the same way as the minimal working example.
Can you please advise on what I need to do to ensure that vimtex starts to work correctly again?
The text was updated successfully, but these errors were encountered: