updated compiletex, added tex2docx

main
will king 3 years ago
parent a1789a96d9
commit 36026c8f55

@ -1,13 +1,14 @@
#!/bin/bash
#Remove the .tex extention, it just messes up the bibliography
tex=${1%%\.tex}
tex="${1%%\.tex}"
flags="${@:2}"
echo "$flags"
pdflatex $tex
biber $tex
pdflatex $tex
pdflatex $tex
pdflatex $tex
latex "$flags" "$tex"
biber "$tex"
latex "$flags" "$tex"
pdflatex "$flags" "$tex"
echo
echo "Removing biliography database \n\t$tex"

@ -0,0 +1,37 @@
#!/bin/bash
# Based on notes from https://medium.com/@zhelinchen91/how-to-convert-from-latex-to-ms-word-with-pandoc-f2045a762293
while [[ $# -gt 0 ]]; do
case $1 in
-f|--filename)
FILE_STEM="${2%.tex}"
shift # past argument
shift # past value
;;
-h|--help)
echo "$0 -f|--filename FILENAME [-h|--help] [-b|--bibliography BIBLIOGRAPHY] "
exit 0
;;
-b|--bibliography-file)
BIBLIOGRAPHY="${2}"
shift # past argument
shift # past value
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
#POSITIONAL_ARGS+=("$1") # save positional arg
#shift # past argument
echo "Unknown option $1"
exit 1
;;
esac
done
#if there is a bibliography
pandoc "${FILE_STEM}.tex" --bibliography="${BIBLIOGRAPHY}" -o "${FILE_STEM}.docx"
pandoc "${FILE_STEM}.tex" -o "${FILE_STEM}.docx"
Loading…
Cancel
Save