-
Notifications
You must be signed in to change notification settings - Fork 389
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
Settings env variable for compiler #3008
Comments
My intuition here is that you are doing something wrong here. Can you please show, very explicitly and boringly detailed, exactly what you are doing hwen you say the above? Also, after opening a tex file, can you do |
for sure. Just for context, here is the makefile I usually use and when I do make, the project compile as intended. .PHONY: all clean run
export TEXINPUTS := .:${PWD}/../Commons//:${TEXINPUTS}
all: main.pdf
%.pdf: %.tex
pdflatex $<
clean:
rm -f main.aux main.log main.nav main.out main.pdf main.snm main.toc texput.log main.fdb_latexmk main.fls main.fdb_latexmk main.fls main.log
run: main.pdf
xdg-open $< therefore my strategy is to do $ export TEXINPUTS=.:${PWD}/../Commons//:${TEXINPUTS}
$ vim main.tex (I have a alias vim=nvim in my .profile) here is the error I get when I \ll
I still can do :echo $TEXINPUTS whitch give me the above env variable finally, here is the output of
hope this help, I already did all of that before posting the issue, but maybe you have a sharper eyes ^^ Thanks for your help! |
Thanks, this helps. It's still hard to say exactly what is wrong here. I have two ideas for inspecting this further:
Remote debugging: The next step is to see if you can reproduce this problem with latexmk -c
export TEXINPUTS=.:${PWD}/../Commons//:${TEXINPUTS}
latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -pvctimeout- -view=none 'main.tex' Does this work as expected? |
Thanks for your help, here is a small template project I just made to test and the bug appears as well |
I've tested your example, and for me, everything works exactly as expected; i.e., both of the following approaches work for me: # 1
TEXINPUTS=.:${PWD}/../Commons//:${TEXINPUTS} nvim main.tex
# 2
export TEXINPUTS=.:${PWD}/../Commons//:${TEXINPUTS}
nvim main.tex So, I think your problem is somehow tied to your config. |
I've looked at your config, and there is nothing that stands out to me as wrong here. Out of curiosity, do you have the same problem with both Vim and neovim?
In my opinion, that is the sensible next step. Here's a classical, minimal -- NOTE: Fix the path in the following two lines:
vim.opt.runtimepath:prepend "~/.local/plugged/vimtex"
vim.opt.runtimepath:append "~/.local/plugged/vimtex/after"
vim.cmd [[filetype plugin indent on]]
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_cache_root = "."
vim.g.vimtex_cache_persistent = false With the above saved as # First, verify that you still get the same problem as before
nvim --clean -u mwe.lua main.tex
# Now check if the env variable is picked up; this _should_ work:
export TEXINPUTS=.:${PWD}/../Commons//:${TEXINPUTS}
nvim --clean -u mwe.lua main.tex
Ah, yes. I personally really don't like the builtin pack feature and I would strongly recommend to use a plugin manager. In any case, can you please explain in more depth how you've installed VimTeX? It could be related to this. |
I did now and I have the same problem with vim
I will try that in a moment (or maybe tomorrow as I have class early) thanks for your help so far!
I used to use Vundle but ditched it. Basicly now, I use git to manage my plugins. each folder in .vim/pack/*/start/ is a repo and is loaded by vim automagicly. so vimtex is not different, this is just the repo in this folder I don't think I did anything more |
Ok; for now, let's focus on neovim. I guess solving it for neovim would also solve this for Vim.
No problem; it's hard to help much further without being able to reproduce this.
Yes, if you do this correctly I agree it should work. There are some gotchas, but I think most of them are addressed here: Line 95 in f216887
But I don't see immediately how this should be relevant. Another simple test: Run |
One possibility is latexmk caching --- latexmk will not rerun even if environment variables has changed. Try running Delete all log, pdf, fdb_latexmk etc. files and try again. |
Is your feature request related to a problem? Please describe it.
I compile my documents with
TEXINPUTS=.:${PWD}/../Commons//:${TEXINPUTS} pdflatex main.tex
and it works. I don't find how to set this environment variable when using vimtexI tried to export the variable before launching vim and this doesn't have effect.
Describe the solution you'd like
I would like a variable (something like
g:vimtex_compiler_latexmk['env']
that would be put as env variable before executing the compilationDescribe alternatives you've considered
I don't really know why it doesn't work but maybe the TEXINPUTS should be passed trought ?
The text was updated successfully, but these errors were encountered: