Mathgen is a tool to randomly generate fake mathematics papers.

Online version:
Blog page:
Source code (Github):


Mathgen was developed and tested on Ubuntu Linux.  It should work on
other flavors of Unix also.  I have not tried other systems; if you
have a reasonable Perl installation I would guess you should be okay,
but I make no promises.

To run Mathgen, you will need:

- Perl
- LaTeX
- BibTeX
- zip (for --mode=zip)

You will need the following LaTeX packages:

- fullpage
- mathrsfs
- natbib
- truncate

If you want to produce books (--product=book), you will need the
following additional LaTeX packages:

- geometry
- txfonts
- hyphenat
- textcase
- hyperref
- titlesec
- makeidx
- url
- tocbibind

You will also need the `makeindex' program.


The main Mathgen program is `'.  For a summary of options,

$ ./ --help

The current default behavior, if `' is run without options,
is to generate an article with one randomly generated author and view
the output with `evince'.


Generate an article with author "J. Doe" and view the output with

$ ./ --product=article --mode=view --author="J. Doe" --viewer=xpdf

The same, but write the PDF to `mypaper.pdf':

$ ./ --product=article --mode=pdf --author="J. Doe" --output=mypaper.pdf

Give yourself a famous collaborator, and create a zip file with the
source and PDF:

$ ./ --product=article --mode=zip --author="J. Doe" --author="P. Erd\H{o}s"

Tip: To randomly generate an author's name, you can use
`--author=FAMOUS_AUTHOR' or `--author=GENERIC_AUTHOR'.

Generate a book:

$ ./ --product=book --mode=pdf --output=mybook.pdf --author="J. Doe"

Note that this may take a couple of minutes to generate and compile.


As an unofficial fundraiser for the American Mathematical Society, I
am selling randomly generated textbooks via  For more
information, visit

US$5.00 from each sale will be donated to the AMS.   I earn no other
money from these books.

Currently available titles:

_Convex Algebra_ by E. Brown.  Hardcover, 314 pages.

_Higher Group Theory_ by H. Smith.  Paperback, 351 pages.

Each is professionally bound, looks impressive on your desk or
bookshelf, and would make a great gift!

You can also use (or another self-publishing site) to produce
your own personalized Mathgen textbooks.  The output from
`--product=book' is set for 6x9 inch paper and should work directly
for Lulu's "US Trade" size.  

Source code

A quick road map to the files in the source distribution:

- Main driver file, processes options and disposes of

- The SCIgen grammar engine.  Reads the rules files and
  generates the output.

- Common grammar rules, included into the following

- sci{article,book,blurb}.in: Grammar rules specific for the
  corresponding products.


Mathgen was written by Nate Eldredge <nate at thatsmathematics dot com>,
incorporating code from SCIgen (,
by Jeremy Stribling, Max Krohn, and Dan Aguayo, without whom this
project would not exist.  Jordan Eldredge wrote most of the web

A list of names of famous mathematicians, used in the program, was
extracted from the web site The Greatest Mathematicians of All Time
( by James Dow Allen, and is
used by permission. A list of countries and other place names was
taken from Wikipedia


Mathgen is free software.  You are welcome to share, copy, and modify
it, under the terms of the GNU General Public License, version 2.0.
See the file COPYING.