4 #include "math_exfuncinset.h"
5 #include "math_support.h"
6 #include "math_mathmlstream.h"
7 #include "math_streamstr.h"
10 MathExFuncInset::MathExFuncInset(string const & name)
11 : MathNestInset(1), name_(name)
15 MathExFuncInset::MathExFuncInset(string const & name, MathArray const & ar)
16 : MathNestInset(1), name_(name)
22 MathInset * MathExFuncInset::clone() const
24 return new MathExFuncInset(*this);
28 void MathExFuncInset::metrics(MetricsInfo & mi, Dimension & dim) const
30 mathed_string_dim(mi.base.font, name_, dim_);
34 void MathExFuncInset::draw(PainterInfo & pi, int x, int y) const
36 drawStrBlack(pi, x, y, name_);
40 string MathExFuncInset::name() const
46 void MathExFuncInset::maple(MapleStream & os) const
49 os << "linalg[det](" << cell(0) << ')';
51 os << name_ << '(' << cell(0) << ')';
55 void MathExFuncInset::maxima(MaximaStream & os) const
58 os << "determinant(" << cell(0) << ')';
60 os << name_ << '(' << cell(0) << ')';
64 string asMathematicaName(string const & name)
66 if (name == "sin") return "Sin";
67 if (name == "sinh") return "Sinh";
68 if (name == "arcsin") return "ArcSin";
69 if (name == "cos") return "Cos";
70 if (name == "cosh") return "Cosh";
71 if (name == "arcos") return "ArcCos";
72 if (name == "tan") return "Tan";
73 if (name == "tanh") return "Tanh";
74 if (name == "arctan") return "ArcTan";
75 if (name == "cot") return "Cot";
76 if (name == "coth") return "Coth";
77 if (name == "csc") return "Csc";
78 if (name == "sec") return "Sec";
79 if (name == "exp") return "Exp";
80 if (name == "log") return "Log";
81 if (name == "ln" ) return "Log";
86 void MathExFuncInset::mathematica(MathematicaStream & os) const
88 os << asMathematicaName(name_) << '[' << cell(0) << ']';
92 void MathExFuncInset::mathmlize(MathMLStream & os) const
94 os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
98 void MathExFuncInset::octave(OctaveStream & os) const
100 os << name_ << '(' << cell(0) << ')';