In thinking about Paul Rubin's new math modules, it occurred to me that it would be nice to have some conditionals in the layout files. Attached is a patch that adds IfStyle and IfCounter tags. The effect of these is to act as normal Style and Counter tags do, if the style or counter already exists; otherwise, the contents is read and discarded, as if it were a big comment block.

So one can do things like this:

IfStyle Axiom
    ...
End

and thereby modify the style, but only if it exists. This will be useful in modifying math environments: In some cases, we do not know exactly what styles we have.

I think this will be sufficient for actual needs. But it's an obvious question whether we should do something more general. I'd also appreciate comments on the way I've done this.

By the way: Shouldn't Counters::newCounter() check whether the counter already exists before it creates a new one?

Richard

Reply via email to