#!/bin/sh

d="False"
p="True"

while getopts "adp" opts; do
    case "${opts}" in
        d)
            p="False"
            d="True"
            ;;
        p)
            p="True"
            d="False"
            ;;
        a)
            p="True"
            d="True"
            ;;
    esac
done

if [[ "$p" == "True" ]]; then
  echo "Compiling .pdf"
  pandoc -i borrador.md --pdf-engine=xelatex -o borardor.pdf
fi

if [[ "$d" == "True" ]]; then
  echo "Compiling .docx"
  pandoc -i borrador.md -o borardor.docx
fi
