File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # SPDX-License-Identifier: GPL-3.0-or-later
3+ # Copyright (C) 2022 S. K. Medlock, E. K. Herman, K. M. Shaw
4+
5+ if [ " _${VERBOSE} _" != " __" ] && [ " $VERBOSE " -gt 0 ]; then
6+ set -x
7+ fi
8+
9+ if [ " _$1 _" == " __" ]; then
10+ TEX_FILE=notes.tex
11+ fi
12+
13+ BASE_FILE=$( basename $TEX_FILE .tex)
14+ PDF_FILE=${BASE_FILE} .pdf
15+
16+ function term-title() {
17+ echo -ne " \033]0;$1 \007"
18+ }
19+ term-title " $PDF_FILE "
20+
21+ touch $PDF_FILE
22+ evince $PDF_FILE &
23+ EVINCE_PID=$!
24+
25+ function cleanup() {
26+ if [ " _${VERBOSE} _" == " __" ] || [ " $VERBOSE " -le 0 ]; then
27+ kill $EVINCE_PID 2> /dev/null
28+ else
29+ kill $EVINCE_PID
30+ fi
31+ term-title " "
32+ }
33+ trap cleanup EXIT
34+
35+ ls -1 $TEX_FILE | entr \
36+ pdflatex -halt-on-error $TEX_FILE -o $PDF_FILE
You can’t perform that action at this time.
0 commit comments