-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpdfpreview
More file actions
executable file
·55 lines (44 loc) · 1000 Bytes
/
pdfpreview
File metadata and controls
executable file
·55 lines (44 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# pandoc conversion with entr to enable live previews
MINPARAMS=1
Usage() {
echo "$0; This script requires a source file"
exit 1
}
inputfile=$2
function paper() {
#function_body
pc="pandoc --filter pandoc-crossref -C -N --highlight-style zenburn -o temp.pdf ${inputfile}"
$pc
xdg-open temp.pdf &
echo "${inputfile}" | entr -sc "date "+%T" ; echo ' - updating pdf' ; ${pc}"
}
function thesis() {
#function_body
pc="pandoc --filter pandoc-crossref --lua-filter=/home/liam/Documents/lua-filters/short-captions/short-captions.lua -C -N --highlight-style zenburn -o temp.pdf ${inputfile}"
$pc
xdg-open temp.pdf &
echo "${inputfile}" | entr -sc "date "+%T" ; echo ' - updating pdf' ; ${pc}"
}
while getopts ":hpt" opt; do
case $opt in
h | help)
usage
exit 0
;;
t | thesis)
thesis
exit 0
;;
p | paper)
paper
exit 0
;;
*)
echo -e "\n Option does not exist : $OPTARG\n"
usage
exit 1
;;
esac # --- end of case ---
done
shift $(($OPTIND - 1))