-
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
VimTex can't find log file #2534
Comments
Currently, only the I'm curious, what's the point or idea behind using separate |
I'm using this option in order to separate the temporary output files in aux like the log, ... from the relevant outputs (i.e. pdf) put into gen. That allows me to declutter my directory tree. I commit the generated output into my git and the .aux output directory is cleanly hidden from view.
I think that stems from a mistake how this plugin handles the latexmkrc. The file is a perl script that is being executed at runtime and as such the build and aux dir are relatively unpredictable as they can be influenced by external circumstances quite easily. I for example use it to change the job name (name of output pdf) depending on whether this is a production or editing build. In the former I remove any notes, scribbles and co automatically. For exactly that purpose latexmk has the |
Ok, I agree this makes sense and I can understand that some people may want this type of workflow (even if I don't).
No, the reason only So, if I were to add support for a separation of the |
Hmm. I notice this in the
Specifically: This option seems to be only valid with MikTeX. That's unfortunate, and it makes me skeptical of putting in the effort to implement this - at least at a general level. Perhaps we can do it with some less rigorous manner, e.g. with a callback to allow user customization, or with an option to specify the location explicitly. |
Ah, sorry, I now understand the point of |
Sorry about the flow of comments. I'm writing them as I'm looking into this, instead of collecting at the end. I hope you don't mind too much! Now, with this simple $emulate_aux = 1;
$out_dir = "out";
$aux_dir = "aux"; and a minimal LaTeX file, I get the following output after compiling with
Notice specifically that the
So, from the last paranthesis, it seems this is the intended behaviour. Thus, to properly support the
|
Eh an easy example why this doesn't work. The |
Your reply is a little upsetting to me, because you respond to only a part of what I wrote, and you do so in a tone that comes off as somewhat "entitled". I believe I've written some sensible thoughts about how to proceed on this issue. Did you have any thoughts about the outline for how to proceed? Please note that the issue is more complicated than just the communication between Finally, please consider this: I've already spent quite a lot of time reading your original issue, thinking about it and writing some thoughts on how to possibly act in order to improve VimTeX in a way that could resolve your issue. I've also clearly stated that what you want will require substantial changes, which means it will take time. Time is a resource I unfortunately do not have very much of. I do like very much to work on and improve VimTeX for the sake of the users and community, as it is generally a rewarding experience in which I often learn interesting things. But when it does not feel rewarding, then why would I want to spend my time on it? |
Hey I'm sorry for the miscommunication. I haven't had much time to fully read and understand all you wrote and just answered on the most pressing issue for me. I didn't make the assumption from my side that you'll need to fix it - I'm sorry that this came across differently. Tbqh the thing that holds me back to try my own solutions is that this plugin is written in Vim Script. I'm mostly here to discuss possible solutions, even if they are never really implemented. The thing is just that parsing doesn't work for latexmk config files. I can write you a single line .latexmkrc that is not parsable with reasonable amount of work without using any help. I'm honestly not sure if "would be overkill" is the right answer here. I've looked into the source of VSCode's LaTeX Workspace and they go the easy route by ignoring any concept of .log files and just parsing the compiler output of latexmk (which mostly equals the log). From that one could also get the current output pdf file name. I'm aware that this would mean quite substantial changes in the way this plugin works - so honestly if you don't wanna do it don't. What would work for me would honestly be an option to manually configure the location of the .log file. If something like that is already implemented that would be nice to know. |
Ok, thanks!
I don't mind making changes, even substantial, if the changes clearly improve VimTeX either from a maintenance standpoint or from a user perspective.
Partly, but not in the way you want. You can set an environment variable I believe it may be useful to align VimTeX with latexmk in the sense of defining an output directory ( I think the behaviour should also mimic latexmk: If I would need to think about how this will affect the other build tools ( |
Sorry for not responding again in quite some time. I've been very busy with other things (other issues, other projects, life, and so on). I've quickly read the thread again. I forgot to answer your question:
No, this does not exist today. To me, it does not seem like an option I would want to add, because VimTeX should support different configurations in different projects. E.g., if you have a local Thus, for the present issue, I again propose the following actions to add support for
This will, as you point out, not work if you use
However, this was not part of the initial request, and I believe it may be possible to handle it after applying the proposed changes. If you do not really care about any updates, then please let me know. I will not implement these things if they are not of interest to anyone. |
I think that change would be lovely. The I'm not using LaTeX locally quite so often, as most exercises are done on Overleaf. But when I do, it's bigger things like a seminar paper or bachelor thesis and I would love to be able to use VimTex to its fullest for these. Can I offer my help or do you think that the changes are small enough, that it would be faster for you to just write them down instead of me trying to learn vimlang and understanding the project structure? |
Sorry for the long delay! I've been quite busy and have prioritized to resolve minor things in the meantime. I'll try and get back to look at this. I think it should not be too hard, but if you have the time and interest, then please feel free to try and suggest a PR! |
I have done some more research now. I would be happy to get some feedback on my suggested change below. First, I did a test now on how
The table indicates where files with the specified extensions are put after compilation with the various directory options:
I believe a good approach is to change the current
One possibility would be to keep the current |
So, essentially, I will still apply most of the changes I suggested previously. After I'm finished, users will have the following options for let g:vimtex_compiler_latexmk = {
\ 'aux_dir' : '',
\ 'out_dir' : '',
\ 'callback' : 1,
\ 'continuous' : 1,
\ 'executable' : 'latexmk',
\ 'hooks' : [],
\ 'options' : [
\ '-verbose',
\ '-emulate-aux-dir',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ ],
\} The main changes would be:
I guess it is still useful to have the environment variables to allow flexibility here, but I'm not sure. But if we use latexmk, it would suffice to use a local |
I've looked over the suggested changes and they seem to solve the issue quite well. The table you provided also matches my experience. I cannot rly give feedback about the implementation details of Regarding env variable: How would vimtex even use these? |
👍🏻
It's actually documented under |
As a step towards supporting aux_dir for latexmk I first want to consolidate on the out_dir name which is used for several backends. The term "build_dir" is not really used in these tools, so no need to add a new term here. Instead, we revert to out_dir, which is a specific concept in both latexmk, latexrun and tectonic. Further, the current implementation of these things is really quite similar to the "build_dir" concept. refer: #2534
I've pushed a first draft of this now. It would be very nice if you have the time to test it on your end. Let me know how it works for you. Notice that VimTeX should respect your |
As a step towards supporting aux_dir for latexmk I first want to consolidate on the out_dir name which is used for several backends. The term "build_dir" is not really used in these tools, so no need to add a new term here. Instead, we revert to out_dir, which is a specific concept in both latexmk, latexrun and tectonic. Further, the current implementation of these things is really quite similar to the "build_dir" concept. refer: #2534
Hi. I've right now a lot on my plate which will ease up over the next month. Would it be okay for you if I test this more extensively and look into the documentation in a month? |
Yes, that's fine. Take your time. I'll not merge this until it's been tested, though. |
Friendly nudge here; still no rush. :) |
I'll close this issue - let's have the continued discussion in #2677. When that PR is merged you can of course feel free to open a new follow-up issue if there were more things that are not provided in the PR. |
As a step towards supporting aux_dir for latexmk I first want to consolidate on the out_dir name which is used for several backends. The term "build_dir" is not really used in these tools, so no need to add a new term here. Instead, we revert to out_dir, which is a specific concept in both latexmk, latexrun and tectonic. Further, the current implementation of these things is really quite similar to the "build_dir" concept. refer: #2534
As a step towards supporting aux_dir for latexmk I first want to consolidate on the out_dir name which is used for several backends. The term "build_dir" is not really used in these tools, so no need to add a new term here. Instead, we revert to out_dir, which is a specific concept in both latexmk, latexrun and tectonic. Further, the current implementation of these things is really quite similar to the "build_dir" concept. refer: #2534
This changes build_dir to out_dir in general and adds support for setting aux_dir for latexmk. refer: #2534
Description
VimTex cannot find the log file when latexmk is used together with
$emulate_aux=1
. When using:VimtexErrors
(or similar) in Vim, the messageVimTeX: No log file found
appears.Steps to reproduce
.latexmk
with::VimtexErrors
Expected behavior
No response
Actual behavior
No response
Do you use a latexmkrc file?
Yes
VimtexInfo
The text was updated successfully, but these errors were encountered: