| 1 |
#! /usr/bin/env bash |
| 2 |
|
| 3 |
if [[ -n $( echo $* | egrep -- "-h\>|--help\>" ) ]]; then |
| 4 |
echo -e "Usage: $0 <myfile.tex>" |
| 5 |
echo "NB. \\input and \\include operations will only work in" |
| 6 |
echo "the current directory, rather than via the full TeX path." |
| 7 |
exit 0 |
| 8 |
fi |
| 9 |
|
| 10 |
maintexfile=$1 |
| 11 |
tempfile=texmerge.$$ |
| 12 |
|
| 13 |
cat $maintexfile | sed -e s/'\\input{\([^}]*\)}'/'#include "\1\.tex"'/g > $tempfile |
| 14 |
#cat $tempfile |
| 15 |
cpp $tempfile 2> /dev/null | mail -s "generate bibtex" [email protected] |
| 16 |
rm -f $tempfile |