InsetMathAMSArray.h
InsetMathArray.h
InsetMathBig.h
- InsetMathBM.h
InsetMathBoldSymbol.h
InsetMathBox.h
InsetMathBrace.h
InsetMathAMSArray.cpp
InsetMathArray.cpp
InsetMathBig.cpp
- InsetMathBM.cpp
InsetMathBoldSymbol.cpp
InsetMathBox.cpp
InsetMathBrace.cpp
\bind "C-Prior" "buffer-previous"
\bind "C-S-Tab" "buffer-previous"
+\bind "C-M-b" "math-insert \mathbf"
\bind "C-b" "font-bold"
\bind "C-e" "font-emph"
# used below for line-delete-forward
\bind "M-Tab" "buffer-next"
\bind "M-S-BackTab" "buffer-previous"
+\bind "C-M-b" "math-insert \mathbf"
\bind "C-b" "font-bold"
\bind "C-e" "font-emph"
\bind "C-k" "font-noun" # 'k' for capitals
" \\expandafter\\noexpand\\csname SF@gobble@opt \\endcsname}\n"
"\\def\\SF@gobble@twobracket[#1]#2{}\n";
-static string const boldsymbol_def =
- "%% Bold symbol macro for standard LaTeX users\n"
- "\\providecommand{\\boldsymbol}[1]{\\mbox{\\boldmath $#1$}}\n";
-
static string const binom_def =
"%% Binom macro for standard LaTeX users\n"
"\\newcommand{\\binom}[2]{{#1 \\choose #2}}\n";
macros << guillemotright_def << '\n';
// Math mode
- if (mustProvide("boldsymbol") && !isRequired("amsmath"))
- macros << boldsymbol_def << '\n';
if (mustProvide("binom") && !isRequired("amsmath"))
macros << binom_def << '\n';
if (mustProvide("mathcircumflex"))
mathed/InsetMathAMSArray.cpp \
mathed/InsetMathArray.cpp \
mathed/InsetMathBig.cpp \
- mathed/InsetMathBM.cpp \
mathed/InsetMathBoldSymbol.cpp \
mathed/InsetMathBox.cpp \
mathed/InsetMathBrace.cpp \
mathed/InsetMathAMSArray.h \
mathed/InsetMathArray.h \
mathed/InsetMathBig.h \
- mathed/InsetMathBM.h \
mathed/InsetMathBoldSymbol.h \
mathed/InsetMathBox.h \
mathed/InsetMathBrace.h \
+++ /dev/null
-/**\r
- * \file InsetMathBM.cpp\r
- * This file is part of LyX, the document processor.\r
- * Licence details can be found in the file COPYING.\r
- *\r
- * \author Bernhard Roider\r
- *\r
- * Full author contact details are available in file CREDITS.\r
- */\r
-\r
-#include <config.h>\r
-\r
-#include "InsetMathBM.h"\r
-\r
-#include "MathStream.h"\r
-#include "MathData.h"\r
-#include "LaTeXFeatures.h"\r
-\r
-#include <ostream>\r
-\r
-\r
-namespace lyx {\r
-\r
-InsetMathBM::InsetMathBM()\r
- : InsetMathNest(1)\r
-{}\r
-\r
-\r
-Inset * InsetMathBM::clone() const\r
-{\r
- return new InsetMathBM(*this);\r
-}\r
-\r
-\r
-void InsetMathBM::metrics(MetricsInfo & mi, Dimension & dim) const\r
-{\r
- //FontSetChanger dummy(mi.base, "mathbf");\r
- cell(0).metrics(mi, dim);\r
- metricsMarkers(dim);\r
- ++dim.wid; // for 'double stroke'\r
-}\r
-\r
-\r
-void InsetMathBM::draw(PainterInfo & pi, int x, int y) const\r
-{\r
- //FontSetChanger dummy(pi.base, "mathbf");\r
- cell(0).draw(pi, x + 1, y);\r
- cell(0).draw(pi, x + 2, y);\r
- drawMarkers(pi, x, y);\r
-}\r
-\r
-\r
-void InsetMathBM::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const\r
-{\r
- // FIXME: BROKEN!\r
- Dimension dim;\r
- cell(0).metricsT(mi, dim);\r
-}\r
-\r
-\r
-void InsetMathBM::drawT(TextPainter & pain, int x, int y) const\r
-{\r
- cell(0).drawT(pain, x, y);\r
-}\r
-\r
-\r
-void InsetMathBM::validate(LaTeXFeatures & features) const\r
-{\r
- InsetMathNest::validate(features);\r
- features.require("bm");\r
-}\r
-\r
-\r
-void InsetMathBM::write(WriteStream & os) const\r
-{\r
- os << "\\bm{" << cell(0) << "}";\r
-}\r
-\r
-\r
-void InsetMathBM::infoize(odocstream & os) const\r
-{\r
- os << "bm ";\r
-}\r
-\r
-\r
-} // namespace lyx\r
+++ /dev/null
-// -*- C++ -*-\r
-/**\r
- * \file InsetMathBM.h\r
- * This file is part of LyX, the document processor.\r
- * Licence details can be found in the file COPYING.\r
- *\r
- * \author Bernhard Roider\r
- *\r
- * Full author contact details are available in file CREDITS.\r
- */\r
-\r
-#ifndef MATH_BMINSET_H\r
-#define MATH_BMINSET_H\r
-\r
-#include "InsetMathNest.h"\r
-\r
-\r
-namespace lyx {\r
-\r
-\r
-/// Inset for \bm\r
-class InsetMathBM : public InsetMathNest {\r
-public:\r
- ///\r
- InsetMathBM();\r
- ///\r
- void metrics(MetricsInfo & mi, Dimension & dim) const;\r
- ///\r
- void draw(PainterInfo & pi, int x, int y) const;\r
- ///\r
- void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;\r
- ///\r
- void drawT(TextPainter & pi, int x, int y) const;\r
- ///\r
- void validate(LaTeXFeatures & features) const;\r
- ///\r
- void write(WriteStream & os) const;\r
- ///\r
- void infoize(odocstream & os) const;\r
-private:\r
- virtual Inset * clone() const;\r
-};\r
-\r
-\r
-} // namespace lyx\r
-\r
-#endif\r
namespace lyx {
-InsetMathBoldSymbol::InsetMathBoldSymbol()
- : InsetMathNest(1)
+InsetMathBoldSymbol::InsetMathBoldSymbol(Kind kind)
+ : InsetMathNest(1), kind_(kind)
{}
void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
{
InsetMathNest::validate(features);
- features.require("amssymb");
+ features.require("bm");
}
void InsetMathBoldSymbol::write(WriteStream & os) const
{
- os << "\\boldsymbol{" << cell(0) << "}";
+ switch (kind_) {
+ case BOLD:
+ os << "\\boldsymbol{" << cell(0) << "}";
+ break;
+ case HEAVY:
+ os << "\\heavysymbol{" << cell(0) << "}";
+ break;
+ }
}
void InsetMathBoldSymbol::infoize(odocstream & os) const
{
- os << "Boldsymbol ";
+ switch (kind_) {
+ case BOLD:
+ os << "Boldsymbol ";
+ break;
+ case HEAVY:
+ os << "Heavysymbol ";
+ break;
+ }
}
/// Inset for AMSTeX's \boldsymbol
class InsetMathBoldSymbol : public InsetMathNest {
public:
+ enum Kind {
+ BOLD,
+ HEAVY
+ };
///
- InsetMathBoldSymbol();
+ InsetMathBoldSymbol(Kind kind = BOLD);
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///
void write(WriteStream & os) const;
///
void infoize(odocstream & os) const;
+ ///
+ Kind kind_;
private:
virtual Inset * clone() const;
};
//if (features.amsstyle)
// return;
- features.require("boldsymbol");
//features.binom = true;
InsetMathGrid::validate(features);
#include "InsetMathAMSArray.h"
#include "InsetMathArray.h"
-#include "InsetMathBM.h"
#include "InsetMathBoldSymbol.h"
#include "InsetMathBox.h"
#include "InsetMathCases.h"
return MathAtom(new InsetMathFrac(InsetMathFrac::ATOP));
if (s == "lefteqn")
return MathAtom(new InsetMathLefteqn);
- if (s == "boldsymbol")
- return MathAtom(new InsetMathBoldSymbol);
- if (s == "bm")
- return MathAtom(new InsetMathBM);
+ if (s == "boldsymbol" || s == "bm")
+ return MathAtom(new InsetMathBoldSymbol(InsetMathBoldSymbol::BOLD));
+ if (s == "heavysymbol" || s == "hm")
+ return MathAtom(new InsetMathBoldSymbol(InsetMathBoldSymbol::HEAVY));
if (s == "color" || s == "normalcolor")
return MathAtom(new InsetMathColor(true));
if (s == "textcolor")