-
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
magic comment '%! TeX program = *' only work for *.tex #2326
Comments
It seem to be related to the code judge the self.tex: let l:ext = fnamemodify(a:main, ':e')
let l:new.tex = l:ext ==# 'tex' ? a:main : '' If the file's ext is not tex, self.tex will be ''. And magic comment will not be used. Why not get extensions from latexmk's |
index 0ea336d3..1163ec54 100644
--- a/autoload/vimtex/state/class.vim
+++ b/autoload/vimtex/state/class.vim
@@ -18,7 +18,7 @@ function! vimtex#state#class#new(main, main_parser, preserve_root) abort " {{{1
endif
let l:ext = fnamemodify(a:main, ':e')
- let l:new.tex = l:ext ==# 'tex' ? a:main : ''
+ let l:new.tex = a:main
" Get preamble for some state parsing
let l:preamble = !empty(l:new.tex) This can solve this problem. |
Thanks! I agree that the suggested code should be relaxed. I want to avoid options, so I'll relax to allow |
I also suppose avoiding options (too many options maybe confuse user). However, I am not sure about |
Ok :) |
Description
Set latexmk and vimtex's default tex program to xelatex, then use
%! TeX program = lualatex
to look which tex program vimtex will use for latexmk. Formain.tex
, vimtex will uselualatex
, it's right. But for other file which extension is nottex
, such asdtx
ortikz
, it still use xelatex.Steps to reproduce
This is a simple tex file:
this is a simple latexmkrc:
and in vimtex config:
pdf_mode = 5 means we use xelatex to generate dvi and convert dvi to pdf by xdvipdfmx.
When the tex file named
main.tex
, vimtex:It is right.
However, when the file is
main.dtx
ormain.tikz
:It use
xelatex
, and will output a pdf which content is 0 not 1.Expected behavior
I think whatever the file's name is
main.dtx
ormain.tikz
ormain.ins
or other name, the tex program always belualatex
.Actual behavior
only
main.tex
can work.Do you use a latexmkrc file?
Yes
VimtexInfo
vimtexinfo has been attached above.
The text was updated successfully, but these errors were encountered: