-
Notifications
You must be signed in to change notification settings - Fork 395
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
Fix TeX directive recognition #2571
Conversation
This one simple typo—probably left over from some old version—rendered TeX directives like `%! TeX program = lualatex` useless and prevented Vimtex from recognising directives at all.
That's strange. I'm quite sure that tex directives work exactly as intended on my end. Could you provide a concrete, minimal example with a description to show that it does not work? Please include info on your system as well, as it may be relevant. |
Notice, though, that |
You got it. We are talking about a MacVim setup on macOS 13.0: typing
%! TeX program = lualatex
\documentclass{article}
\directlua{ zzz = 108 }
\begin{document}
Where did that bring you? Back to me.
\end{document}
set encoding=utf-8
set nocompatible
call plug#begin('~/.vim/plugs')
Plug 'lervag/vimtex'
call plug#end()
let g:vimtex_syntax_enabled = 1
let g:vimtex_view_method = 'skim' Hit
I tracked the bug down to |
The first couple lines of the Vimtex log might be interesting to have (before I forget to include it):
|
Thanks! Could you also state, explicitly, the steps you take in a terminal? For me, if I create the specified files, then do
|
Done. ~ % cd Garage/Literacy/VimtexPlayground
VimtexPlayground % mvim Boom.latex |
And
|
Ok. Does this mean that you apply the minimal configuration as your regular The vimtex/autoload/vimtex/state/class.vim Lines 21 to 22 in e5343cf
Considering that you've opened a PR and already know at least something about working with Vimscript, perhaps you could investigate on your side by e.g. adding |
Not at all; I use a more extensive one.
Good pointers, thanks! I thought for sure no one could possibly be debugging Vimscript like I have for this; I'll look into it. If you don't hear by Sunday evening CET, I might have forgot or put this off. |
Sounds good! I would not be very surprised if the problem is related to your configuration somehow, but I'm not sure. It may be a bug, and I'll be happy to help figure things out! |
Turns out Vimtex did not recognise files ending in ‘.latex’ which might be the preferred ending for some; neither for ‘.tex’ and ‘.tikz’ if cased differently
I have put fixing this off for a week; turned out that your code reference was exactly what needed fixing! The old “bugfix” is no more, and replaced with another. This time however, we don't need to worry about breakage anymore. Edit: hold off another minute; found a typo of my own. How embarrassing. |
Thanks, I agree, this seems to be a relevant fix. I proposed another minor fix and adjustment and will merge when that's applied. |
Changes requested by higher power.
Turns out Vimtex did not recognise files ending in ‘.latex’ which might be the preferred ending for some; neither for ‘.tex’ and ‘.tikz’ if cased differently Includes changes requested by higher power during PR review. refer: #2571
Thanks! Looks fine now! I took the liberty of squashing your commits on top of master to keep a cleaner Git history. |
This one simple typo—probably left over from some old version—rendered TeX directives like
%! TeX program = lualatex
useless and prevented Vimtex from recognising directives at all (very annoying!)It seems likely that this very typo is littered throughout the codebase, but I haven't had the time to establish that; for now at least, it makes TeX directives usable again.