Forums itex2MML

possible to create web-wide "preamble"?

Subscribe to possible to create web-wide "preamble"? 8 posts, 2 voices

 
natebottman 5 posts

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?

 
distler 123 posts

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 …

 
natebottman 5 posts

I see, thanks Jacques. Can you think of any workaround that would let me (for instance) type \b every time I want a \bullet ?

 
distler 123 posts

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 textareas, which would be another way to get the sort of customizable editing experience you are looking for.

 
natebottman 5 posts

Oh, GreaseMonkey looks promising. Thanks!

Forums itex2MML