[texworks] [XeTeX] Overfull boxes return status of 0 in XeTeX
st.loeffler at gmail.com
Thu Mar 17 00:29:13 CET 2016
I believe there has been some misunderstanding here that I'd like to try
to clear up.
Personally, I think that the exit code policy of TeX is good. IMO, exit
codes should be (and are) used to report fundamental errors (such as
"program not found" or "I don't understand this input"), not for
conveying complex "additional" information. In that context, I think it
is irrelevant whether a program produces exactly the output the users
wants (especially since different people may want different things; note
the difference between "wants" and "has asked for") - as long as the
program reaches its normal end, the exit code should be 0 (=success).
For more complex information, you will need to analyze the log (as
others said already).
Now, regarding TeXworks and the issue at hand. TeXworks displays the
output of the TeX process in a console window. After TeX finishes,
scripts can be run that, e.g., parse the console output and condense it
into a more human-friendly form. What happens to the console after TeX
finishes can be selected from the following three modes:
1) the user can choose to always keep the console open
2) the user can choose to always hide the console if TeX finishes
successfully (i.e., with exit code 0)
3) the user can choose a hybrid approach that closes the console if TeX
finishes successfully unless it was opened manually by the user before
(this is the default in recent versions).
So, the console always remains open if TeX exits with a non-zero status
code, but will typically be closed otherwise. Presumably, it was this
behavior that led to the request of a non-zero exit code for other
conditions (e.g., if warnings occur). However, it can be worked around
relatively easily by manually opening the console (which should then
remain open until closed manually).
Another potential approach mentioned before was to let the log parser
script determine whether or not the console should be closed. This,
unfortunately, raises some other issues. The scripts run after
typesetting are not necessarily inspecting the log at all (for all we
know, they could tweet "I used TeX" or whatever), so they need not be
able to provide any insight into whether the TeX run was successful.
More importantly, though, several scripts could be run (say, one that
looks only for errors and only that only looks for warnings) which could
give contradicting results (e.g., no errors => close, warnings => don't
close). Thus, TeXworks currently does not let scripts control the console.
The way I use it is the following: while writing, I keep the console
closed (configured in mode 3 above such that it closes as long as there
are no errors preventing typesetting). When I am at the stage of
"polishing", I open the console manually, which then stays open until I
close it again manually. The approach of a wrapper would work as well,
but, as pointed out already, is more difficult to implement on Windows
than on Unix-derived OSs.
I hope this sheds some light into this.
More information about the texworks