Added mdwn_itex.
[blog.git] / posts / mdwn_itex.mdwn_itex
1 In my [[last post|MathML]] I plugged Jason Blevins' [mdwn_itex
2 plugin][plugin].  It turns out that it was harder than I'd expected to
3 get the plugin working with ikiwiki, so I'm recording the steps I took
4 here in case other ikiwiki users find this useful.
5
6 * Install [itex2MML][]
7 * [Install][install_plugin] my updated [[mdwn_itex.pm|mdwn_itex.pm]]
8   plugin ([[mdwn_itex.patch|mdwn_itex.patch]] against Jason's
9   version).
10 * Patch your ikiwiki [templates][] to use a `DOCTYPE` supporting
11   MathML ([[mdwn_itex-templates.patch|mdwn_itex-templates.patch]]).
12 * Add config options along the lines of:
13
14         # plugins to add to the default configuration
15         add_plugins => [qw{ ... mdwn_itex ...}],
16         # plugins to disable
17         disable_plugins => [qw{... htmlscrubber htmltidy ...}],
18
19         # location of template files
20         templatedir => '/path/to/patched/templates',
21
22         # mdwn_itex plugin
23         # path to the itex2MML binary
24         itex2mml => '/usr/local/bin/itex2MML',
25         # autonumber display equations?
26         itex_num_equations => 1,
27
28 * Create new files with the `.mdwn_itex` extension, and start
29   including [itex][]:
30
31   Euler's identity
32
33   \[ e^{i \pi} + 1 = 0 \]
34
35   has lots of fun constants: $e$, $i$, $\pi$,
36   $1$, and $0$.
37
38 Which will render as
39
40 Euler's identity
41
42 \[ e^{i \pi} + 1 = 0 \]
43
44 has lots of fun constants: $e$, $i$, $\pi$, $1$, and $0$.
45
46 The `htmlscrubber` and `htmltidy` plugins must be disabled because
47 otherwise they [strip out the MathML markup][strip].
48
49 [plugin]: http://jblevins.org/git/ikiwiki/plugins.git/plain/mdwn_itex.pm
50 [itex2MML]: http://golem.ph.utexas.edu/~distler/blog/itex2MML.html
51 [install_plugin]: http://ikiwiki.info/plugins/install/
52 [templates]: http://ikiwiki.info/templates/
53 [strip]: http://ikiwiki.info/todo/svg/
54 [itex]: http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html
55
56 [[!tag tags/blogging]]