Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #decide which file to convert
- usage()
- {
- echo "Use -d for document to be converted"
- echo "Use -f for LaTex fontfamily to be used"
- echo "Use -s for serif font (fbb)"
- echo "Use -a for sans serif font (arev)"
- }
- infile=""
- font=""
- no_args="true"
- while getopts ":d:f:sa" opt; do
- case $opt in
- d) infile="$OPTARG" ;;
- f) font="$OPTARG" ;;
- s) font="fbb" ;;
- a) font="arev" ;;
- *) echo "No args given"
- ;;
- esac
- no_args="false"
- done
- shift $((OPTIND -1))
- [[ "$no_args" == "true" ]] && { usage; exit 1; }
- #infile=${1?Error: No file given}
- #font=${2?Error: No font given}
- outfile=${infile%.*}.pdf
- pandoc --variable fontfamily=$font -f markdown -t latex -o $outfile $infile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement