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.
|
|
|
|
|
2018-02-14 14:28:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
rm -r build
|
|
|
|
mkdir build
|
2020-10-02 18:48:21 +00:00
|
|
|
for D in ../*; do
|
|
|
|
if [ -d "$D" ]
|
2018-02-14 14:28:22 +00:00
|
|
|
then
|
2020-10-02 18:48:21 +00:00
|
|
|
name=$(basename "$D")
|
|
|
|
echo "Converting $name . . ."
|
|
|
|
pandoc "$D"/README.md "$D"/linux-*.md \
|
|
|
|
-o build/"$name".tex --template default
|
2018-02-14 14:28:22 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2020-10-02 18:48:21 +00:00
|
|
|
cd ./build || exit 1
|
2018-02-14 14:28:22 +00:00
|
|
|
for f in *.tex
|
|
|
|
do
|
2020-10-02 18:48:21 +00:00
|
|
|
pdflatex -interaction=nonstopmode "$f"
|
2018-02-14 14:28:22 +00:00
|
|
|
done
|
|
|
|
|
2020-10-02 18:48:21 +00:00
|
|
|
cd ../ || exit 1
|
2018-03-20 18:40:36 +00:00
|
|
|
pandoc ../README.md ../SUMMARY.md ../CONTRIBUTING.md ../contributors.md \
|
2018-02-14 14:28:22 +00:00
|
|
|
-o ./build/Preface.tex --template default
|
|
|
|
|
|
|
|
pdfunite ./build/*.pdf LinuxKernelInsides.pdf
|