add pdf generation
This commit is contained in:
99
makefile
Normal file
99
makefile
Normal file
@@ -0,0 +1,99 @@
|
||||
|
||||
all: all_booklets all_docduments
|
||||
|
||||
all_docduments: prepare pdf/assambly_report.pdf pdf/c_report.pdf
|
||||
all_booklets: prepare pdf/assambly_report.booklet.pdf pdf/c_report.booklet.pdf
|
||||
prepare:
|
||||
mkdir -p latex pdf
|
||||
|
||||
clean:
|
||||
rm -r build latex
|
||||
|
||||
clean_all:
|
||||
rm -r build latex pdf
|
||||
|
||||
install_arch:
|
||||
mkdir -p build/install
|
||||
pacman -Sy --noconfirm --needed curl unzip texlive-basic texlive-langeuropean pandoc
|
||||
|
||||
test -e build/install/ubuntu.zip || curl https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip -o build/install/ubuntu.zip
|
||||
test -d build/install/ubuntu && rm -r build/install/ubuntu || echo
|
||||
mkdir build/install/ubuntu
|
||||
unzip build/install/ubuntu.zip -d build/install/ubuntu
|
||||
mkdir -p /usr/share/fonts/ubuntu
|
||||
cp build/install/ubuntu/ubuntu-font-family-0.83/*.ttf /usr/share/fonts/ubuntu/
|
||||
chmod 0775 /usr/share/fonts/ubuntu
|
||||
chmod 0664 /usr/share/fonts/ubuntu/*
|
||||
|
||||
test -e build/install/roboto.zip || curl https://dl.dafont.com/dl/?f=roboto -o build/install/roboto.zip
|
||||
test -d build/install/roboto && rm -r build/install/roboto || echo
|
||||
mkdir build/install/roboto
|
||||
unzip build/install/roboto.zip -d build/install/roboto
|
||||
mkdir -p /usr/share/fonts/roboto
|
||||
cp build/install/roboto/*.ttf /usr/share/fonts/roboto/
|
||||
chmod 0775 /usr/share/fonts/roboto
|
||||
chmod 0664 /usr/share/fonts/roboto/*
|
||||
|
||||
install_ubuntu:
|
||||
mkdir -p build/install
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
curl unzip texlive texlive-lang-european texlive-lang-greek texlive-xetex pandoc
|
||||
|
||||
test -e build/install/ubuntu.zip || curl https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip -o build/install/ubuntu.zip
|
||||
test -d build/install/ubuntu && rm -r build/install/ubuntu || echo
|
||||
mkdir build/install/ubuntu
|
||||
unzip build/install/ubuntu.zip -d build/install/ubuntu
|
||||
mkdir -p /usr/share/fonts/ubuntu
|
||||
cp build/install/ubuntu/ubuntu-font-family-0.83/*.ttf /usr/share/fonts/ubuntu/
|
||||
chmod 0775 /usr/share/fonts/ubuntu
|
||||
chmod 0664 /usr/share/fonts/ubuntu/*
|
||||
|
||||
test -e build/install/roboto.zip || curl https://dl.dafont.com/dl/?f=roboto -o build/install/roboto.zip
|
||||
test -d build/install/roboto && rm -r build/install/roboto || echo
|
||||
mkdir build/install/roboto
|
||||
unzip build/install/roboto.zip -d build/install/roboto
|
||||
mkdir -p /usr/share/fonts/roboto
|
||||
cp build/install/roboto/*.ttf /usr/share/fonts/roboto/
|
||||
chmod 0775 /usr/share/fonts/roboto
|
||||
chmod 0664 /usr/share/fonts/roboto/*
|
||||
|
||||
# =======================================
|
||||
# === latex generation ==================
|
||||
# =======================================
|
||||
|
||||
latex/assambly_report.latex: converters/mdToLatex.sh converters/template.latex report-1/*.md
|
||||
mkdir -p build/assambly_report
|
||||
bash converters/mdToLatex.sh report-1/assambly_report.md latex/assambly_report.latex
|
||||
|
||||
latex/c_report.latex: converters/mdToLatex.sh converters/template.latex report-1/*.md
|
||||
mkdir -p build/c_report
|
||||
bash converters/mdToLatex.sh report-1/c_report.md latex/c_report.latex
|
||||
|
||||
# =======================================
|
||||
# === pdf generation ====================
|
||||
# =======================================
|
||||
|
||||
pdf/assambly_report.pdf: latex/assambly_report.latex
|
||||
cd build/assambly_report && xelatex ../../latex/assambly_report.latex
|
||||
cd build/assambly_report && xelatex ../../latex/assambly_report.latex
|
||||
cd build/assambly_report && xelatex ../../latex/assambly_report.latex
|
||||
mv build/assambly_report/assambly_report.pdf pdf/assambly_report.pdf
|
||||
|
||||
pdf/assambly_report.booklet.pdf: converters/bookletify.latex pdf/assambly_report.pdf
|
||||
mkdir -p build/assambly_report.booklet
|
||||
sed -e 's|?pdf?|../../pdf/assambly_report.pdf|' converters/bookletify.latex >build/assambly_report.booklet/bookletify.latex
|
||||
pdflatex -interaction=nonstopmode -output-directory="build/assambly_report.booklet" "build/assambly_report.booklet/bookletify.latex"
|
||||
mv build/assambly_report.booklet/bookletify.pdf pdf/assambly_report.booklet.pdf
|
||||
|
||||
pdf/c_report.pdf: latex/c_report.latex
|
||||
cd build/c_report && xelatex ../../latex/c_report.latex
|
||||
cd build/c_report && xelatex ../../latex/c_report.latex
|
||||
cd build/c_report && xelatex ../../latex/c_report.latex
|
||||
mv build/c_report/c_report.pdf pdf/c_report.pdf
|
||||
|
||||
pdf/c_report.booklet.pdf: converters/bookletify.latex pdf/c_report.pdf
|
||||
mkdir -p build/c_report.booklet
|
||||
sed -e 's|?pdf?|../../pdf/c_report.pdf|' converters/bookletify.latex >build/c_report.booklet/bookletify.latex
|
||||
pdflatex -interaction=nonstopmode -output-directory="build/c_report.booklet" "build/c_report.booklet/bookletify.latex"
|
||||
mv build/c_report.booklet/bookletify.pdf pdf/c_report.booklet.pdf
|
||||
Reference in New Issue
Block a user