Guest User

Untitled

a guest
Sep 22nd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. usage() {
  4. echo "Usage: $0 <BASENAME> <LATEX|BIBTEX|CLEAN>"
  5. exit 1
  6. }
  7.  
  8. [ $# -ne 2 ] && usage
  9. BASENAME=$1
  10. ACTION=$2
  11.  
  12. set -e
  13. set -x
  14.  
  15. latex() {
  16. /usr/bin/latex --halt-on-error $1
  17. }
  18.  
  19. make_bibtex() {
  20. latex $1 && \
  21. bibtex $1 && \
  22. latex $1 && \
  23. latex $1
  24. }
  25.  
  26. make_latex() {
  27. cd figs && ./make.sh && cd .. && \
  28. latex $1 && \
  29. dvips -Ppdf -G0 -ta4 $1.dvi -o && \
  30. ps2pdf \
  31. -dCompatibilityLevel=1.4 \
  32. -dPDFSETTINGS=/prepress \
  33. $1.ps $1.pdf
  34. }
  35.  
  36. make_clean() {
  37. rm -f \
  38. $1.aux \
  39. $1.bbl \
  40. $1.blg \
  41. $1.dvi \
  42. $1.log \
  43. $1.pdf \
  44. $1.ps
  45. }
  46.  
  47. case $ACTION in
  48. latex) make_latex $BASENAME;;
  49. bibtex) make_bibtex $BASENAME;;
  50. clean) make_clean $BASENAME;;
  51. *) usage;;
  52. esac
Add Comment
Please, Sign In to add comment