From 9c662bf442d53d079e170e89718e6adb9a15001e Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 18 Jun 2009 20:04:27 +0000 Subject: [PATCH] - fix requirements of \dddot - add support for \ddddot - add partial support for inverse diagonal dots (i. e. they are recognized and displayed correctly, but the needed package is not loaded, because it would need an off/auto/on setting as amsmath, and that calls for a general solution) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30162 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/scons/scons_manifest.py | 4 ++++ lib/Makefile.am | 4 ++++ lib/autocorrect | 1 + lib/chkconfig.ltx | 1 + lib/images/math/adots.png | Bin 0 -> 160 bytes lib/images/math/ddddot.png | Bin 0 -> 174 bytes lib/images/math/dddot.png | Bin 0 -> 174 bytes lib/images/math/iddots.png | Bin 0 -> 160 bytes lib/symbols | 20 +++++++++++++++----- lib/ui/stdtoolbars.inc | 4 ++++ src/LaTeXFeatures.cpp | 8 ++++++++ src/mathed/InsetMathDecoration.cpp | 14 ++------------ src/mathed/InsetMathDecoration.h | 2 -- src/mathed/InsetMathDots.cpp | 12 ++++++++---- src/mathed/MathSupport.cpp | 13 ++++++++++++- 15 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 lib/images/math/adots.png create mode 100644 lib/images/math/ddddot.png create mode 100644 lib/images/math/dddot.png create mode 100644 lib/images/math/iddots.png diff --git a/development/scons/scons_manifest.py b/development/scons/scons_manifest.py index e83a59ae94..d59bd0ac3c 100644 --- a/development/scons/scons_manifest.py +++ b/development/scons/scons_manifest.py @@ -1542,6 +1542,7 @@ lib_images_math_files = Split(''' Rsh.png Vvdash.png acute.png + adots.png aleph.png alpha.png amalg.png @@ -1624,6 +1625,8 @@ lib_images_math_files = Split(''' dashrightarrow.png dashv.png ddagger.png + ddddot.png + dddot.png ddot.png ddots.png delim.png @@ -1698,6 +1701,7 @@ lib_images_math_files = Split(''' hookrightarrow.png hphantom.png hslash.png + iddots.png iiiint.png iiiintop.png iiint.png diff --git a/lib/Makefile.am b/lib/Makefile.am index 17dd67a248..fd594f3161 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -450,6 +450,7 @@ dist_imagesmath_DATA = \ images/math/Rsh.png \ images/math/Vvdash.png \ images/math/acute.png \ + images/math/adots.png \ images/math/aleph.png \ images/math/alpha.png \ images/math/amalg.png \ @@ -532,6 +533,8 @@ dist_imagesmath_DATA = \ images/math/dashrightarrow.png \ images/math/dashv.png \ images/math/ddagger.png \ + images/math/ddddot.png \ + images/math/dddot.png \ images/math/ddot.png \ images/math/ddots.png \ images/math/delta.png \ @@ -603,6 +606,7 @@ dist_imagesmath_DATA = \ images/math/hookrightarrow.png \ images/math/hphantom.png \ images/math/hslash.png \ + images/math/iddots.png \ images/math/iiiint.png \ images/math/iiiintop.png \ images/math/iiint.png \ diff --git a/lib/autocorrect b/lib/autocorrect index 787e9f721b..9eddc03f8b 100644 --- a/lib/autocorrect +++ b/lib/autocorrect @@ -216,6 +216,7 @@ \cdots * \hdots \hdots * \vdots \ddots * \ddots +\iddots * \iddots \udots * \udots : = \assign + = \plusassign diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index b59998229a..002b0ccd29 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -256,6 +256,7 @@ \TestPackage{latex8} \TestPackage{listings} \TestPackage{longtable} +\TestPackage{mathdots} \TestPackage{natbib} \TestPackage{nicefrac} \TestPackage{nomencl} diff --git a/lib/images/math/adots.png b/lib/images/math/adots.png new file mode 100644 index 0000000000000000000000000000000000000000..c57ea6d2c517de3ab0371715df0799c01e061342 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^d_XMB!3HE3FxX51QjEnx?oJHr&dIz4a@dl*-CY>| zgW!U_%O?XxI14-?iy0WWg+Z8+Vb&Z8pdfpRr>`sf4K5)LBkK!=@wGAr_~T x6C_w)Jg^rrHsCe>pTO*M_>BGGBmK@m1x(p&jISo}E(0<>&kwURfx@0Z)3g73!spmr;B5V#p&dP z1yxLum(eyv%(wB0@wO9Ig6<>&kwURgjBE{CA-E1)z|gr;B5V#p&dP z1;Ri4*GVWdy7s7a1>SFU7XG6?dD(vM%%yc#S{Lid#OcY%R7x^Pg(y5ZbAF#JP$z?@ LtDnm{r-UW|#rH2} literal 0 HcmV?d00001 diff --git a/lib/images/math/iddots.png b/lib/images/math/iddots.png new file mode 100644 index 0000000000000000000000000000000000000000..c57ea6d2c517de3ab0371715df0799c01e061342 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^d_XMB!3HE3FxX51QjEnx?oJHr&dIz4a@dl*-CY>| zgW!U_%O?XxI14-?iy0WWg+Z8+Vb&Z8pdfpRr>`sf4K5)LBkK!=@wGAr_~T x6C_w)Jg^rrHsCe>pTO*M_>BGGBmK@m1x(p&jISo}E(0name == "overleftrightarrow" || - key_->name == "underleftarrow" || - key_->name == "underrightarrow" || - key_->name == "underleftrightarrow"; -} - - void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); @@ -160,8 +150,8 @@ void InsetMathDecoration::infoize(odocstream & os) const void InsetMathDecoration::validate(LaTeXFeatures & features) const { - if (ams()) - features.require("amsmath"); + if (!key_->requires.empty()) + features.require(to_utf8(key_->requires)); InsetMathNest::validate(features); } diff --git a/src/mathed/InsetMathDecoration.h b/src/mathed/InsetMathDecoration.h index c317e50e49..1e09860d8b 100644 --- a/src/mathed/InsetMathDecoration.h +++ b/src/mathed/InsetMathDecoration.h @@ -48,8 +48,6 @@ private: bool protect() const; /// is it a wide decoration? bool wide() const; - /// does this need AMS - bool ams() const; /// latexkeys const * key_; diff --git a/src/mathed/InsetMathDots.cpp b/src/mathed/InsetMathDots.cpp index 8052f1a820..c9233927c3 100644 --- a/src/mathed/InsetMathDots.cpp +++ b/src/mathed/InsetMathDots.cpp @@ -48,7 +48,7 @@ void InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const dim.wid = (dim.wid / 2) + 1; dh_ = dim.asc; } - else if (key_->name == "ddots") + else if (key_->name == "ddots" || key_->name == "adots" || key_->name == "iddots") dh_ = dim.asc; } @@ -56,11 +56,15 @@ void InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const void InsetMathDots::draw(PainterInfo & pain, int x, int y) const { Dimension const dim = dimension(*pain.base.bv); + if (key_->name == "adots" || key_->name == "iddots") + --y; mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(), - key_->name); - if (key_->name == "vdots" || key_->name == "ddots") + key_->name); + if (key_->name == "vdots" || key_->name == "ddots" || key_->name == "adots" || key_->name == "iddots") ++x; - if (key_->name != "vdots") + if (key_->name == "adots" || key_->name == "iddots") + ++y; + else if (key_->name != "vdots") --y; mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(), key_->name); diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index 5b08f70bd4..166eb327f4 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -26,7 +26,6 @@ #include "support/docstream.h" #include -#include using namespace std; @@ -202,6 +201,15 @@ double const dddot[] = { }; +double const ddddot[] = { + 1, 0.0, 0.5, 0.1, 0.5, + 1, 0.3, 0.5, 0.4, 0.5, + 1, 0.6, 0.5, 0.7, 0.5, + 1, 0.9, 0.5, 1.0, 0.5, + 0 +}; + + double const hline3[] = { 1, 0.1, 0, 0.15, 0, 1, 0.475, 0, 0.525, 0, @@ -313,6 +321,7 @@ named_deco_struct deco_table[] = { // Accents {"ddot", ddot, 0 }, {"dddot", dddot, 0 }, + {"ddddot", ddddot, 0 }, {"hat", angle, 3 }, {"grave", slash, 1 }, {"acute", slash, 0 }, @@ -330,6 +339,8 @@ named_deco_struct deco_table[] = { {"cdots", hline3, 0 }, {"vdots", hline3, 1 }, {"ddots", dline3, 0 }, + {"adots", dline3, 1 }, + {"iddots", dline3, 1 }, {"dotsb", hline3, 0 }, {"dotsc", hline3, 0 }, {"dotsi", hline3, 0 },