Skip to content

Instantly share code, notes, and snippets.

@kartikeytewari
Created July 31, 2020 15:17
Show Gist options
  • Save kartikeytewari/fd6643d69f4c6b826a4e7806729b319d to your computer and use it in GitHub Desktop.
Save kartikeytewari/fd6643d69f4c6b826a4e7806729b319d to your computer and use it in GitHub Desktop.
function build_latex()
{
for arg in "$@"
do
case $arg in
# for building latex without bibliography
-bs|--build_small)
pdflatex ${1}.tex
;;
# for building latex with bibliography
-bl|--build_large)
pdflatex ${1}.tex
bibtex ${1}.aux
pdflatex ${1}.tex
pdflatex ${1}.tex
;;
# for opening in google chrome
-o|--open)
chrome ${1}.pdf
shift
;;
# for printing manual
-h|--help)
echo "build_latex function is used for building latex files"
echo "along with bibliography (if used)"
echo "flags:"
echo ""
echo "-bs | --build_small"
echo " just builds the latex file"
echo ""
echo "-bl | --build_large"
echo " builds the latex file along with bibliography"
echo " if .bib file is not found then it is ignored"
echo ""
echo "-o | --open"
echo " This opens the built pdf in chrome"
echo ""
echo "-h | --help"
echo " Prints this manual page"
echo ""
echo "Under development. MIT LIcense 2020"
echo "for feedback/suggestions contact developer at: kartikeya30@gmail.com"
esac
done
}
@kartikeytewari
Copy link
Author

Initial Commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment