TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am executing pdflatex from php script and it gives me very long list of log entries mixed with errors e.g

 system('/usr/texbin/pdflatex    -output-directory=./temp/tex '.$tex_output  . "   1> /dev/null  ",$firstRun); 

log output

Is it possible to get errors or warnings only (may be using logs files it generates ) ?

share|improve this question
Well, cat filename.log | grep -iB2 -A5 "error\|warning" However, the log file you linked seems to be missing end-of-line characters, which is not a fault of TeX. – yo' Nov 15 '12 at 9:41
The output can be minimized using option --interaction=batchmode. The exit code of the command is set, if there were any errors. – Heiko Oberdiek Nov 15 '12 at 10:24
up vote 3 down vote accepted

Error always starts with <exclamationmark><space>, which should be easy to look for in the log.

As well, you can pipe something like x\nx\n to the program latex, which should make it stop after first error. Then you can search it even easier, I believe that the last empty line in the log should be just after this error. (This is because after you exit after an error, only some final font information and memory usage is written into the log.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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