Closed qqqtwo closed 1 month ago
I only have one file I am trying to compile with
\ll
. When i do this I receive this error:compilation error due to failed main file detection
This is not a problem with VimTeX. Your minimal.tex
file is not valid - you need to include a preamble and \begin{document}
. Try this:
% minimal.tex
\documentclass{minimal}
\begin{document}
\[
\int_0^1 \frac{dx}{e^x}
\]
\end{document}
~\lua\plugins\vimtex.lua
:return { 'lervag/vimtex', config = function() -- Set Okular as the viewer with proper options vim.g.vimtex_view_method = 'okular' vim.g.vimtex_view_general_options = '--unique file:@pdf\\#src:@line@tex' -- Set compiler to latexmk vim.g.vimtex_compiler_method = 'latexmk' end }
First: You should use init = function() ...
, not config =
. This is written in the install instructions in the README file.
Also, you don't need to specify the compiler method unless you are changing it from the default value (and you are not).
init.lua
: …
You should not add -pdf
to the options list. IMHO, you should just keep the
default, so just remove these lines:
vim.g.vimtex_compiler_latexmk = { build_dir = '', callback = 1, continuous = 1, executable = 'latexmk', options = { '-pdf', '-interaction=nonstopmode', '-synctex=1', }, }
Description
I only have one file I am trying to compile with
\ll
. When i do this I receive this error:Steps to reproduce
minimal.tex
:~\lua\plugins\vimtex.lua
:init.lua
:okular is installed and the path added to Path is:
C:\ProgramFiles\WindowsApps\KDEe.V.Okular_23.801.1522.0_x64__7vt06qxq7ptv8\bin
i am on windows
Expected behavior
when i compile with
\ll
, the document should compile and when i do\lv
, the document should appear in okularActual behavior
when i compile with
\ll
. i get the error: compilation error due to failed main file detectionwhen i type
\lv
nothing happensDo you use a latexmkrc file?
No
VimtexInfo