Happy Easter everybody! Am Freitag, 25. M�rz 2005 08:53 schrieb Martin Vermeer: > Does anyone know what the status of these AMS array structures is? They > are things like bmatrix, pmatrix etc. etc. I couldn't get any of these > to work.
They do work. See the attached file which has one instance of every grid like structure I know of. I do use bmatrix a lot also in 1.3. I have added hlines and vlines to every environment that supports them. > Is there supposed to be a working UI to these? I don't know any other than typing the environment name in a math box: \bmatrix <space> gives a 1x1 bmatrix. I did not know that either until recently (I believe I read it in Uwes excellent math guide). Before I entered them with a text editor or copied from an existing file ;-( BTW, I discovered that MathAmsArrayInset, MathSubstackInset and MathArrayInset lack a validate method which requires amsmath. I attached a patch that fixes this. This is going in unless somebody objects. Georg
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/mathed/ChangeLog lyx-1.4-cvs/src/mathed/ChangeLog
--- lyx-1.4-clean/src/mathed/ChangeLog 2005-03-22 20:53:05.000000000 +0100
+++ lyx-1.4-cvs/src/mathed/ChangeLog 2005-03-27 17:37:36.000000000 +0200
@@ -1,3 +1,9 @@
+2005-03-27 Georg Baum <[EMAIL PROTECTED]>
+
+ * math_amsarrayinset.[Ch] (validate): new, require amsmath
+ * math_substackinset.[Ch] (validate): ditto
+ * math_arrayinset.[Ch] (validate): ditto (in the case of subarray)
+
2005-03-24 Martin Vermeer <[EMAIL PROTECTED]>
* math_hullinset.C:
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/mathed/math_amsarrayinset.C lyx-1.4-cvs/src/mathed/math_amsarrayinset.C
--- lyx-1.4-clean/src/mathed/math_amsarrayinset.C 2004-11-24 17:46:16.000000000 +0100
+++ lyx-1.4-cvs/src/mathed/math_amsarrayinset.C 2005-03-27 17:12:48.000000000 +0200
@@ -10,6 +10,7 @@
#include <config.h>
+#include "LaTeXFeatures.h"
#include "math_amsarrayinset.h"
#include "math_data.h"
#include "math_mathmlstream.h"
@@ -103,3 +104,10 @@ void MathAMSArrayInset::normalize(Normal
MathGridInset::normalize(os);
os << ']';
}
+
+
+void MathAMSArrayInset::validate(LaTeXFeatures & features) const
+{
+ features.require("amsmath");
+ MathGridInset::validate(features);
+}
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/mathed/math_amsarrayinset.h lyx-1.4-cvs/src/mathed/math_amsarrayinset.h
--- lyx-1.4-clean/src/mathed/math_amsarrayinset.h 2004-11-24 17:46:16.000000000 +0100
+++ lyx-1.4-cvs/src/mathed/math_amsarrayinset.h 2005-03-27 17:10:26.000000000 +0200
@@ -35,7 +35,8 @@ public:
void write(WriteStream & os) const;
///
void normalize(NormalStream &) const;
-
+ ///
+ void validate(LaTeXFeatures & features) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const;
///
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/mathed/math_arrayinset.C lyx-1.4-cvs/src/mathed/math_arrayinset.C
--- lyx-1.4-clean/src/mathed/math_arrayinset.C 2004-11-24 17:46:16.000000000 +0100
+++ lyx-1.4-cvs/src/mathed/math_arrayinset.C 2005-03-27 17:32:20.000000000 +0200
@@ -10,6 +10,7 @@
#include <config.h>
+#include "LaTeXFeatures.h"
#include "math_arrayinset.h"
#include "math_data.h"
#include "math_parser.h"
@@ -130,3 +131,11 @@ void MathArrayInset::maple(MapleStream &
MathGridInset::maple(os);
os << ')';
}
+
+
+void MathArrayInset::validate(LaTeXFeatures & features) const
+{
+ if (name_ == "subarray")
+ features.require("amsmath");
+ MathGridInset::validate(features);
+}
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/mathed/math_arrayinset.h lyx-1.4-cvs/src/mathed/math_arrayinset.h
--- lyx-1.4-clean/src/mathed/math_arrayinset.h 2004-11-24 17:46:16.000000000 +0100
+++ lyx-1.4-cvs/src/mathed/math_arrayinset.h 2005-03-27 17:30:06.000000000 +0200
@@ -25,7 +25,7 @@ public:
char valign, std::string const & halign);
///
MathArrayInset(std::string const &, char valign, std::string const & halign);
- /// convienience constructor from whitespace/newline seperated data
+ /// convenience constructor from whitespace/newline separated data
MathArrayInset(std::string const &, std::string const & str);
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
@@ -44,7 +44,8 @@ public:
void normalize(NormalStream & os) const;
///
void maple(MapleStream & os) const;
-
+ ///
+ void validate(LaTeXFeatures & features) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const;
///
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/mathed/math_substackinset.C lyx-1.4-cvs/src/mathed/math_substackinset.C
--- lyx-1.4-clean/src/mathed/math_substackinset.C 2004-11-24 17:46:21.000000000 +0100
+++ lyx-1.4-cvs/src/mathed/math_substackinset.C 2005-03-27 17:33:47.000000000 +0200
@@ -10,6 +10,7 @@
#include <config.h>
+#include "LaTeXFeatures.h"
#include "math_substackinset.h"
#include "math_data.h"
#include "math_mathmlstream.h"
@@ -75,3 +76,10 @@ void MathSubstackInset::maple(MapleStrea
MathGridInset::maple(os);
os << ')';
}
+
+
+void MathSubstackInset::validate(LaTeXFeatures & features) const
+{
+ features.require("amsmath");
+ MathGridInset::validate(features);
+}
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/mathed/math_substackinset.h lyx-1.4-cvs/src/mathed/math_substackinset.h
--- lyx-1.4-clean/src/mathed/math_substackinset.h 2004-11-24 17:46:21.000000000 +0100
+++ lyx-1.4-cvs/src/mathed/math_substackinset.h 2005-03-27 17:33:00.000000000 +0200
@@ -38,6 +38,8 @@ public:
void normalize(NormalStream &) const;
///
void maple(MapleStream &) const;
+ ///
+ void validate(LaTeXFeatures & features) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const;
};
math-array-test.lyx
Description: application/lyx
