1

In my ~/.config/nvim/ftplugin/tex.vim I have the following:

set makeprg=pdflatex\ -halt-on-error\ -file-line-error\ -synctex=1\ %
set errorformat=%f:%l:\ %m

however when I run make the command that I see is different:

:!pdflatex -halt-on-error -file-line-error -synctex=1 test.tex 2>&1| tee /var/folders/gq/vqbg5g255cqf7x_yn8v3tlyc0000gn/T/nvim9VTy4P/7

why is stderr redirected to stdin, what is that second command with tee doing, and how do I remove both of them?

I also get this at the end of the compilation (if there were no errors)

(1 of 16): This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)

and if there's an error I get for example

(12 of 16): Undefined control sequence.

what does this last line mean, and how can I remove it?

Edit:

Output of pdflatex -halt-on-error -file-line-error -synctex=1 test.tex as called from a shell

$ pdflatex -halt-on-error -file-line-error -synctex=1 test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
(./test.aux) [1{/usr/local/texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdfte
x.map}] (./test.aux) )</usr/local/texlive/2020/texmf-dist/fonts/type1/public/am
sfonts/cm/cmr10.pfb>
Output written on test.pdf (1 page, 16718 bytes).
SyncTeX written on test.synctex.gz.
Transcript written on test.log.

Output of :make with set makeprg=pdflatex\ -halt-on-error\ -file-line-error\ -synctex=1\ %

:!pdflatex -halt-on-error -file-line-error -synctex=1 test.tex  2>&1| tee /var/folders/gq/vqbg5g255cqf7x_yn8v3tlyc0000gn/T/nvim4TX4tu/4
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
(./test.aux) [1{/usr/local/texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdfte
x.map}] (./test.aux) )</usr/local/texlive/2020/texmf-dist/fonts/type1/public/am
sfonts/cm/cmr10.pfb>
Output written on test.pdf (1 page, 16718 bytes).
SyncTeX written on test.synctex.gz.
Transcript written on test.log.

(1 of 16): This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
Press ENTER or type command to continue
4

why is stderr redirected to stdin,

In order to have both end up in the quickfix list.

what is that second command with tee doing,

man tee. It redirects stdin into a file and into stdout. It's an extremely useful command to log and watch the execution of commands that send a massive amount of lines into stdout and/or stderr.

and how do I remove both of them?

You don't want to. That's what vim :make is expecting and needs to in order to populate the quickfix list. See :h 'shellpipe'.

(12 of 16): Undefined control sequence.

what does this last line mean, and how can I remove it?

It means there is an error in your LaTeX file and that you should scroll back to find the exact error line number, and ask in a LaTeX channel.

| improve this answer | |
  • That last line is added by make, if I call pdflatex from a shell I don't see that, that's why I asked. It's there even if there are no errors in the compilation (in that case there's 1 of 16 instead of 12 of 16). – noibe Jun 9 at 10:55
  • In the console, are you also executing pdflatex with the halt on first error option? Also, you should have from 1 of 16 up to 16 of 16 messages: there are 16 messages. – Luc Hermitte Jun 9 at 11:02
  • 1
    @noibe try :copen; vim’s quickfix unfortunately doesnt play too well with multiline error messages (not an issue, just an inconvenience), so that occasionally the helpful bits are one before or one after or such – D. Ben Knoble Jun 9 at 11:50
  • 1
    @noibe The (1 of 16) line is showing you the first line of the makeprg output which has been added to your quickfix: because of the way you have configured your errorformat, all of the output lines are added to the quickfix. (even ones which aren't errors). Have a read of :help quickfix and :help errorformat to see how all this stuff works, and edit your 'errorformat' setting if you don't want all these lines in your quickfix. – Rich Jun 9 at 13:38
  • 1
    @Rich I edited the title – noibe Jun 13 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.