+ 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:
parent
900e352f1c
commit
52666e2301
1 changed files with 9 additions and 14 deletions
|
@ -27,23 +27,18 @@ destname="${outfile:-$defaultdest}"
|
||||||
|
|
||||||
(
|
(
|
||||||
cd $THIS_TEMPDIR
|
cd $THIS_TEMPDIR
|
||||||
if ! pdflatex -interaction=batchmode $texname.tex >$texname.log 2>&1; then
|
if ! pdflatex -interaction=batchmode $texname.tex >/dev/null 2>&1; then
|
||||||
shortlog="$(sed -ne 's/^[Ee]rror:*[[:space:]]*//p' $texname.log)"
|
err "${THIS}: pdfLaTeX error context:"
|
||||||
if [ -n "$shortlog" ]; then
|
sed -ne '/^![[:space:]]/,/^[[:space:]]*$/p' \
|
||||||
err "Errors:"
|
-ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
|
||||||
err "$shortlog"
|
-ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
|
||||||
else
|
|
||||||
# Short log is not available, dump the whole log.
|
|
||||||
err "pdfLaTeX log:"
|
|
||||||
cat $texname.log >&2
|
|
||||||
fi
|
|
||||||
if grep -q "File \`ucs.sty' not found" $texname.log; then
|
if grep -q "File \`ucs.sty' not found" $texname.log; then
|
||||||
err "Please install the 'unicode' package from CTAN:"
|
err "${THIS}: Please install the 'unicode' package from CTAN:"
|
||||||
err "http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
|
err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
|
||||||
fi
|
fi
|
||||||
if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
|
if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
|
||||||
err "Please install the 'fancyvrb' package from CTAN:"
|
err "${THIS}: Please install the 'fancyvrb' package from CTAN:"
|
||||||
err "http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
|
err " http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue