+MathDelimInset::MathDelimInset(string const & l, string const & r)
+ : MathNestInset(1), left_(l), right_(r)
+{}
+
+
+MathDelimInset::MathDelimInset
+ (string const & l, string const & r, MathArray const & ar)
+ : MathNestInset(1), left_(l), right_(r)
+{
+ cell(0) = ar;
+}
+
+
+MathInset * MathDelimInset::clone() const
+{
+ return new MathDelimInset(*this);
+}
+
+
+void MathDelimInset::write(WriteStream & os) const
+{
+ os << "\\left" << convertDelimToLatexName(left_) << cell(0)
+ << "\\right" << convertDelimToLatexName(right_);
+}
+
+
+void MathDelimInset::normalize(NormalStream & os) const
+{
+ os << "[delim " << convertDelimToLatexName(left_) << ' '
+ << convertDelimToLatexName(right_) << ' ' << cell(0) << ']';
+}
+
+
+int MathDelimInset::dw() const
+{
+ int w = height() / 5;
+ if (w > 8)
+ w = 8;
+ if (w < 4)
+ w = 4;
+ return w;
+}
+
+
+void MathDelimInset::metrics(MetricsInfo & mi) const
+{
+ cell(0).metrics(mi);
+ Dimension t;
+ mathed_char_dim(mi.base.font, 'I', t);
+ int h0 = (t.asc + t.des) / 2;
+ int a0 = max(cell(0).ascent(), t.asc) - h0;
+ int d0 = max(cell(0).descent(), t.des) + h0;
+ dim_.asc = max(a0, d0) + h0;
+ dim_.des = max(a0, d0) - h0;
+ dim_.wid = cell(0).width() + 2 * dw() + 8;
+}
+
+
+void MathDelimInset::draw(PainterInfo & pi, int x, int y) const