term-paper-diffeq
view doc/initial-data.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 | 9ec7552139a4 |
| children |
line source
1 #!/bin/bash
2 #
3 # Provide `initial-data.tpl.tex` with necessary macro definitions
4 # extracted from statement file.
5 #
6 # Usage:
7 #
8 # ./initial-data.sh STATEMENT-FILE
9 #
10 # Output is a LaTeX code ready for inclusion using `\input`.
13 TEMPFILE=$(mktemp /tmp/docXXXXXX)
15 # Strip out non-TeXish comments
17 cat ${1} | grep -v "[ ]*;; .*" > ${TEMPFILE}
19 # Extract numeric parameters
21 RIGHTBOUND=$(cat ${TEMPFILE} | grep right-bound | \
22 sed -e "s/(define right-bound \(.*\))/\1/")
24 NTEX=$(cat ${TEMPFILE} | grep ';;@ \$n(x)' | \
25 sed -e "s/;;@ //" | sed -e 's/^\$\(.*\)\$$/\1/g' | tr -d "\n")
27 LABEL=$(basename ${1})"-initial-data"
29 m4 --define="__NTEX"="${NTEX}" \
30 --define="__RIGHTBOUND"="${RIGHTBOUND}" \
31 --define="__LABEL"="${LABEL}" \
32 initial-data.tpl.tex
