-
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 executes tectonic compiler without escaping path spaces #2664
Comments
It seems you have two different issues. For the first one: What's the outut when you do Now:
Out of curiosity, why do you censor the username? Obviously, feel free to do it, but I don't see any good reasons. Unless it is your full name, perhaps?
No! Your configuration for VimTeX options may be 2 lines, but you clearly have a lot more configuration, including how you load VimTeX. And to properly investigate issues, you should make a minimal It would also be useful to know more of how you run neovim. Are you in WSL shell? Are you using some gui version? Are you running neovim from a CMD shell? |
I censored the username because it is my full name indeed :) Regarding systeminfo: I usually run neovim using neovide. In any case, the same error occurs in terminal or neovide. Here are the outputs of systeminfo:
Bizarrely enough, I think I already am using UTF-8 encoding, at least neovim says so - Regarding my second problem, I've come across an issue remarking that (neo)vim+windows+powershell is a pain to setup to run commands, because of shell escape rules that are poorly thought out. This is exactly what I'm using. For the time being, I've managed to get it to work with a command runner called I will do the minimal init.lua stuff tomorrow, it's quite late here. But if the issue I'm seeing is due to powershell+neovim problems, I think there might be no solution that doesn't involve switching to cmd. |
Makes sense :)
Thanks for sharing it; it's mostly the same for all three environments, so I've
To be honest, there's nothing that looks suspicious there.
Ah, no, I meant on your Windows system, not in neovim. I was thinking this may be a problem with your locale, somehow. But I'm not sure!
So, you are changing your However, it should not really matter, because VimTeX reverts all Can you do a
Doing the minimal |
Here's the local cmd = vim.cmd
local g = vim.g
cmd ('filetype plugin indent on')
cmd ('syntax enable')
-- Vimtex rtp
vim.o.runtimepath = "C:/Users/----/Documents/.data/nvim-data/lazy/vimtex," .. vim.o.runtimepath .. ",C:/Users/----/Documents/.data/nvim-data/lazy/vimtex/after"
-- Configuration for vimtex
g.vimtex_view_method = 'sioyek'
g.vimtex_compiler_method = 'tectonic'
g.vimtex_log_ignore = {
'Underfull',
'Overfull',
'specifier changed to',
'Token not allowed in a PDF string',
}
Thanks for the help and apologies for not giving out this info earlier! :) |
I'll respond in more detail later; just a quick question now.
Can you adjust the |
I just realized that I forgot my initial issue was with a path that contained spaces! (I switched to a laptop where my username is shorter and has no spaces lol) On a folder called Here's the new minimal.lua vim.opt.runtimepath:prepend "C:/Users/----/Documents/.data/nvim-data/lazy/vimtex"
vim.opt.runtimepath:append "C:/Users/----/Documents/.data/nvim-data/lazy/vimtex/after"
vim.cmd 'filetype plugin indent on'
vim.cmd 'syntax enable'
vim.o.shell = 'pwsh'
vim.o.shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
vim.o.shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
vim.o.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
vim.o.shellquote = ''
vim.o.shellxquote = ''
vim.g.vimtex_view_method = 'sioyek'
vim.g.vimtex_compiler_method = 'tectonic' and here's VimtexInfo with that within
I'll edit to add this observation: sioyek opens the file just fine. However, in the tectonic path, its spaces are escaped vimlike |
Sorry for the late reply, been quite busy lately.
It seems
First, I hope you don't mind, but I updated your posted Now, before we go further and before I respond to your observations:
|
You're helping me for free, I don't see why you're apologising for being busy xD Now, regarding the this happens on any tex file, on the absolute minimum config possible. I ran it with vim.cmd ('filetype plugin indent on')
vim.cmd ('syntax enable')
vim.opt.runtimepath:prepend "C:/Users/-----/Documents/.data/nvim-data/lazy/vimtex"
vim.opt.runtimepath:append "C:/Users/-----/Documents/.data/nvim-data/lazy/vimtex/after"
The same thing happens if I run Regarding the steps for the problem with vim.cmd ('filetype plugin indent on')
vim.cmd ('syntax enable')
vim.opt.runtimepath:prepend "C:/Users/-----/Documents/.data/nvim-data/lazy/vimtex"
vim.opt.runtimepath:append "C:/Users/-----/Documents/.data/nvim-data/lazy/vimtex/after"
vim.g.vimtex_compiler_method = 'tectonic'
vim.g.vimtex_compiler_method = 'sioyek' No additional settings, nor shell opts, were added. Steps to reproduce:
In this process, I could see no errors. The only issue I saw was with As far as I can tell, the issue is not caused by vim.g.vimtex_compiler_method = 'generic'
vim.g.vimtex_compiler_generic = {command = 'just'} If there is anything else I can provide that would help diagnose this better, or that I forgot to do, please tell me |
:)
Ok, thus we still have two different and unrelated bugs! To make it easier for me, could you please open a new issue for the problem with
Ah, this makes it much easier!
I have the same version on my end. I've used your example and steps and things work as expected on my end. I'm on Linux, though, which is probably a key part here. After you do
If you open a cmd prompt and run that same command - what's the output? |
Here's what
Output is the exact same on cmd (or pwsh/powershell for that matter). This is, as far as I can see, an issue with escaping paths with spaces on windows specifically. I'll make a separate issue for |
Yes, I think you are right. While debugging: notice that you can try the same command, but use quotes instead of escaping the spaces. I.e., try this:
I believe it will work. If it does, could you edit
Change |
With the quotes instead of escaping, i.e. With
for it to work, but it did. Now the pdf is correctly generated. Thank you! :) |
Great, then I think my last commit should fix this issue. Please update and confirm :) |
It works fine now, cheers! I'll close this now :) |
Glad to hear it! |
Description
Maybe I'm messing up somewhere, since I've seen that the "output-dir" issue has been supposedly fixed in a PR, but I'm having it nonetheless. I'm using neovim 0.9.0, latest vimtex, lazy.nvim as a package manager. Executing
:VimtexInfo
(which errors out on the first execution, see below) gives the following information:Image with censored name. If the path is
C:\Users\Albert Einstein\Documents\a.tex
, it shows up asC:\Users\Albert\ Einstein\(...)
I'm not sure why it's erroring out on the first execution of VimtexInfo, but it might be related. Configuration is literally 2 lines in init.lua:
Steps to reproduce
:VimtexCompile
or:VimtexInfo
:VimtexInfo
shows the command as escaped with"\ "
Expected behavior
The document to compile and
:VimtexInfo
to workActual behavior
:VimtexInfo
errors on first execution.Tectonic is run with an output dir that has a space
Do you use a latexmkrc file?
No
VimtexInfo
The text was updated successfully, but these errors were encountered: