mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
Fix conversion of n-th roots to mathematica and octave syntax.
* src/mathed/math_extern.C (pipeThroughOctave): take into account that the output from octave may contain ansi control sequences. * src/mathed/math_rootinset.[Ch] (MathRootInset::mathematica): new virtual method to output n-th roots in mathematica syntax. * src/mathed/math_rootinset.C (MathRootInset::octave): octave has not a root command. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@16612 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d2b8a31616
commit
7de882829b
@ -1,3 +1,13 @@
|
|||||||
|
2007-01-08 Enrico Forestieri <forenr@tlc.unipr.it>
|
||||||
|
|
||||||
|
* src/mathed/math_extern.C (pipeThroughOctave): take into account
|
||||||
|
that the output from octave may contain ansi control sequences.
|
||||||
|
|
||||||
|
* src/mathed/math_rootinset.[Ch] (mathematica): new virtual method
|
||||||
|
to output n-th roots in mathematica syntax.
|
||||||
|
|
||||||
|
* src/mathed/math_rootinset.C (octave): octave has not a root command.
|
||||||
|
|
||||||
2006-12-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
2006-12-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
* math_nestinset.C (handleFont): avoid crash on undo when
|
* math_nestinset.C (handleFont): avoid crash on undo when
|
||||||
|
@ -1273,11 +1273,12 @@ namespace {
|
|||||||
expr.insert(pos, 1, '*');
|
expr.insert(pos, 1, '*');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (out.size() < 6)
|
// remove 'ans = ' taking into account that there may be an
|
||||||
|
// ansi control sequence before, such as '\033[?1034hans = '
|
||||||
|
size_t i = out.find("ans = ");
|
||||||
|
if (i == string::npos)
|
||||||
return MathArray();
|
return MathArray();
|
||||||
|
out = out.substr(i + 6);
|
||||||
// remove 'ans = '
|
|
||||||
out = out.substr(6);
|
|
||||||
|
|
||||||
// parse output as matrix or single number
|
// parse output as matrix or single number
|
||||||
MathAtom at(new MathArrayInset("array", out));
|
MathAtom at(new MathArrayInset("array", out));
|
||||||
|
@ -97,9 +97,15 @@ void MathRootInset::maple(MapleStream & os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MathRootInset::mathematica(MathematicaStream & os) const
|
||||||
|
{
|
||||||
|
os << '(' << cell(1) << ")^(1/(" << cell(0) <<"))";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathRootInset::octave(OctaveStream & os) const
|
void MathRootInset::octave(OctaveStream & os) const
|
||||||
{
|
{
|
||||||
os << "root(" << cell(1) << ',' << cell(0) << ')';
|
os << '(' << cell(1) << ")^(1/(" << cell(0) <<"))";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ public:
|
|||||||
///
|
///
|
||||||
void maple(MapleStream &) const;
|
void maple(MapleStream &) const;
|
||||||
///
|
///
|
||||||
|
void mathematica(MathematicaStream &) const;
|
||||||
|
///
|
||||||
void octave(OctaveStream &) const;
|
void octave(OctaveStream &) const;
|
||||||
private:
|
private:
|
||||||
virtual std::auto_ptr<InsetBase> doClone() const;
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user