I have a local wiki, with Instiki 0.19.8 and Ruby on Rails 2.3.18 . It would be great if I could create a “preamble” in order to define some tex commands – eg, if I could include a line \newcommand\b{\bullet} , and on every page I could type \b instead of \bullet . Is this already a feature?
No.
Macros are not a feature of itex2MML.
The first reason is security: it’s very hard to protect against the (La)TeX equivalent of the billion laughs attack. This is, of course true of TeX/LaTeX itself, but it’s a much more serious concern when used in a web application (like Instiki, or this forum software).
The second reason is an implementation detail: in the preferred mode of use (as used in Instiki and in this forum software), a separate invocation of itex2MML is used for each formula. A macro defined in one invocation could not be “re-used” in another.
Now, neither of these would be incompatible with implementing a “global” preamble (whose content would be controlled by the website owner and not alterable by ordinary users). On the other hand, that would be rather less-than-useful on a public wiki (or forum), so there hasn’t been much user demand for such a feature either.
I guess a private wiki would be one use-case where it might be desirable …
I see, thanks Jacques. Can you think of any workaround that would let me (for instance) type \b every time I want a \bullet ?
Do you use Firefox?
A GreaseMonkey script could provide that sort of customization (and more).
There are other extensions for using an external editor with textarea
s, which would be another way to get the sort of customizable editing experience you are looking for.
Oh, GreaseMonkey looks promising. Thanks!