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 0000000000..c57ea6d2c5 Binary files /dev/null and b/lib/images/math/adots.png differ diff --git a/lib/images/math/ddddot.png b/lib/images/math/ddddot.png new file mode 100644 index 0000000000..2891fa5b3c Binary files /dev/null and b/lib/images/math/ddddot.png differ diff --git a/lib/images/math/dddot.png b/lib/images/math/dddot.png new file mode 100644 index 0000000000..07c0e2fd4f Binary files /dev/null and b/lib/images/math/dddot.png differ diff --git a/lib/images/math/iddots.png b/lib/images/math/iddots.png new file mode 100644 index 0000000000..c57ea6d2c5 Binary files /dev/null and b/lib/images/math/iddots.png differ diff --git a/lib/symbols b/lib/symbols index 1f01da4eaf..52ce3f6929 100644 --- a/lib/symbols +++ b/lib/symbols @@ -7,7 +7,8 @@ acute decoration none bar decoration none breve decoration none check decoration none -dddot decoration none +ddddot decoration none amsmath +dddot decoration none amsmath ddot decoration none dot decoration none grave decoration none @@ -15,22 +16,26 @@ hat decoration none mathring decoration none overbrace decoration none overleftarrow decoration none -overleftrightarrow decoration none +overleftrightarrow decoration none amsmath overline decoration none overrightarrow decoration none tilde decoration none underbar decoration none underbrace decoration none -underleftarrow decoration none -underleftrightarrow decoration none +underleftarrow decoration none amsmath +underleftrightarrow decoration none amsmath underline decoration none -underrightarrow decoration none +underrightarrow decoration none amsmath vec decoration none widehat decoration none widetilde decoration none # dots dots dots none +#Do not load automatically, it redefines some other symbols, and we don't +#have a possibility to turn automatic loading off like for ams +#adots dots none yhmath +adots dots none cdots dots none ddots dots none dotsb dots none amsmath @@ -38,6 +43,10 @@ dotsc dots none amsmath dotsi dots none amsmath dotsm dots none amsmath dotso dots none amsmath +#Do not load automatically, since we don't have a possibility to turn +#automatic loading off like for ams +#iddots dots none mathdots +iddots dots none ldots dots none vdots dots none @@ -872,6 +881,7 @@ Pr lyxblacktext 0 0 funclim x gcd lyxblacktext 0 0 funclim x deg lyxblacktext 0 0 func x bmod lyxblacktext 0 0 func x +pmod lyxblacktext 0 0 func x diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc index 8524c82e18..9e9000a01a 100644 --- a/lib/ui/stdtoolbars.inc +++ b/lib/ui/stdtoolbars.inc @@ -360,6 +360,8 @@ ToolbarSet Item "cdots" "math-insert \cdots" Item "vdots" "math-insert \vdots" Item "ddots" "math-insert \ddots" +# Do not show it as long as it does not load mathdots automatically +# Item "iddots" "math-insert \iddots" End Toolbar "latex_deco" "Frame Decorations" @@ -374,6 +376,8 @@ ToolbarSet Item "vec" "math-insert \vec" Item "acute" "math-insert \acute" Item "ddot" "math-insert \ddot" + Item "dddot" "math-insert \dddot" + Item "ddddot" "math-insert \ddddot" Item "breve" "math-insert \breve" Item "overline" "math-insert \overline" Item "overbrace" "math-insert \overbrace" diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 862c324061..77b20a65ab 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -649,6 +649,14 @@ string const LaTeXFeatures::getPackages() const if (mustProvide("accents")) packages << "\\usepackage{accents}\n"; + // mathdots must be loaded after amsmath + if (mustProvide("mathdots")) + packages << "\\usepackage{mathdots}\n"; + + // yhmath must be loaded after amsmath + if (mustProvide("yhmath")) + packages << "\\usepackage{yhmath}\n"; + // [x]color and pdfcolmk are handled in getColorOptions() above // makeidx.sty diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index 484a33bb2e..026b3da672 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -94,16 +94,6 @@ bool InsetMathDecoration::wide() const } -bool InsetMathDecoration::ams() const -{ - return - key_->name == "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 },