term-paper-diffeq
view doc/texify-results.sh @ 113:bc94df402ff0
Updated report to comply with source code changes introduced in rev 110.
| author | Dmitry Dzhus <mail@sphinx.net.ru> |
|---|---|
| date | Fri Nov 16 19:08:52 2007 +0300 (2 years ago) |
| parents | 8e9ff96c844b |
| children |
line source
1 #!/bin/bash
2 #
3 # Parse results and produce LaTeX code suitable for inclusion in paper.
4 #
5 # Usage:
6 #
7 # ./texify-results.sh RESULTS
8 #
10 TEMPFILE=$(mktemp /tmp/docXXXXXX)
12 RESULTS=$1
14 # Strip off u(x) approximation as it's not used in the template
15 cat ${RESULTS} | tail -n +$(($(grep -n "%%" ${RESULTS} | sed -e "s/:.*//")+1)) \
16 > ${TEMPFILE}
18 # DRY violation follows
20 A=$(grep "A:" ${TEMPFILE} | sed -e "s/.*: //")
21 B=$(grep "B:" ${TEMPFILE} | sed -e "s/.*: //")
23 EPS=$(grep "eps:" ${TEMPFILE} | sed -e "s/.*: //")
24 TIME=$(grep "time:" ${TEMPFILE} | sed -e "s/.*: //")
25 CONSERVE_STATUS="__CONSERVE_"$(grep "conserves: " ${TEMPFILE} | sed -e "s/.*: //")
27 m4 --define="__A"="${A}" \
28 --define="__B"="${B}" \
29 --define="__EPS"="${EPS}" \
30 --define="__TIME"="${TIME}" \
31 --define="__CONSERVE_STATUS"="${CONSERVE_STATUS}" \
32 --define="__LABEL"="${RESULTS}" \
33 results.tpl.tex
35 rm ${TEMPFILE}
