latex.sh 732 B

1234567891011121314151617181920212223242526
  1. # latex.sh
  2. # A script for converting Markdown files in each of the subdirectories into a unified PDF typeset in LaTeX.
  3. # Requires TexLive, Pandoc templates and pdfunite. Not necessary if you just want to read the PDF, only if you're compiling it yourself.
  4. #!/bin/bash
  5. rm -r build
  6. mkdir build
  7. for D in $(ls ../); do
  8. if [ -d "../${D}" ]
  9. then
  10. echo "Converting $D . . ."
  11. pandoc ../$D/README.md ../$D/linux-*.md -o build/$D.tex --template default
  12. fi
  13. done
  14. cd ./build
  15. for f in *.tex
  16. do
  17. pdflatex -interaction=nonstopmode $f
  18. done
  19. cd ../
  20. pandoc ../README.md ../SUMMARY.md ../CONTRIBUTING.md ../contributors.md \
  21. -o ./build/Preface.tex --template default
  22. pdfunite ./build/*.pdf LinuxKernelInsides.pdf