support for \xrightarrow and \xleftarrow

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3483 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-02-05 09:51:40 +00:00
parent b5fd9ac98d
commit 961105ec0e
6 changed files with 14 additions and 87 deletions

View File

@ -1,3 +1,6 @@
2002-02-01 André Pönitz <poenitz@gmx.net>
* math_xarrowinset.[Ch]: support for \xrightarrow and \xleftarrow
2002-02-01 André Pönitz <poenitz@gmx.net> 2002-02-01 André Pönitz <poenitz@gmx.net>

View File

@ -127,7 +127,9 @@ libmathed_la_SOURCES = \
math_unknowninset.h \ math_unknowninset.h \
math_undersetinset.C \ math_undersetinset.C \
math_undersetinset.h \ math_undersetinset.h \
math_xarrowinset.C \
math_xarrowinset.h \
math_xdata.C \ math_xdata.C \
math_xdata.h \ math_xdata.h \
math_xymatrix.C \ math_xymatrixinset.C \
math_xymatrix.h math_xymatrixinset.h

View File

@ -23,7 +23,8 @@
#include "math_symbolinset.h" #include "math_symbolinset.h"
#include "math_undersetinset.h" #include "math_undersetinset.h"
#include "math_unknowninset.h" #include "math_unknowninset.h"
#include "math_xymatrix.h" #include "math_xarrowinset.h"
#include "math_xymatrixinset.h"
MathAtom createMathInset(latexkeys const * l) MathAtom createMathInset(latexkeys const * l)
@ -94,6 +95,9 @@ MathAtom createMathInset(string const & s)
if (s == "xymatrix") if (s == "xymatrix")
return MathAtom(new MathXYMatrixInset); return MathAtom(new MathXYMatrixInset);
if (s == "xrightarrow")
return MathAtom(new MathXArrowInset(s));
latexkeys const * l = in_word_set(s); latexkeys const * l = in_word_set(s);
if (l) if (l)
return createMathInset(l); return createMathInset(l);

View File

@ -463,6 +463,8 @@ named_deco_struct deco_table[] = {
{"overbrace", brace, 3 }, {"overbrace", brace, 3 },
{"overleftarrow", arrow, 1 }, {"overleftarrow", arrow, 1 },
{"overrightarrow", arrow, 3 }, {"overrightarrow", arrow, 3 },
{"xleftarrow", arrow, 1 },
{"xrightarrow", arrow, 3 },
// Delimiters // Delimiters
{"(", parenth, 0 }, {"(", parenth, 0 },

View File

@ -1,53 +0,0 @@
#include <config.h>
#ifdef __GNUG__
#pragma implementation
#endif
#include "math_xymatrix.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
MathXYMatrixInset::MathXYMatrixInset()
: MathGridInset(1, 1)
{}
MathInset * MathXYMatrixInset::clone() const
{
return new MathXYMatrixInset(*this);
}
void MathXYMatrixInset::metrics(MathMetricsInfo const & st) const
{
MathMetricsInfo mi = st;
if (mi.style == LM_ST_DISPLAY)
mi.style = LM_ST_TEXT;
MathGridInset::metrics(mi);
}
void MathXYMatrixInset::write(WriteStream & os) const
{
os << "\\xymatrix{";
MathGridInset::write(os);
os << "}\n";
}
void MathXYMatrixInset::normalize(NormalStream & os) const
{
os << "[xymatrix ";
MathGridInset::normalize(os);
os << "]";
}
void MathXYMatrixInset::maplize(MapleStream & os) const
{
os << "xymatrix(";
MathGridInset::maplize(os);
os << ")";
}

View File

@ -1,31 +0,0 @@
// -*- C++ -*-
#ifndef MATH_XYMATRIX_H
#define MATH_XYMATRIX_H
#include "math_gridinset.h"
#ifdef __GNUG__
#pragma interface
#endif
class MathXYMatrixInset : public MathGridInset {
public:
///
MathXYMatrixInset();
///
MathInset * clone() const;
///
void metrics(MathMetricsInfo const & st) const;
///
MathXYMatrixInset * asXYMatrixInset() { return this; }
///
void write(WriteStream & os) const;
///
void normalize(NormalStream &) const;
///
void maplize(MapleStream &) const;
};
#endif