mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
support for \textcolor
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7993 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
12a2f2705f
commit
09548338ce
@ -23,8 +23,8 @@
|
||||
using std::auto_ptr;
|
||||
|
||||
|
||||
MathColorInset::MathColorInset()
|
||||
: MathNestInset(2)
|
||||
MathColorInset::MathColorInset(bool oldstyle)
|
||||
: MathNestInset(2), oldstyle_(oldstyle)
|
||||
{}
|
||||
|
||||
|
||||
@ -80,7 +80,10 @@ void MathColorInset::validate(LaTeXFeatures & features) const
|
||||
|
||||
void MathColorInset::write(WriteStream & os) const
|
||||
{
|
||||
os << "{\\color" << '{' << cell(0) << '}' << cell(1) << '}';
|
||||
if (oldstyle_)
|
||||
os << "{\\color" << '{' << cell(0) << '}' << cell(1) << '}';
|
||||
else
|
||||
os << "\\textcolor" << '{' << cell(0) << "}{" << cell(1) << '}';
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
class MathColorInset : public MathNestInset {
|
||||
public:
|
||||
///
|
||||
MathColorInset();
|
||||
explicit MathColorInset(bool oldstyle);
|
||||
///
|
||||
std::auto_ptr<InsetBase> clone() const;
|
||||
///
|
||||
@ -39,6 +39,8 @@ public:
|
||||
private:
|
||||
/// width of '[' in current font
|
||||
mutable int w_;
|
||||
///
|
||||
bool oldstyle_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -311,7 +311,9 @@ MathAtom createMathInset(string const & s)
|
||||
if (s == "boldsymbol")
|
||||
return MathAtom(new MathBoldsymbolInset);
|
||||
if (s == "color")
|
||||
return MathAtom(new MathColorInset);
|
||||
return MathAtom(new MathColorInset(true));
|
||||
if (s == "textcolor")
|
||||
return MathAtom(new MathColorInset(false));
|
||||
if (s == "dfrac")
|
||||
return MathAtom(new MathDfracInset);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user