diff --git a/latexmkrc b/latexmkrc index ef8f9b0..a23bceb 100644 --- a/latexmkrc +++ b/latexmkrc @@ -1,5 +1,5 @@ $pdf_mode = 4; @default_files = ('index.tex'); $out_dir = 'output'; -set_tex_cmds( '--shell-escape %O %S' ); -$pdf_previewer = 'start zathura output/index.pdf' +set_tex_cmds( '-lua=mybatchmode.lua --shell-escape %O %S' ); +$pdf_previewer = "zathura %O %S"; diff --git a/mybatchmode.lua b/mybatchmode.lua new file mode 100644 index 0000000..30180b8 --- /dev/null +++ b/mybatchmode.lua @@ -0,0 +1,11 @@ +texconfig.interaction = 0 -- Activate batchmode +texconfig.halt_on_error = true -- Stop at first error + +callback.register('show_error_message', function(...) + texio.write_nl('term and log', status.lasterrorstring) + texio.write('term', '.\n') +end) +callback.register('show_lua_error_hook', function(...) + texio.write_nl('term and log', status.lastluaerrorstring) + texio.write('term', '.\n') +end)