Random

From Wiki
Jump to navigation Jump to search

This page describes how to use random (to produce pseudo-random values) in ConTeXt and MetaPost. The uniformdeviate function in MetaPost, by default, uses a seeded value. This is useful to generate the "same" random results each time the final product is generated, but hampers creating books that differ from each other on successive generations.

See the \getrandomnumber command for details.

The random seed is stored in the tuc file so that you get the same output each time the file is compiled (otherwise, multiple compiles can lead to an infinite cycle and you may not get all the references correct). Another approach is to delete the tuc file between runs.