1
0

latex.sh 792 B

12345678910111213141516171819202122232425262728
  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 ../*; do
  8. if [ -d "$D" ]
  9. then
  10. name=$(basename "$D")
  11. echo "Converting $name . . ."
  12. pandoc "$D"/README.md "$D"/linux-*.md \
  13. -o build/"$name".tex --template default
  14. fi
  15. done
  16. cd ./build || exit 1
  17. for f in *.tex
  18. do
  19. pdflatex -interaction=nonstopmode "$f"
  20. done
  21. cd ../ || exit 1
  22. pandoc ../README.md ../SUMMARY.md ../CONTRIBUTING.md ../contributors.md \
  23. -o ./build/Preface.tex --template default
  24. pdfunite ./build/*.pdf LinuxKernelInsides.pdf