File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1313BASE_FILE=$( basename $TEX_FILE .tex)
1414PDF_FILE=${BASE_FILE} .pdf
1515
16+ # set the terminal title
1617function term-title() {
1718 echo -ne " \033]0;$1 \007"
1819}
19- term-title " $PDF_FILE "
2020
21+ # launch evince, a PDF viewer
22+ # evince will automatically re-render when the .pdf file changes
2123touch $PDF_FILE
24+ term-title " $PDF_FILE "
2225evince $PDF_FILE &
2326EVINCE_PID=$!
2427
28+ # be sure to kill evince when done
2529function cleanup() {
2630 if [ " _${VERBOSE} _" == " __" ] || [ " $VERBOSE " -le 0 ]; then
2731 kill $EVINCE_PID 2> /dev/null
@@ -32,5 +36,8 @@ function cleanup() {
3236}
3337trap cleanup EXIT
3438
39+ # entr - run arbitrary commands when files change
40+ # we'll have entr monitor $TEX_FILE and re-run pdflatex when it does
41+ # set to halt-on-error so it does not hang on bad syntax
3542ls -1 $TEX_FILE | entr \
3643 pdflatex -halt-on-error $TEX_FILE -o $PDF_FILE
You can’t perform that action at this time.
0 commit comments