Skip to content

Commit ef5208b

Browse files
ace-dvmerichermankms15
committed
add some docs
Co-authored-by: Eric Herman <[email protected]> Co-authored-by: Kendrick Shaw <[email protected]>
1 parent 4a87f93 commit ef5208b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tex-live-view

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ fi
1313
BASE_FILE=$(basename $TEX_FILE .tex)
1414
PDF_FILE=${BASE_FILE}.pdf
1515

16+
# set the terminal title
1617
function 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
2123
touch $PDF_FILE
24+
term-title "$PDF_FILE"
2225
evince $PDF_FILE &
2326
EVINCE_PID=$!
2427

28+
# be sure to kill evince when done
2529
function cleanup() {
2630
if [ "_${VERBOSE}_" == "__" ] || [ "$VERBOSE" -le 0 ]; then
2731
kill $EVINCE_PID 2>/dev/null
@@ -32,5 +36,8 @@ function cleanup() {
3236
}
3337
trap 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
3542
ls -1 $TEX_FILE | entr \
3643
pdflatex -halt-on-error $TEX_FILE -o $PDF_FILE

0 commit comments

Comments
 (0)