From a3931300dfddd989f5adc4b1d4bacae2299659ba Mon Sep 17 00:00:00 2001 From: Michael Georg Hansen Date: Thu, 29 Oct 2020 13:09:31 +0100 Subject: [PATCH] Remove stray debug output and properly log output of pythontex. --- pythontex-wrapper.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pythontex-wrapper.sh b/pythontex-wrapper.sh index c2f80e3..cfc3c4e 100755 --- a/pythontex-wrapper.sh +++ b/pythontex-wrapper.sh @@ -34,7 +34,6 @@ echo -e "\n\npythontex-wrapper: Calling ${latexcommand}" echo -e "------------------------------------------\n\n" ${latexcommand} $@ lastResult=$? -echo "First latex run: ${lastResult}" >> pythontex-wrapper.log if [ $lastResult -gt 0 ] ; then # compilation using latex failed echo "pythontex-wrapper: This was the first latex run, before pythontex was called!" >> ${logfilename} @@ -55,11 +54,12 @@ rm -f ${secondrunfile} echo -e "\n\npythontex-wrapper: Calling ${pythontexcommand}" echo -e "------------------------------------------\n\n" -${pythontexcommand} $1 +${pythontexcommand} $1 > ${logfilename} lastResult=$? -echo "pythontex run: ${lastResult}" >> pythontex-wrapper.log if [ ${lastResult} -gt 0 ]; then # running pythontex failed + # show error messages + cat ${logfilename} # lyx expects LaTeX error messages in the log file # Add a fake latex error message which lyx understands echo "! Undefined control sequence." >>${logfilename} @@ -73,11 +73,12 @@ if [ -e ${secondrunfile} ] ; then # 2nd run of pythontex requested echo -e "\n\npythontex-wrapper: Calling ${pythontexcommand} for 2nd run" echo -e "------------------------------------------\n\n" - ${pythontexcommand} --rerun always $1 + ${pythontexcommand} --rerun always $1 > ${logfilename} lastResult=$? - echo "pythontex run: ${lastResult}" >> pythontex-wrapper.log if [ ${lastResult} -gt 0 ]; then # running pythontex failed + # show error messages + cat ${logfilename} # lyx expects LaTeX error messages in the log file # Add a fake latex error message which lyx understands echo "! Undefined control sequence." >>${logfilename} @@ -93,7 +94,6 @@ echo -e "\n\npythontex-wrapper: Calling ${latexcommand}" echo -e "------------------------------------------\n\n" ${latexcommand} $@ lastResult=$? -echo "Second latex run: ${lastResult}" >> pythontex-wrapper.log echo "pythontex-wrapper: This was the second latex run, after pythontex was called!" >> ${logfilename} if [ ${lastResult} -gt 0 ] ; then # compilation using latex failed