gendocs.sh 992 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. # By default US Letter is used as the PDF papersize.
  3. # For those preferring other dimensions add a4 or small
  4. # as a commandline argument to this script to create a
  5. # DIN A4 or smallbook version of the PDF.
  6. case $1 in
  7. a4*|afour*)
  8. papersize='--texinfo=@afourpaper';;
  9. small*)
  10. papersize='--texinfo=@smallbook';;
  11. *)
  12. papersize='';; # US Letter is texinfo default
  13. esac
  14. # Use keg-only Mac Hombrew texinfo if installed.
  15. # Since texi2pdf is a shell script itself executing texi2dvi
  16. # PATH is prepended with the path to correct texinfo scripts.
  17. if [ $(uname -s) = 'Darwin' ]; then
  18. brew list texinfo >/dev/null 2>&1 \
  19. && export PATH="$(brew --prefix texinfo)/bin:$PATH"
  20. fi
  21. echo "===================================== Making Info..."
  22. makeinfo ledger3.texi
  23. echo "===================================== Making HTML..."
  24. makeinfo --html --no-split ledger3.texi
  25. echo "===================================== Making PDF..."
  26. texi2pdf --quiet --batch ${papersize} ledger3.texi