29 lines
739 B
Bash
Executable File
29 lines
739 B
Bash
Executable File
#!/bin/bash
|
|
|
|
FILENAME="ResearchProposal"
|
|
|
|
IN="${FILENAME}.md"
|
|
OUT="${FILENAME}.pdf"
|
|
|
|
# Generate the PDF from Markdown
|
|
echo "Generating PDF..."
|
|
pandoc -i "$IN" \
|
|
-o "$OUT" \
|
|
--csl=resources/apa-7th-edition.csl \
|
|
--citeproc \
|
|
--lua-filter=filters/first-line-indent.lua \
|
|
--citation-abbreviations=resources/citation-abbreviations.csl
|
|
|
|
# Check if pandoc ran successfully
|
|
if [ $? -ne 0 ]; then
|
|
echo "Error: pandoc command failed. Exiting script."
|
|
exit 1
|
|
fi
|
|
|
|
# Insert Erklärung.pdf at the end of the PDF
|
|
echo "Modifying the PDF..."
|
|
./modify-pdf.sh "$OUT" "resources/Erklärung.pdf" "$OUT"
|
|
|
|
# remove last page for osf.io
|
|
echo "Removing last page for OSF.io output and saving to OSF-$OUT"
|
|
pdftk "$OUT" cat 1-r2 output OSF-"$OUT" |