2001-06-25 00:06:33 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_arrayinset.h"
|
|
|
|
#include "support/LOstream.h"
|
|
|
|
|
|
|
|
|
|
|
|
MathArrayInset::MathArrayInset(int m, int n)
|
2001-08-08 17:26:30 +00:00
|
|
|
: MathGridInset(m, n)
|
2001-06-25 00:06:33 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
2001-10-12 12:02:49 +00:00
|
|
|
MathArrayInset::MathArrayInset(int m, int n, char valign, string const & halign)
|
|
|
|
: MathGridInset(m, n, valign, halign)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
MathInset * MathArrayInset::clone() const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
|
|
|
return new MathArrayInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
void MathArrayInset::write(MathWriteInfo & os) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2001-10-19 11:25:48 +00:00
|
|
|
if (os.fragile)
|
2001-06-25 00:06:33 +00:00
|
|
|
os << "\\protect";
|
|
|
|
os << "\\begin{array}";
|
|
|
|
|
|
|
|
if (v_align_ == 't' || v_align_ == 'b')
|
|
|
|
os << '[' << char(v_align_) << ']';
|
|
|
|
|
|
|
|
os << '{';
|
2001-09-26 16:52:34 +00:00
|
|
|
for (col_type col = 0; col < ncols(); ++col)
|
2001-09-04 13:32:06 +00:00
|
|
|
os << colinfo_[col].align_;
|
2001-06-25 00:06:33 +00:00
|
|
|
os << "}\n";
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
MathGridInset::write(os);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
if (os.fragile)
|
2001-06-25 00:06:33 +00:00
|
|
|
os << "\\protect";
|
|
|
|
os << "\\end{array}\n";
|
|
|
|
}
|
2001-09-10 09:35:12 +00:00
|
|
|
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
void MathArrayInset::metrics(MathMetricsInfo const & st) const
|
2001-09-10 09:35:12 +00:00
|
|
|
{
|
2001-10-22 15:37:49 +00:00
|
|
|
MathMetricsInfo mi = st;
|
|
|
|
if (mi.style == LM_ST_DISPLAY)
|
|
|
|
mi.style = LM_ST_TEXT;
|
|
|
|
MathGridInset::metrics(mi);
|
2001-09-10 09:35:12 +00:00
|
|
|
}
|
|
|
|
|