diff --git a/src/content/blog/tikz-svg.mdx b/src/content/blog/tikz-svg.mdx new file mode 100644 index 0000000..048a2b7 --- /dev/null +++ b/src/content/blog/tikz-svg.mdx @@ -0,0 +1,69 @@ +--- +title: TikZ +pubDate: 2025-02-06T19:00:00Z +description: Converting TikZ graphics into svg graphics. +--- +At some point a man has to realize that they went down a rabbit-hole without any way to escape it. TikZ is one such rabbit-hole and, yes, I am that man. + +In broad terms [TikZ](https://tikz.dev/) is a programming language within [LaTeX](https://www.latex-project.org/), to generate graphics from code. + +# Standalone TikZ +The [standalone package](https://ctan.org/pkg/standalone) for LaTeX is inteded as a way to put graphics such as those generated by TikZ into a standalone document to be included in other documents. We are going to use it to generate a pdf with the TikZ graphic. +```latex +% graphic.tex +\documentclass[border=0pt, tikz]{standalone} + +\begin{document} + \begin{tikzpicture} + + \end{tikzpicture} +\end{document} +``` + +To compile we simply run: +```shell +pdflatex graphic.tex +``` + +# Convert to SVG +To convert this pdf into a svg file we are going to use the [pdf2svg](https://cityinthesky.co.uk/opensource/pdf2svg/) command-line converter: +```shell +pdf2svg graphic.tex +``` +Et voilĂ ! We produced an svg file from TikZ Source Code. + +# Quick and Easy +Consider the following script for quick compilation: +```bash +#!/bin/bash + +# check for input file +input="$1" + +if [ -z "$input" ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ ! -f "$1.tex" ]; then + echo "File not found: $1.tex" + exit 1 +fi + +# compile +echo "Compiling $1.tex..." +pdflatex -interaction=batchmode "$1.tex" > /dev/null + +if [ $? -ne 0 ]; then + echo "Error: pdflatex failed!" + exit 1 +fi + +echo "Converting to $1.svg..." +pdf2svg "$1.pdf" "$1.svg" + +echo "Done!" + +# cleanup +rm "$1.aux" "$1.log" +``` diff --git a/src/content/projects/Engagement-Wegweiser.md b/src/content/projects/Engagement-Wegweiser.md index 427f4c5..fb7b421 100644 --- a/src/content/projects/Engagement-Wegweiser.md +++ b/src/content/projects/Engagement-Wegweiser.md @@ -1,7 +1,7 @@ --- title: Engagement Wegweiser pubDate: 2024-12-26T22:00:00Z -description: Engagement Wegweiser +description: Engagement Wegweiser is a tool developed by me for the Student Representation of the University of Konstanz to help students find committees and university groups that best suit their particular interests. heroImage: /images/posts/engagement-wegweiser/homepage.png --- The [Engagement Wegweiser](https://engagement.stuve-uni-kn.de) was originally a tool for students to find committees and university groups that best suit their particular interests. Since then it has become a centrepiece of the Student Representation's campaign to encourage more involvement from the student body at the University of Konstanz. @@ -71,4 +71,4 @@ Additionally we have decided to update the core mechanic with which committees a The details of the system still have to be thought out and discussed, but I imagine it will be fairly close to the principle of the [Frag Wahltraut](/projects/frag-wahltraut) system, which in turn basically works the same as the [Wahl-O-Mat](https://www.bpb.de/themen/wahl-o-mat/) that the [Federal Agency for Civic Education](https://www.bpb.de/die-bpb/ueber-uns/federal-agency-for-civic-education/) hosts for national and state elections as well as the elections for the european parliament. -A catalogue of questions will be assembled and given to student representatives of university committees and university groups such that they can give their personal scores. All the Engagement Wegweiser will then do is: compute the similarity between the users answers with the committees and groups to give a sorted listed of all areas of student participation within the university. \ No newline at end of file +A catalogue of questions will be assembled and given to student representatives of university committees and university groups such that they can give their personal scores. All the Engagement Wegweiser will then do is: compute the similarity between the users answers with the committees and groups to give a sorted listed of all areas of student participation within the university. diff --git a/src/content/projects/Frag-Wahltraut.md b/src/content/projects/Frag-Wahltraut.md index e2c6c62..75f438b 100644 --- a/src/content/projects/Frag-Wahltraut.md +++ b/src/content/projects/Frag-Wahltraut.md @@ -1,7 +1,7 @@ --- title: Frag Wahltraut pubDate: 2024-12-26T22:00:00Z -description: Frag Wahltraut +description: Frag Wahltraut is a tool developed by me for the Student Representation of the University of Konstanz to help students find out which party best represents their own political views in the upcoming university elections. heroImage: /images/posts/frag-wahltraut/homepage.png --- @@ -51,4 +51,4 @@ Clicking on the parties reveals their stances on the theses as well as a short(- ![Result page of Frag Wahltraut with more information to the stances of a party](/images/posts/frag-wahltraut/result-accordion.png) ## To the Stars -As described in my article about the [Engagement Wegweiser](/projects/engagement-wegweiser) I am currently working on a revamp of the tools that are provided by the Student Representation of the University Konstanz. Once the new version of the Engagement Wegweiser is done, Frag Wahltraut will once again become a descendant of that newer version. Thankfully, at its core, the future Engagement Wegweiser will function as a generalized version of Frag Wahltraut, making it extremely easy to reuse the system for the coming elections in 2025. \ No newline at end of file +As described in my article about the [Engagement Wegweiser](/projects/engagement-wegweiser) I am currently working on a revamp of the tools that are provided by the Student Representation of the University Konstanz. Once the new version of the Engagement Wegweiser is done, Frag Wahltraut will once again become a descendant of that newer version. Thankfully, at its core, the future Engagement Wegweiser will function as a generalized version of Frag Wahltraut, making it extremely easy to reuse the system for the coming elections in 2025.