Available in a git repository.
Repository: ikiwiki
Browsable repository: ikiwiki
Author: W. Trevor King

In my last post I plugged Jason Blevins' mdwn_itex plugin. It turns out that it was harder than I'd expected to get the plugin working with ikiwiki, so I'm recording the steps I took here in case other ikiwiki users find this useful.

  • Install itex2MML
  • Install my updated mdwn_itex.pm plugin (mdwn_itex.patch against Jason's version).
  • Patch your ikiwiki templates to use a DOCTYPE supporting MathML (mdwn_itex-templates.patch).
  • Create a script wrapping itex2MML for escaping UTF-8 and named entities (e.g. itex2MML.sh).
  • Add config options along the lines of:

    # plugins to add to the default configuration
    add_plugins => [qw{ ... mdwn_itex ...}],
    # plugins to disable
    disable_plugins => [qw{... htmlscrubber htmltidy ...}],
    
    
    # location of template files
    templatedir => '/path/to/patched/templates',
    
    
    # mdwn_itex plugin
    # path to the itex2MML binary
    itex2mml => '/path/to/your/wrapper/itex2MML.sh
    # autonumber display equations?
    itex_num_equations => 1,
    
  • Create new files with the .mdwn_itex extension, and start including itex:

    Euler's identity

    \[ e^{i \pi} + 1 = 0 \]

    has lots of fun constants: $e$, $i$, $\pi$, $1$, and $0$.

Which will render as

Euler's identity

(1)e iπ+1=0

has lots of fun constants: e, i, π, 1, and 0.

The htmlscrubber and htmltidy plugins must be disabled because otherwise they strip out the MathML markup.

Update: current versions of my patched files can be found in the mdwn_itex branch of my ikiwiki git repository.