When I open a new instance of vim without any 'filename' argument and write some LaTeX code, I cannot just compile it to pdf with
latexmk, because it needs a file to compile from. However, even after writing the new buffer to a
latexmk still tells me "no file name specified" and it won't compile. This happens with vim and gvim on Debian, but it doesn't happen with gvim on Windows.
After writing the new file with
:w <filename>, I tried running
:e <filename> or
:argadd <filename> or
:badd <filename>, but I got the same error. In order to compile to pdf successfully I have to quit and run vim again with the 'filename' argument, or open a new instance of vim without any argument and then run
:e <filename> (notice that running a new instance, then creating for the first time with
:w <filename> and then running
:e <filename>, did NOT work).
Can you help me understand how Vimtex or latexmk work in this case?