Last active
August 29, 2015 14:07
-
-
Save zhou-chao/6fe66a43ea8981e7303a to your computer and use it in GitHub Desktop.
Update .pdf file whenever the .tex is modified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
######################################### | |
# created by | |
# Zhou Chao | |
# at | |
# 2014.11 | |
# args | |
# $1: tex file name to be edited | |
######################################### | |
# get file name without extension | |
FILE_NAME=`echo $1 | cut -d'.' -f 1` | |
echo $FILE_NAME | |
# get pdf file name | |
PDF_NAME="$FILE_NAME.pdf" | |
echo $PDF_NAME | |
# open pdf viewer | |
gnome-open $PDF_NAME | |
# open vim editor | |
gnome-terminal -e "bash -c \"vim $1\"" | |
# watch on tex file changes | |
while inotifywait -e delete_self $1; | |
do pdflatex $1; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
inotify
../realTimeTex.sh some.tex
.