Quick Images with TikZ

How do you create high-quality technical images for documents, your website or posts on Stack Exchange? I have used tools in an ad-hoc manner for a while and have become frustrated lately. Once you have used TikZ1 with \(\LaTeX\) most other tools feel inferior. The only problem is: TikZ is a \(\LaTeX\) package and can not be used on its own. So how to convert TikZ to say PNG comfortably?

\(\TeX\)-guru Martin Scharrer comes to the rescue: he wrote the package standalone for exactly this use case. Based on his explanation on tex.SE I built a small bash script that does all the repetitive work for you. With one simple command, this

%p% \usetikzlibrary{arrows,automata,positioning}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,auto]
  \node[state,initial]    (q_0)                {$q_0$};
  \node[state,accepting]  (q_1) [right of=q_0] {$q_1$};

  \path[->] (q_0) edge [bend left]  node {$a$} (q_1)
            (q_1) edge [bend left]  node {$b$} (q_0);

becomes this in a matter of seconds:


Get tikz2png on GitHub and enjoy!

  1. Check out the awesome gallery of examples and the comprehensive manual.

Brandon Sanderson: The Alloy of Law

Brandon Sanderson: The Alloy of Law

The Alloy of Law is set in the world of the Mistborn trilogy, about 300 years after the original books. The heroes of that time have become figures of myth and religion. The area around the pre-industrial capital (formerly Luthadel) is fertile and wealthy, farther out in the Roughs live is like in our Wild West. This is where noble-blooded lawkeeper Wax has made it his job to hunt down criminals until personal tragedy prompts his return to the city. He tries to blend in the noble society and behave as he should but is soon intrigued by a series of seemingly impossible thefts. Instead of preparing his inevitable engagement properly he starts to investigate, supported by his friend and colleague Wayne who has come to visit in order to make sure Wax does not die in of boredom.

Alloy of Law is fast, fun and tragic, but most of all fast. Allomantic-Feruchemic gunfights are probably the most awesome, cinematic thing I have read in a while. They show how incredibly well-conceived Sanderson’s magic system is: it evolves and scales with ease. The story itself is a diverting piece in Sherlock Holmes style, nothing too deep. There is potential for follow-up stories, though, so we’ll see. The main characters are very well-developed considering the size of the book; Sanderson makes every word count1. Besides the abundance of action, verbal exchanges between Wax, Wayne and later Marasi provide most of the fun and make the book a light read despite several tragic scenes. As a fan of the series, I enjoyed the many (religious) references—fact distorted to myth by time—to the old heroes, in particular how their way of life evolved to outright schools of philosophy2.

That I recommend a Sanderson book is probably no surprise, me being a devoted fan of his. Go and read this book even if you have not read or did not like3 the trilogy, it is fun!

  1. This book is short by Sanderson’s standards!
  2. Personally, High Imperial cracked me up the most!
  3. The most frequent complaint seems to be that the trilogy is too slow-paced; this is certainly not the case for Alloy of Law!

Computer Science Stack Exchange Live!

Computer Science Stack Exchange public beta

cs.SE in nondescript beta style

Since my post in December, Computer Science Stack Exchange has gone through private beta and is now accessible for everybody. Head over to cs.stackexchange.com and take a look! We are waiting for your questions so do not hesitate to post anything you have always wanted to know in computer science1, be it theory, applied or even practical!

We also need more expertise: out off almost 190 questions sixteen have yet to receive a good answer. among those are one about equivalence of Büchi automata and linear μ-calculus and another about efficiently learning regular languages.

You might also want to check out our hottest questions, including why Quicksort is often considered the best sorting algorithm, encryption using NP-hard problems and connections between Gödel’s incompleteness theorem and the halting problem.

I am very excited about this site. One one hand, it gives me the opportunity to share my knowledge in computer science with a wide variety of people, and I like teaching. On the other hand, I get to learn a lot. Not only do people ask about things I know next to nothing about so I can learn from the answers, but there are also original concepts. My favorite is Patrick’s proposal of heap automata; I have spent several hours contemplating his question about their power and follow-up questions.

I hope to see you on cs.SE soon!

  1. Mind the FAQ, though.

New Plugin: Cite & List

Simple Bibliography

A simple bibliography with some citations

Finally! I have needed—and wanted to build—this WordPress plugin for a long time, and now it is done. Because I am so bad at making up names, I called it Cite & List because that is what you can do with it: cite articles and list your publications. Both tasks are easily done with shortcodes; users of \(\LaTeX\) will feel right at home. You can also have everything look exactly the way you want it to, thanks to the use of bib2tpl.

Head over to the plugin repository and have a try! I like how the plugin turned out; hopefully I will have ample opportunity of using it, that is get to writing more sciencey posts.

New Version of bib2tpl

Last weekend, I published a new version of bib2tpl, a PHP class to convert BibTeX to anything I wrote a while ago. There certainly were some bumps to iron out; these are the major changes made:

  • Entry filtering now works on all fields.
  • Templates can contain multiple occurrences of group and entry subtemplates now.
  • Condition tags can perform more detailed comparisons now.
  • Improved control over entry ordering.
  • Grouping tags are no longer necessary if grouping is turned off.
  • It is now possible to reuse parsed BibTeX for multiple conversions.
  • @entryid@ has been removed; use @entrykey@ instead, which is now guaranteed to be unique.

You can find a more complete list of changes here, and more information on bib2tpl here.