Pre-compilation of tasks so the code is not necessary in exercise packages.
This commit is contained in:
parent
1257b09303
commit
66e7216173
8
Makefile
8
Makefile
@ -2,6 +2,9 @@ SHELL=/bin/bash
|
|||||||
|
|
||||||
default: preview
|
default: preview
|
||||||
|
|
||||||
|
# Build everything there is.
|
||||||
|
all: listings tasks preview publication
|
||||||
|
|
||||||
# Remove builds and LaTeX output.
|
# Remove builds and LaTeX output.
|
||||||
clean:
|
clean:
|
||||||
@echo Cleaning up temporary files.
|
@echo Cleaning up temporary files.
|
||||||
@ -13,6 +16,10 @@ clean:
|
|||||||
listings: listings/**/*
|
listings: listings/**/*
|
||||||
./compile_listings
|
./compile_listings
|
||||||
|
|
||||||
|
# Compile pre-rendered tasks
|
||||||
|
tasks: exercises/**/*
|
||||||
|
./compile_tasks
|
||||||
|
|
||||||
# Compile a preview PDF containing all contents
|
# Compile a preview PDF containing all contents
|
||||||
preview: main.tex
|
preview: main.tex
|
||||||
echo "\newcommand\exercisemode{any}" > exercise-mode.tex
|
echo "\newcommand\exercisemode{any}" > exercise-mode.tex
|
||||||
@ -77,6 +84,7 @@ publication-zip-with-exercises: publication-dir main.tex
|
|||||||
cp --parents main.tex praeamble.tex commands.tex content/* graphics/* listings/**/*{.tex,pdf,bib} temp/
|
cp --parents main.tex praeamble.tex commands.tex content/* graphics/* listings/**/*{.tex,pdf,bib} temp/
|
||||||
cp --parents exercises/**/* temp/
|
cp --parents exercises/**/* temp/
|
||||||
rm -f temp/exercises/**/*.done.{tex,bib}
|
rm -f temp/exercises/**/*.done.{tex,bib}
|
||||||
|
rm -f temp/exercises/**/*.rend.tex
|
||||||
find temp/ -name '*.raw.*' -exec bash -c 'sed "s/\.raw\./\./g" <<<{} | xargs mv {}' \;
|
find temp/ -name '*.raw.*' -exec bash -c 'sed "s/\.raw\./\./g" <<<{} | xargs mv {}' \;
|
||||||
find temp/ -name '*.tex' -exec sed -i -e 's/\.raw\./\./g' {} \;
|
find temp/ -name '*.tex' -exec sed -i -e 's/\.raw\./\./g' {} \;
|
||||||
cd temp && zip ../public/project-with-exercises * **/* **/**/*
|
cd temp && zip ../public/project-with-exercises * **/* **/**/*
|
||||||
|
|||||||
31
compile_tasks
Executable file
31
compile_tasks
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
for D in exercises/*; do
|
||||||
|
echo "${D}"
|
||||||
|
if [ -d "${D}" ]; then
|
||||||
|
# convert tex to pdf
|
||||||
|
for F in ${D}/*.rend.tex; do
|
||||||
|
if [ -f "${F}" ]; then
|
||||||
|
echo "###### Rendering ${F} ######"
|
||||||
|
pdflatex --output-directory "${D}" --shell-escape "${F}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# crop pdf
|
||||||
|
for F in ${D}/*.rend.pdf; do
|
||||||
|
if [ -f "${F}" ]; then
|
||||||
|
pdfcrop "${F}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# remove temporary files
|
||||||
|
for F in ${D}/*.{aux,log,out}; do
|
||||||
|
if [ -f "${F}" ]; then
|
||||||
|
rm ${F}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# move pdf to graphics folder
|
||||||
|
for F in ${D}/*.pdf; do
|
||||||
|
if [ -f "${F}" ]; then
|
||||||
|
mv ${F} graphics/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
@ -1,29 +1,2 @@
|
|||||||
\begin{center}
|
% Ersetzt diese Grafik durch die entsprechenden Formeln:
|
||||||
|
\includegraphics{graphics/math-formulas.rend-crop.pdf}
|
||||||
\textbf{Fallbeschleunigung in Deutschland}
|
|
||||||
$$9,81\,\frac{m}{s^2}$$ \\
|
|
||||||
~ \\
|
|
||||||
|
|
||||||
\textbf {pq-Formel}
|
|
||||||
$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$ \\
|
|
||||||
~ \\
|
|
||||||
|
|
||||||
\textbf{Mitternachtsformel}
|
|
||||||
$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ \\
|
|
||||||
~ \\
|
|
||||||
|
|
||||||
\textbf{Catalansche Zahlen}
|
|
||||||
\begin{equation*} C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!} \end{equation*} \\
|
|
||||||
~ \\
|
|
||||||
|
|
||||||
\textbf{Definition der Fakultät}
|
|
||||||
$$n! = \prod_{i=1}^{n} i$$ \\
|
|
||||||
~ \\
|
|
||||||
|
|
||||||
\textbf{Menge aller ungeraden natürlichen Zahlen}
|
|
||||||
$$\{ x \mid x \in \mathds{N}, \mathrm{ungerade}(x) \}$$
|
|
||||||
~ \\
|
|
||||||
|
|
||||||
\textbf{Elimination $\neg\exists x$}
|
|
||||||
$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$
|
|
||||||
\end{center}
|
|
||||||
|
|||||||
47
exercises/maths/math-formulas.rend.tex
Normal file
47
exercises/maths/math-formulas.rend.tex
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
\documentclass[a4paper, ngerman]{report}
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\usepackage{babel}
|
||||||
|
\usepackage{eurosym, tipa, textcomp, textgreek, upgreek}
|
||||||
|
\usepackage{amssymb, amsfonts, amsmath, dsfont}
|
||||||
|
\usepackage[hidelinks]{hyperref}
|
||||||
|
\usepackage{cleveref}
|
||||||
|
\usepackage{graphicx}
|
||||||
|
\usepackage{longtable, array, tabularx, booktabs, colortbl}
|
||||||
|
\usepackage{minted}
|
||||||
|
\begin{document}
|
||||||
|
\thispagestyle{empty}
|
||||||
|
|
||||||
|
\hrule
|
||||||
|
\begin{center}
|
||||||
|
|
||||||
|
\textbf{Fallbeschleunigung in Deutschland}
|
||||||
|
$$9,81\,\frac{m}{s^2}$$ \\
|
||||||
|
~ \\
|
||||||
|
|
||||||
|
\textbf {pq-Formel}
|
||||||
|
$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$ \\
|
||||||
|
~ \\
|
||||||
|
|
||||||
|
\textbf{Mitternachtsformel}
|
||||||
|
$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ \\
|
||||||
|
~ \\
|
||||||
|
|
||||||
|
\textbf{Catalansche Zahlen}
|
||||||
|
\begin{equation*} C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!} \end{equation*} \\
|
||||||
|
~ \\
|
||||||
|
|
||||||
|
\textbf{Definition der Fakultät}
|
||||||
|
$$n! = \prod_{i=1}^{n} i$$ \\
|
||||||
|
~ \\
|
||||||
|
|
||||||
|
\textbf{Menge aller ungeraden natürlichen Zahlen}
|
||||||
|
$$\{ x \mid x \in \mathds{N}, \mathrm{ungerade}(x) \}$$
|
||||||
|
~ \\
|
||||||
|
|
||||||
|
\textbf{Elimination $\neg\exists x$}
|
||||||
|
$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$
|
||||||
|
\end{center}
|
||||||
|
|
||||||
|
\hrule
|
||||||
|
\end{document}
|
||||||
BIN
graphics/math-formulas.rend-crop.pdf
Normal file
BIN
graphics/math-formulas.rend-crop.pdf
Normal file
Binary file not shown.
BIN
graphics/math-formulas.rend.pdf
Normal file
BIN
graphics/math-formulas.rend.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user