-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

LaTeX Cookbook
By :

A very fundamental topic in computer science is the concept of an algorithm. That's a set of operations performed step by step. The purpose can be calculations or data processing, for example, sorting.
Algorithms can be visualized by a flow chart, which we did in Chapter 9, Creating Graphics. In this recipe, we will print an algorithm using pseudocode with syntax highlighting. Our example will show the calculation for a point in the Mandelbrot set.
We will use the algorithmicx
package. For a better explanation, we split the work into many small steps. As with all examples, you can download the complete code from http://latex-cookbook.net, so you don't need to type it. At the end, you will see an image with the output. You can switch to the output image and back to the how-to, to see how we build the algorithm layout step by step. Here it goes:
\documentclass{article}