From: André Pönitz Date: Wed, 3 Apr 2002 10:45:32 +0000 (+0000) Subject: get recently broken \mathcircumflex working again (hackish, proper fix in 1.3) X-Git-Tag: 1.6.10~19513 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=539d0d16648f3ceabcc4d4b8f2300ebdcbb8369c;p=features.git get recently broken \mathcircumflex working again (hackish, proper fix in 1.3) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3889 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/math_hash.C b/src/mathed/math_hash.C index dcc7643a13..c02b4156f8 100644 --- a/src/mathed/math_hash.C +++ b/src/mathed/math_hash.C @@ -103,6 +103,7 @@ key_type wordlist_array[] = {"mathfrak", LM_TK_FONT, LM_TC_EUFRAK}, {"mathit", LM_TK_FONT, LM_TC_IT}, {"mathnormal", LM_TK_FONT, LM_TC_VAR}, + //{"mathring", LM_TK_DECORATION, 0}, {"mathrm", LM_TK_FONT, LM_TC_RM}, {"mathsf", LM_TK_FONT, LM_TC_SF}, {"mathtt", LM_TK_FONT, LM_TC_TT}, diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 3cf76db27b..ef3bf5da1b 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -24,6 +24,7 @@ #include "math_macrotable.h" #include "math_macrotemplate.h" #include "math_mathmlstream.h" +#include "math_streamstr.h" #include "support/lstrings.h" #include "support/LAssert.h" #include "debug.h" @@ -53,9 +54,9 @@ MathInset * MathMacro::clone() const } -const char * MathMacro::name() const +string const & MathMacro::name() const { - return tmplate_->asMacroTemplate()->name().c_str(); + return tmplate_->asMacroTemplate()->name(); } @@ -190,8 +191,8 @@ bool MathMacro::idxRight(idx_type &, pos_type &) const void MathMacro::validate(LaTeXFeatures & features) const { - if (name() == "binom") - features.require("binom"); + if (name() == "binom" || name() == "mathcircumflex") + features.require(name()); //MathInset::validate(features); } diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index ee8059c03d..1de5a90caf 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -79,7 +79,7 @@ private: /// void operator=(MathMacro const &); /// - char const * name() const; + string const & name() const; /// bool defining() const; /// diff --git a/src/mathed/math_macrotable.C b/src/mathed/math_macrotable.C index d2cd7d6f67..7df45d8163 100644 --- a/src/mathed/math_macrotable.C +++ b/src/mathed/math_macrotable.C @@ -63,10 +63,10 @@ void MathMacroTable::create } -void MathMacroTable::define(string const & def) +void MathMacroTable::define(string const & display) { string name; - mathed_parse_macro(name, def); + mathed_parse_macro(name, display); } @@ -151,6 +151,9 @@ void MathMacroTable::builtinMacros() define("\\def\\Join{\\ltimes\\kern-12mu\\rtimes}"); } + // + define("\\def\\mathcircumflex{\\mbox{\\^{}}}\n" "{\\hat{}}"); + //define("\def\lint", 4, "\\int_#1^#2#3 d#4}"); //define("\\def\\silentmult{\\cdot}"); //define("\def\binom", 2, "\\left(\\frac#1#2\\right)}"); diff --git a/src/mathed/math_macrotable.h b/src/mathed/math_macrotable.h index 91765b9f13..ab37719058 100644 --- a/src/mathed/math_macrotable.h +++ b/src/mathed/math_macrotable.h @@ -29,7 +29,7 @@ public: static void dump(); private: /// create internal macros (like \longrightarrow...) - static void define(string const & definition); + static void define(string const & display); /// typedef std::map table_type; diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 64cb40acdc..961bcac731 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -802,6 +802,7 @@ bool Parser::parse_macro(string & name) return false; } + // is a version for display attached? MathArray ar2; parse_into(ar2, FLAG_ITEM); diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index b13212770e..d32a2c5252 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -436,6 +436,13 @@ double const Vert[] = { }; +double const ring[] = { + 2, 5, + 0.5, 0.8, 0.8, 0.5, 0.5, 0.2, 0.2, 0.5, 0.5, 0.8, + 0 +}; + + double const tilde[] = { 2, 4, 0.05, 0.8, 0.25, 0.2, 0.75, 0.8, 0.95, 0.2, @@ -510,6 +517,7 @@ named_deco_struct deco_table[] = { {"breve", parenth, 1 }, {"vec", arrow, 3 }, {"not", slash, 0 }, + {"mathring", ring, 0 }, // Dots {"ldots", hline3, 0 },