Watch Target um LaTeX automatisch zu kompellieren.

This commit is contained in:
Jörg Thalheim 2013-10-26 00:42:11 +02:00
parent 0a3fc94e9e
commit b5dfe4bc5f
5 changed files with 24 additions and 4 deletions

View File

3
.gitignore vendored
View File

@ -26,4 +26,5 @@
*.synctex.gz
*.fdb_latexmk
*.fls
bericht/.cmd_ok
.cmd_ok
.inotifywait

View File

@ -5,3 +5,5 @@ all:
done
upload: all
rsync -avcL www/ lctp@devkid.net:/
watch:
cd bericht && make watch

View File

@ -1,7 +1,15 @@
.cmd_ok:
./check_cmds.sh
./check_cmds.sh .cmd_ok rsync latexmk
.inotifywait:
./check_cmds.sh .inotifywait inotifywait
%.pdf: %.tex
latexmk -pdf $<
all: .cmd_ok bericht.pdf
clean:
latexmk -CA
watch: .inotifywait
echo "Abort with Ctrl+C"
while (true); do\
inotifywait -e MOVE_SELF -e "modify" bericht.tex;\
latexmk -pdf bericht.tex; \
done

View File

@ -1,12 +1,21 @@
#!/bin/bash
NEEDED_COMMANDS="rsync latexmk"
if [ "$#" -lt 2 ]; then
echo "USAGE: $0 file commands..."
exit 1
fi
FILE=$1
shift
NEEDED_COMMANDS=$@
for cmd in ${NEEDED_COMMANDS} ; do
echo $cmd
if ! command -v ${cmd} &> /dev/null ; then
echo Please install ${cmd}!
exit -1
fi
done
touch .cmd_ok
touch $FILE