Unwrapped symbols can be obtained either by dissolving the text inset or by
verbatim paste (Ctrl+Shift+V). In such a case, the symbols are wrapped in
\lyxmathsym when exporting to latex, as usual.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29096
a592a061-630c-0410-9148-
cb99ea01b6c8
{
//lyxerr << "*** InsetMathGrid: request: " << cmd << endl;
- Parse::flags parseflg = Parse::QUIET;
+ Parse::flags parseflg = Parse::QUIET | Parse::USETEXT;
switch (cmd.action) {
}
InsetMathGrid grid(1, 1);
if (!topaste.empty())
- if (topaste.size() == 1
+ if ((topaste.size() == 1 && topaste.at(0) < 0x80)
|| !mathed_parse_normal(grid, topaste, parseflg)) {
resetGrid(grid);
mathed_parse_normal(grid, topaste,
#include "InsetMathBig.h"
#include "InsetMathBox.h"
#include "InsetMathBrace.h"
+#include "InsetMathChar.h"
#include "InsetMathColor.h"
#include "InsetMathComment.h"
#include "InsetMathDelim.h"
#include "Cursor.h"
#include "CutAndPaste.h"
#include "DispatchResult.h"
+#include "Encoding.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "LyXFunc.h"
{
//lyxerr << "InsetMathNest: request: " << cmd << endl;
- Parse::flags parseflg = Parse::QUIET;
+ Parse::flags parseflg = Parse::QUIET | Parse::USETEXT;
switch (cmd.action) {
cur.niceInsert(createInsetMath("sim"));
return true;
}
+ if (c >= 0x80 && !Encodings::isMathAlpha(c)) {
+ MathAtom at = createInsetMath("text");
+ at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
+ cur.niceInsert(at);
+ cur.posForward();
+ return true;
+ }
} else {
if (c == '^') {
cur.niceInsert(createInsetMath("textasciicircum"));
return success_;
}
- else if (t.cat() == catOther)
- cell->push_back(MathAtom(new InsetMathChar(t.character())));
+ else if (t.cat() == catOther) {
+ char_type c = t.character();
+ if (c < 0x80 || mode_ & Parse::VERBATIM
+ || !(mode_ & Parse::USETEXT)) {
+ cell->push_back(MathAtom(new InsetMathChar(c)));
+ } else {
+ MathAtom at = createInsetMath("text");
+ at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(t.character())));
+ while (nextToken().cat() == catOther
+ && nextToken().character() >= 0x80) {
+ c = getToken().character();
+ at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
+ }
+ cell->push_back(at);
+ }
+ }
else if (t.cat() == catComment) {
docstring s;
/// Parse verbatim.
VERBATIM = 0x02,
/// Quiet operation (no warnigs or errors).
- QUIET = 0x04
+ QUIET = 0x04,
+ /// Wrap unicode symbols in \text{}.
+ USETEXT = 0x08
};