diff --git a/Makefile b/Makefile index 371e380..8fbb95b 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,9 @@ SHELL=/bin/bash default: preview +# Build everything there is. +all: listings tasks preview publication + # Remove builds and LaTeX output. clean: @echo Cleaning up temporary files. @@ -13,6 +16,10 @@ clean: listings: listings/**/* ./compile_listings +# Compile pre-rendered tasks +tasks: exercises/**/* + ./compile_tasks + # Compile a preview PDF containing all contents preview: main.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 exercises/**/* temp/ 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 '*.tex' -exec sed -i -e 's/\.raw\./\./g' {} \; cd temp && zip ../public/project-with-exercises * **/* **/**/* diff --git a/compile_tasks b/compile_tasks new file mode 100755 index 0000000..a85b0c4 --- /dev/null +++ b/compile_tasks @@ -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 diff --git a/exercises/maths/math-formulas.raw.tex b/exercises/maths/math-formulas.raw.tex index 4f6311c..609c4f7 100644 --- a/exercises/maths/math-formulas.raw.tex +++ b/exercises/maths/math-formulas.raw.tex @@ -1,29 +1,2 @@ -\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} \ No newline at end of file +% Ersetzt diese Grafik durch die entsprechenden Formeln: +\includegraphics{graphics/math-formulas.rend-crop.pdf} diff --git a/exercises/maths/math-formulas.rend.tex b/exercises/maths/math-formulas.rend.tex new file mode 100644 index 0000000..78c8b52 --- /dev/null +++ b/exercises/maths/math-formulas.rend.tex @@ -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} diff --git a/graphics/math-formulas.rend-crop.pdf b/graphics/math-formulas.rend-crop.pdf new file mode 100644 index 0000000..d463530 Binary files /dev/null and b/graphics/math-formulas.rend-crop.pdf differ diff --git a/graphics/math-formulas.rend.pdf b/graphics/math-formulas.rend.pdf new file mode 100644 index 0000000..f6fee65 Binary files /dev/null and b/graphics/math-formulas.rend.pdf differ diff --git a/listings/basic-document-structure/headlines_crop.pdf b/listings/basic-document-structure/headlines_crop.pdf index 58282ae..279291f 100644 Binary files a/listings/basic-document-structure/headlines_crop.pdf and b/listings/basic-document-structure/headlines_crop.pdf differ diff --git a/listings/lists/definition-list_crop.pdf b/listings/lists/definition-list_crop.pdf index 7c79c91..b524fe0 100644 Binary files a/listings/lists/definition-list_crop.pdf and b/listings/lists/definition-list_crop.pdf differ diff --git a/listings/project-structure/main-file_crop.pdf b/listings/project-structure/main-file_crop.pdf index ca309ef..3e0b164 100644 Binary files a/listings/project-structure/main-file_crop.pdf and b/listings/project-structure/main-file_crop.pdf differ