Skip to content
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

Forward search broken with empty latexmkrc #1095

Closed
HarryHeres opened this issue Apr 26, 2024 · 0 comments · Fixed by #1101
Closed

Forward search broken with empty latexmkrc #1095

HarryHeres opened this issue Apr 26, 2024 · 0 comments · Fixed by #1101

Comments

@HarryHeres
Copy link

HarryHeres commented Apr 26, 2024

Hi!

I have just finished debugging an issue where Texlab was, on forward seach, still looking into the root directory, even though I have set the directories in Neovim config as following:

['texlab'] = function()
	local forward_search_args = {
		'--reuse-window',
		-- '--execute-command', 'toggle_synctex', -- Open Sioyek in synctex mode.
		-- '--inverse-search',
		-- [[nvim-texlabconfig -file %%%1 -line %%%2 -server ]] .. vim.v.servername,
		'--forward-search-file', '%f',
		'--forward-search-line', '%l',
		'%p'
	}

	local pdf_executable = 'sioyek'


	require('lspconfig').texlab.setup({
		capabilities = capabilities,
		filetypes = { "tex", "bib" },

		settings = {
			texlab = {
				build = {
					auxDirectory = "build",
					pdfDirectory = "build",
					logDirectory = "build",
					args = { "-pdf", "-auxdir=build", "-outdir=build", "-interaction=nonstopmode", "-synctex=1", "%f" },
					executable = "latexmk",
					forwardSearchAfter = false,
					onSave = true
				},

				forwardSearch = {
					executable = pdf_executable,
					args = forward_search_args
				}
			}
		}

	})
end

When there's not a latexmkrc file present in the root directory, the process finishes sucessfuly.

However, when there's a latexmkrc file present in the root directory without out_dir=<path> set, the server does not fall back to the settings it has in its configuration, therefore searches for the PDF file in the root directory.

Also, based on the documentation of latexmkrc, the variables must be set with $ pre-pended to the string, i.e. $out_dir=<path>, however when done so, Texlab does not recognize this setting. When variable is introduced without the $, the latexmk process fails due to invalid latexmkrc format.

Tested on Texlab 5.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant