]> git.lyx.org Git - features.git/commitdiff
Fix bug 4668
authorEnrico Forestieri <forenr@lyx.org>
Tue, 1 Apr 2008 02:29:41 +0000 (02:29 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 1 Apr 2008 02:29:41 +0000 (02:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24080 a592a061-630c-0410-9148-cb99ea01b6c8

lib/doc/LaTeXConfig.lyx
src/LaTeXFeatures.cpp
src/mathed/InsetMathBoldSymbol.cpp
src/mathed/InsetMathBoldSymbol.h
src/mathed/MathFactory.cpp

index 08e752c3a566d43f100fc5753ef13879fcd854d4..0ee0abf0010fea315407342ece0305aa74fdb871 100644 (file)
@@ -3293,13 +3293,7 @@ bm
 \backslash
 bm
 \family default
- (aliased to 
-\family typewriter
-
-\backslash
-boldsymbol
-\family default
-) which makes its argument bold.
+ which makes its argument bold.
  The argument may be any math object from a single symbol to an expression.
  If available, ultra bold fonts can be accesed through the 
 \family typewriter
@@ -3318,17 +3312,31 @@ heavysymbol
 \family typewriter
 
 \backslash
-boldsymbol
+bm
 \family default
  command is similar to the 
 \family sans
-amsmath
+amsmath 
+\family typewriter
+
+\backslash
+boldsymbol
 \family default
- command with same name, but the 
+ command, but the 
 \family sans
 bm
 \family default
  version is rather more careful in the way it does things.
+ Be aware that this package allocates symbol fonts for bold fonts into the
+ normal math version, such that, when using other packages that allocate
+ many symbol fonts, they can be exhausted.
+ In this case, one can make do with the 
+\family typewriter
+
+\backslash
+boldsymbol
+\family default
+ command.
 \end_layout
 
 \begin_layout Subsection
index 46caa8671ce579a5da621efcd569700a383d8813..641e99eb7db1576a4154f769a1a8f7865ad90b03 100644 (file)
@@ -449,7 +449,8 @@ char const * simplefeatures[] = {
        "endnotes",
        "ifthen",
        "amsthm",
-       "listings"
+       "listings",
+       "bm"
 };
 
 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
@@ -489,6 +490,9 @@ string const LaTeXFeatures::getPackages() const
            (mustProvide("esintoramsmath") &&
             params_.use_esint == BufferParams::package_off)) {
                packages << "\\usepackage{amsmath}\n";
+       } else if (mustProvide("amsbsy")) {
+               // amsbsy is already provided by amsmath
+               packages << "\\usepackage{amsbsy}\n";
        }
        
        // wasysym is a simple feature, but it must be after amsmath if both
@@ -606,12 +610,6 @@ string const LaTeXFeatures::getPackages() const
                            "\\makenomenclature\n";
        }
 
-       // bm -- this package interrogates the font allocations to determine
-       // which bold fonts are available, so it is best loaded as the last one,
-       // and, in any case, after amsmath.
-       if (mustProvide("bm"))
-               packages << "\\usepackage{bm}\n";
-
        return packages.str();
 }
 
index 7a7e5ece76c4568fa1507353189f7c84baa7ba8b..f5bb350a01df4d788336f94824462f4d886d1479 100644 (file)
@@ -67,18 +67,24 @@ void InsetMathBoldSymbol::drawT(TextPainter & pain, int x, int y) const
 void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
 {
        InsetMathNest::validate(features);
-       features.require("bm");
+       if (kind_ == AMS_BOLD)
+               features.require("amsbsy");
+       else
+               features.require("bm");
 }
 
 
 void InsetMathBoldSymbol::write(WriteStream & os) const
 {
        switch (kind_) {
-       case BOLD:
+       case AMS_BOLD:
                os << "\\boldsymbol{" << cell(0) << "}";
                break;
-       case HEAVY:
-               os << "\\heavysymbol{" << cell(0) << "}";
+       case BM_BOLD:
+               os << "\\bm{" << cell(0) << "}";
+               break;
+       case BM_HEAVY:
+               os << "\\hm{" << cell(0) << "}";
                break;
        }
 }
@@ -87,11 +93,14 @@ void InsetMathBoldSymbol::write(WriteStream & os) const
 void InsetMathBoldSymbol::infoize(odocstream & os) const
 {
        switch (kind_) {
-       case BOLD:
+       case AMS_BOLD:
                os << "Boldsymbol ";
                break;
-       case HEAVY:
-               os << "Heavysymbol ";
+       case BM_BOLD:
+               os << "Boldsymbol (bm)";
+               break;
+       case BM_HEAVY:
+               os << "Heavysymbol (bm)";
                break;
        }
 }
index 0a998b149e7edfffd3b9192813d9ba0e64bb3c81..e0ba049d14c54161449032379c24637cc6ae822d 100644 (file)
@@ -22,11 +22,12 @@ namespace lyx {
 class InsetMathBoldSymbol : public InsetMathNest {
 public:
        enum Kind {
-               BOLD,
-               HEAVY
+               AMS_BOLD,
+               BM_BOLD,
+               BM_HEAVY
        };
        ///
-       InsetMathBoldSymbol(Kind kind = BOLD);
+       InsetMathBoldSymbol(Kind kind = AMS_BOLD);
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 7c9debba72bf47aa3d48b193373324f193dda3cf..284faadaaf8f54b279bd4e3a045172c030520350 100644 (file)
@@ -381,10 +381,12 @@ MathAtom createInsetMath(docstring const & s)
                return MathAtom(new InsetMathFrac(InsetMathFrac::ATOP));
        if (s == "lefteqn")
                return MathAtom(new InsetMathLefteqn);
-       if (s == "boldsymbol" || s == "bm")
-               return MathAtom(new InsetMathBoldSymbol(InsetMathBoldSymbol::BOLD));
+       if (s == "boldsymbol")
+               return MathAtom(new InsetMathBoldSymbol(InsetMathBoldSymbol::AMS_BOLD));
+       if (s == "bm")
+               return MathAtom(new InsetMathBoldSymbol(InsetMathBoldSymbol::BM_BOLD));
        if (s == "heavysymbol" || s == "hm")
-               return MathAtom(new InsetMathBoldSymbol(InsetMathBoldSymbol::HEAVY));
+               return MathAtom(new InsetMathBoldSymbol(InsetMathBoldSymbol::BM_HEAVY));
        if (s == "color" || s == "normalcolor")
                return MathAtom(new InsetMathColor(true));
        if (s == "textcolor")