linux-insides/Scripts/latex.sh

27 lines
732 B
Bash
Raw Normal View History

2018-02-14 14:32:19 +00:00
# latex.sh
# A script for converting Markdown files in each of the subdirectories into a unified PDF typeset in LaTeX.
# Requires TexLive, Pandoc templates and pdfunite. Not necessary if you just want to read the PDF, only if you're compiling it yourself.
#!/bin/bash
rm -r build
mkdir build
2018-03-20 18:40:36 +00:00
for D in $(ls ../); do
if [ -d "../${D}" ]
then
echo "Converting $D . . ."
2018-03-20 18:40:36 +00:00
pandoc ../$D/README.md ../$D/linux-*.md -o build/$D.tex --template default
fi
done
cd ./build
for f in *.tex
do
pdflatex -interaction=nonstopmode $f
done
cd ../
2018-03-20 18:40:36 +00:00
pandoc ../README.md ../SUMMARY.md ../CONTRIBUTING.md ../contributors.md \
-o ./build/Preface.tex --template default
pdfunite ./build/*.pdf LinuxKernelInsides.pdf