Texdown is a Wiki-syntax-like frontend language that produces LaTeX output. See this blog post for a brief overview.


Texdown is written in Python, and should work with Python 2 or 3. Get Texdown from Github:
git clone https://github.com/nfd/texdown
(Or use Mercurial: hg clone git+ssh://git@github.com/nfd/texdown)


python texdown2latex.py infile.texdown outfile.tex


In-line markup

Bold: Surround the text with single asterisks.

Italics: Surround the text with single forward slashes.

Teletype: Surround the text with '' on both sides.

Automatic escaping

Percents (%) and underscores (_) are converted to \% and \_, respectively, except inside blocks. As a special case, if a line starts with %, it is considered a comment. (This is different to LaTeX where everything following an unescaped percent is a comment regardless of the position of the percent character in the line). The double prime character " is converted into LaTeX quotes `` and ''.

Sections, labels, references

Chapters: Create a chapter by putting "##" on either side of the chapter name.

Sections: Same idea, using "=="

Subsections: Same again, using "=".

Subsubsections: And same again, using "-".

Labels: Create a label by surrounding the label name with "<<" and ">>".

References: Use single square brackets for referencing.

Citations: Use "[[" and "]]" for citations.

Captions: Use "~~ " and " ~~" to create a caption. Captions may contain labels.


Bulleted lists: create a bulleted list by starting a one or more lines with one or more spaces, then a single asterisk.

Definition lists: Each element must start with a space and end with a colon.

Single-line macros

Type !! at the start of a line, followed by a macro name, followed by any arguments, to run a single-line macro.


Indent one or more contiguous lines with a single tab character. This forms a "block". At the end of the first line, type a tab, then "!!", then the name of the macro to be invoked on this block.


texdown2latex attempts to import localmacros.py when it starts up. A sample is included in the distribution. Inside localmacros.py, define a class named Macros. Then, add your macros. The function name should start with the macro_ followed by the name you'd like to reference the macro by from within your Texdown document.

Adding single-line commands

These commands start with "!!" at the beginning of the line. The implementing function takes a single parameter (apart from self), args, which contains everything typed after the macro name on the same line. The function macro_floatgraphic gives an example.

Adding block commands

These commands mark-up blocks, which are defined as contiguous lines each indented with one or more tab characters, where the first line ends with a tab character, !!, and a macro name. These take as an argument a list of lines in the block. The lines have their first tab character stripped, as well as the macro name sequence on the first line. macro_floatcode gives an example.