3 #include "math_exfuncinset.h"
4 #include "math_support.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
9 MathExFuncInset::MathExFuncInset(string const & name)
10 : MathNestInset(1), name_(name)
14 MathExFuncInset::MathExFuncInset(string const & name, MathArray const & ar)
15 : MathNestInset(1), name_(name)
21 InsetBase * MathExFuncInset::clone() const
23 return new MathExFuncInset(*this);
27 void MathExFuncInset::metrics(MetricsInfo & mi, Dimension & /*dim*/) const
29 mathed_string_dim(mi.base.font, name_, dim_);
33 void MathExFuncInset::draw(PainterInfo & pi, int x, int y) const
35 drawStrBlack(pi, x, y, name_);
39 string MathExFuncInset::name() const
45 void MathExFuncInset::maple(MapleStream & os) const
48 os << "linalg[det](" << cell(0) << ')';
50 os << name_ << '(' << cell(0) << ')';
54 void MathExFuncInset::maxima(MaximaStream & os) const
57 os << "determinant(" << cell(0) << ')';
59 os << name_ << '(' << cell(0) << ')';
63 string asMathematicaName(string const & name)
65 if (name == "sin") return "Sin";
66 if (name == "sinh") return "Sinh";
67 if (name == "arcsin") return "ArcSin";
68 if (name == "cos") return "Cos";
69 if (name == "cosh") return "Cosh";
70 if (name == "arcos") return "ArcCos";
71 if (name == "tan") return "Tan";
72 if (name == "tanh") return "Tanh";
73 if (name == "arctan") return "ArcTan";
74 if (name == "cot") return "Cot";
75 if (name == "coth") return "Coth";
76 if (name == "csc") return "Csc";
77 if (name == "sec") return "Sec";
78 if (name == "exp") return "Exp";
79 if (name == "log") return "Log";
80 if (name == "ln" ) return "Log";
85 void MathExFuncInset::mathematica(MathematicaStream & os) const
87 os << asMathematicaName(name_) << '[' << cell(0) << ']';
91 void MathExFuncInset::mathmlize(MathMLStream & os) const
93 os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
97 void MathExFuncInset::octave(OctaveStream & os) const
99 os << name_ << '(' << cell(0) << ')';