-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrefs2pdf
More file actions
executable file
·36 lines (32 loc) · 784 Bytes
/
refs2pdf
File metadata and controls
executable file
·36 lines (32 loc) · 784 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
#!/bin/bash
echo "Warning: this script isn't well written. It won't work if it isn't used exactly right"
echo "Usage: bibs2pdf -i INFILE -o OUTFILE"
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-i|--input)
INPUT="$2"
shift # past argument
shift # past value
;;
-o|--output)
OUTPUT="$2"
shift # past argument
shift # past value
;;
--default)
echo "Only -i infile -o outfile args are allowed!"
exit
;;
esac
done
echo "Cleaning"
getbibs -ri ${INPUT} > NOBIBS.temp
sed -i '/^\*\*\* Reference*/d' NOBIBS.temp
sed -i '/^\*\*\* BibTeX*/d' NOBIBS.temp
echo "Pandocing"
mv NOBIBS.temp ___NOBIBS.org
pandoc ___NOBIBS.org -o ${OUTPUT}
rm ___NOBIBS.org