+ Revert previous commit which is wrong and insufficient on some parts.

+ Improve sed filter to extract the following error contexts:
  1. From a line starting with ! to the next blank line.
  2. From a line beginning "LaTeX Warning:" to the next blank line.
  3. From a line beginning "Error:" to the next blank line, or EOF.
+ Improve the error message headers (perhaps needs a proof reading).   
  Prepend the wrapper name to the error headers for easy spotting.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@451 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
roktas 2007-01-07 05:09:07 +00:00
parent 900e352f1c
commit 52666e2301

View file

@ -27,23 +27,18 @@ destname="${outfile:-$defaultdest}"
(
cd $THIS_TEMPDIR
if ! pdflatex -interaction=batchmode $texname.tex >$texname.log 2>&1; then
shortlog="$(sed -ne 's/^[Ee]rror:*[[:space:]]*//p' $texname.log)"
if [ -n "$shortlog" ]; then
err "Errors:"
err "$shortlog"
else
# Short log is not available, dump the whole log.
err "pdfLaTeX log:"
cat $texname.log >&2
fi
if ! pdflatex -interaction=batchmode $texname.tex >/dev/null 2>&1; then
err "${THIS}: pdfLaTeX error context:"
sed -ne '/^![[:space:]]/,/^[[:space:]]*$/p' \
-ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
-ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
if grep -q "File \`ucs.sty' not found" $texname.log; then
err "Please install the 'unicode' package from CTAN:"
err "http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
err "${THIS}: Please install the 'unicode' package from CTAN:"
err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
fi
if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
err "Please install the 'fancyvrb' package from CTAN:"
err "http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
err "${THIS}: Please install the 'fancyvrb' package from CTAN:"
err " http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
fi
exit 1
fi