*** empty log message ***

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3033 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-11-15 15:14:27 +00:00
parent 4de117b23f
commit 0e793113ca
5 changed files with 64 additions and 25 deletions

View File

@ -1,3 +1,8 @@
2001-11-07 André Pönitz <poenitz@gmx.net>
* math_extern.C: support for integrals, sums, e^x, and d/dx
2001-11-15 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* math_extern.C (extractNumber):

View File

@ -505,6 +505,7 @@ InsetFormula::localDispatch(BufferView * bv, kb_action action,
bool needEqnArray(string const & extra)
{
return false;
return extra == "dsolve";
}

View File

@ -293,6 +293,38 @@ void splitScripts(MathArray & ar)
}
//
// extract exp(...)
//
void extractExps(MathArray & ar)
{
lyxerr << "\nExps from: " << ar << "\n";
for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
MathArray::iterator it = ar.begin() + i;
// is this 'e'?
MathCharInset const * p = (*it)->asCharInset();
if (!p || p->getChar() != 'e')
continue;
// we need an exponent but no subscript
MathScriptInset * sup = (*(it + 1))->asScriptInset();
if (!sup || sup->hasDown())
continue;
// create a proper exp-inset as replacement
MathExFuncInset * func = new MathExFuncInset("exp");
func->cell(0) = sup->cell(1);
// clean up
(*it).reset(func);
ar.erase(it + 1);
}
lyxerr << "\nExps to: " << ar << "\n";
}
//
// search deliminiters
@ -669,6 +701,7 @@ void extractStructure(MathArray & ar)
extractIntegrals(ar);
extractSums(ar);
extractDiff(ar);
extractExps(ar);
extractStrings(ar);
}

View File

@ -36,18 +36,6 @@ void MathFuncInset::setName(string const & n)
}
void MathFuncInset::write(WriteStream & os) const
{
os << "\\" << name_.c_str() << ' ';
}
void MathFuncInset::normalize(NormalStream & os) const
{
os << "[func " << name_.c_str() << ']';
}
void MathFuncInset::metrics(MathMetricsInfo const & mi) const
{
mi_ = mi;
@ -63,7 +51,7 @@ void MathFuncInset::draw(Painter & pain, int x, int y) const
void MathFuncInset::maplize(MapleStream & os) const
{
os << name_.c_str();
os << ' ' << name_.c_str();
}
@ -75,5 +63,17 @@ void MathFuncInset::mathmlize(MathMLStream & os) const
void MathFuncInset::octavize(OctaveStream & os) const
{
os << name_.c_str();
os << ' ' << name_.c_str();
}
void MathFuncInset::normalize(NormalStream & os) const
{
os << "[func " << name_.c_str() << ']';
}
void MathFuncInset::write(WriteStream & os) const
{
os << "\\" << name_.c_str() << ' ';
}

View File

@ -59,15 +59,6 @@ void MathStringInset::draw(Painter & pain, int x, int y) const
}
void MathStringInset::write(WriteStream & os) const
{
if (math_font_name(code_))
os << '\\' << math_font_name(code_) << '{' << str_.c_str() << '}';
else
os << str_.c_str();
}
void MathStringInset::normalize(NormalStream & os) const
{
os << "[string " << str_.c_str() << ' ' << "mathalpha" << "]";
@ -77,7 +68,7 @@ void MathStringInset::normalize(NormalStream & os) const
void MathStringInset::maplize(MapleStream & os) const
{
if (code_ != LM_TC_VAR || str_.size() <= 1) {
os << str_.c_str();
os << ' ' << str_.c_str() << ' ';
return;
}
@ -91,7 +82,7 @@ void MathStringInset::maplize(MapleStream & os) const
void MathStringInset::octavize(OctaveStream & os) const
{
if (code_ != LM_TC_VAR || str_.size() <= 1) {
os << str_.c_str();
os << ' ' << str_.c_str() << ' ';
return;
}
@ -113,3 +104,12 @@ void MathStringInset::mathmlize(MathMLStream & os) const
else
os << str_.c_str();
}
void MathStringInset::write(WriteStream & os) const
{
if (math_font_name(code_))
os << '\\' << math_font_name(code_) << '{' << str_.c_str() << '}';
else
os << str_.c_str();
}