Skip to content

Commit dc11b2a

Browse files
erichermanace-dvmkms15
committed
tex-live-view
Co-authored-by: Ace Medlock <[email protected]> Co-authored-by: Kendrick Shaw <[email protected]>
1 parent 3e0ebc3 commit dc11b2a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tex-live-view

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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

0 commit comments

Comments
 (0)