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'm running XeLaTeX from a shell script and would like to check for exit codes, to see if an error was encountered during processing.

So I'm looking for a list of possible exit codes. I've checked the documentation and googled quite extensively but can't find such a list.


share|improve this question

migrated from stackoverflow.com Mar 13 '12 at 20:00

This question came from our site for professional and enthusiast programmers.

are you sure it will support exit codes. I assume you've tried XeLaTex --help and strings /path/to/XeLaTex? Try doing XeLaTex .. args_as_needed ... NONEXISTANTFILE ; echo $? to see if it catches that simple error. If that reports an error, then see what error code is returned if you give it a deliberately malformed document. Depending on your need, that may be enough. Good luck! – shellter Mar 13 '12 at 15:26
Thanks. --help did not give any info on return codes. The echo $ method helped, hadn't thought of that. So far I gathered that return code 0 means no (significant) errors, 1 means problems. – Richard Kranendonk Mar 13 '12 at 16:03
yes, that's right. You seldom see a return code from an application higher than 3 or 4 (all non-zeros mean some kind of error). You can build tests like if XLateX ... args .. File file2... ; then echo everything OK ; else echo error processing file ; fi` OR xLatext...args... ; rc=$? ; case ${rc} in 0) echo OK ;; * ) echo got error code ${rc} ;; esac` Got to go. Good luck. – shellter Mar 13 '12 at 16:09
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Mar 13 '12 at 20:40

There's no support for exit codes different from 0 or 1, I'm afraid.

The presence of warnings, as opposed to errors, can be checked for with the texloganalyser script.

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.