I've heard that LaTeX is Turing complete. Are there any programs written in LaTeX?

ire_and_curses picture ire_and_curses · Jun 3, 2010 · Viewed 27.3k times · Source

It's possible to do interesting things with what would ordinarily be thought of as typesetting languages. For example, you can construct the Mandelbrot set using postscript.

It is suggested in this MathOverflow question that LaTeX may be Turing-complete. This implies the ability to write arbitrary programs (although it may not be easy!). Does anyone know of any concrete example of such a program in LaTeX, which does something highly unusual with the language?

Answer

Derrick Turk picture Derrick Turk · Jun 3, 2010

In issue 13 of The Monad Reader, Stephen Hicks writes about implementing the solution to an ICFP contest (involving Mars rover navigation) in TeX, with copious use of macros. Amusingly, the solution's output when typeset is a postscript map of the rover's path.