On Mon, Jun 16, 2008 at 07:16:45PM +0200, Enrico Forestieri wrote:
> > void InsetMathSqrt::write(WriteStream & os) const
> > {
> >     MathEnsurer ensurer(os);
> >     os << "\\sqrt{" << cell(0) << '}';
> > }
> 
> I understand that this relieves you from the need of the final
> pendingBrace call, but I wonder whether this is worth the additional
> burden of constructing and destructing an object.

There is no inherent cost of "constructing and destructing" an object.

> > Possibly this code does not even have to be in the individual insets
> > but could be handled generically in InsetMathNest or such. 
> 
> You are welcome to perform improvements, of course. I also thought
> about creating two new EnsureMath and LyXMathSym math insets, but
> abandoned the idea, as in the current implementation \ensuremath and
> \lyxmathsym cannot nest, and I think that this is good for avoiding
> the already known weirdnesses about text in math in text ...

In which cases is an \ensuremath needed when the dsurrounding
InsetMathNest doesn't have/need it?

Andre'

Reply via email to