From 961105ec0eb8ba2d7f274cfb5603dc4e0179b1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 5 Feb 2002 09:51:40 +0000 Subject: [PATCH] support for \xrightarrow and \xleftarrow git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3483 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 3 +++ src/mathed/Makefile.am | 6 +++-- src/mathed/math_factory.C | 6 ++++- src/mathed/math_support.C | 2 ++ src/mathed/math_xymatrix.C | 53 -------------------------------------- src/mathed/math_xymatrix.h | 31 ---------------------- 6 files changed, 14 insertions(+), 87 deletions(-) delete mode 100644 src/mathed/math_xymatrix.C delete mode 100644 src/mathed/math_xymatrix.h diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 2e8b7ad51d..87d2f0a23d 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,6 @@ +2002-02-01 André Pönitz + + * math_xarrowinset.[Ch]: support for \xrightarrow and \xleftarrow 2002-02-01 André Pönitz diff --git a/src/mathed/Makefile.am b/src/mathed/Makefile.am index 5a5a05fe97..4a400b3647 100644 --- a/src/mathed/Makefile.am +++ b/src/mathed/Makefile.am @@ -127,7 +127,9 @@ libmathed_la_SOURCES = \ math_unknowninset.h \ math_undersetinset.C \ math_undersetinset.h \ + math_xarrowinset.C \ + math_xarrowinset.h \ math_xdata.C \ math_xdata.h \ - math_xymatrix.C \ - math_xymatrix.h + math_xymatrixinset.C \ + math_xymatrixinset.h diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index c7a72f873d..540c86e1a0 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -23,7 +23,8 @@ #include "math_symbolinset.h" #include "math_undersetinset.h" #include "math_unknowninset.h" -#include "math_xymatrix.h" +#include "math_xarrowinset.h" +#include "math_xymatrixinset.h" MathAtom createMathInset(latexkeys const * l) @@ -94,6 +95,9 @@ MathAtom createMathInset(string const & s) if (s == "xymatrix") return MathAtom(new MathXYMatrixInset); + if (s == "xrightarrow") + return MathAtom(new MathXArrowInset(s)); + latexkeys const * l = in_word_set(s); if (l) return createMathInset(l); diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index e562200ac6..83ed49e793 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -463,6 +463,8 @@ named_deco_struct deco_table[] = { {"overbrace", brace, 3 }, {"overleftarrow", arrow, 1 }, {"overrightarrow", arrow, 3 }, + {"xleftarrow", arrow, 1 }, + {"xrightarrow", arrow, 3 }, // Delimiters {"(", parenth, 0 }, diff --git a/src/mathed/math_xymatrix.C b/src/mathed/math_xymatrix.C deleted file mode 100644 index f71a46cf17..0000000000 --- a/src/mathed/math_xymatrix.C +++ /dev/null @@ -1,53 +0,0 @@ -#include - -#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 << ")"; -} diff --git a/src/mathed/math_xymatrix.h b/src/mathed/math_xymatrix.h deleted file mode 100644 index bfebb04da2..0000000000 --- a/src/mathed/math_xymatrix.h +++ /dev/null @@ -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