feat(presets): add pdflatex preset

Adds a direct pdflatex preset for users who want single-pass
compilation without latexmk orchestration. Uses -file-line-error
for parseable diagnostics and reuses the existing parse_latexmk
error parser since both emit the same file:line: message format.
This commit is contained in:
Barrett Ruth 2026-03-04 13:52:36 -05:00
parent 75b855438a
commit 8ebe2ed80b
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 72 additions and 0 deletions

View file

@ -137,6 +137,22 @@ M.latex = {
open = true,
}
---@type preview.ProviderConfig
M.pdflatex = {
ft = 'tex',
cmd = { 'pdflatex' },
args = function(ctx)
return { '-interaction=nonstopmode', '-file-line-error', '-synctex=1', ctx.file }
end,
output = function(ctx)
return (ctx.file:gsub('%.tex$', '.pdf'))
end,
error_parser = function(output)
return parse_latexmk(output)
end,
open = true,
}
---@type preview.ProviderConfig
M.markdown = {
ft = 'markdown',