Remove macros like '\tiny ' or '\tiny{}' or '\tiny' followed by
any other non-alpha char correctly
void LatexInfo::buildEntries()
{
static regex const rmath("\\\\(begin|end)\\{((eqnarray|equation|flalign|gather|multiline|align)\\*?)\\}");
void LatexInfo::buildEntries()
{
static regex const rmath("\\\\(begin|end)\\{((eqnarray|equation|flalign|gather|multiline|align)\\*?)\\}");
- static regex const rkeys("\\\\((([a-z]+\\*?)(\\{([a-z]+)\\})?))([\\{ ])");
+ static regex const rkeys("\\\\((([a-z]+\\*?)(\\{([a-z]+\\*?)\\})?))");
smatch sub, submath;
bool evaluatingRegexp = false;
KeyInfo found;
smatch sub, submath;
bool evaluatingRegexp = false;
KeyInfo found;
}
if (found.parenthesiscount == 0) {
// Probably to be discarded
}
if (found.parenthesiscount == 0) {
// Probably to be discarded
- if (interval.par[sub.position(0) + sub.str(3).length()] == ' ')
+ if (interval.par[sub.position(0) + sub.str(3).length() + 1] == ' ')
found.head = "\\" + sub.str(3) + " ";
else
found.head = "\\" + sub.str(3);
found.head = "\\" + sub.str(3) + " ";
else
found.head = "\\" + sub.str(3);
found.head = "\\" + sub.str(3) + "{";
}
else if (found.parenthesiscount == 2) {
found.head = "\\" + sub.str(3) + "{";
}
else if (found.parenthesiscount == 2) {
- found.head = sub.str(0);
+ found.head = sub.str(0) + "{";
found._tokensize = found.head.length();
}
found._tokensize = found.head.length();
found._tokensize = found.head.length();
}
found._tokensize = found.head.length();
// Same effect as previous, parameter will survive (because there is no one anyway)
// No split
makeKey("noindent", KeyInfo(KeyInfo::isStandard, 0, true));
// Same effect as previous, parameter will survive (because there is no one anyway)
// No split
makeKey("noindent", KeyInfo(KeyInfo::isStandard, 0, true));
+ // like ('tiny{}' or '\tiny ' ... }
makeKey("footnotesize|tiny|scriptsize|small|large|Large|LARGE|huge|Huge", KeyInfo(KeyInfo::isSize, 0, true));
// Survives, like known character
makeKey("lyx", KeyInfo(KeyInfo::isIgnored, 0, false));
makeKey("begin", KeyInfo(KeyInfo::isMath, 1, false));
makeKey("footnotesize|tiny|scriptsize|small|large|Large|LARGE|huge|Huge", KeyInfo(KeyInfo::isSize, 0, true));
// Survives, like known character
makeKey("lyx", KeyInfo(KeyInfo::isIgnored, 0, false));
makeKey("begin", KeyInfo(KeyInfo::isMath, 1, false));
+ makeKey("end", KeyInfo(KeyInfo::isMath, 1, false));
+
+ makeKey("par", KeyInfo(KeyInfo::doRemove, 0, true));
{
while (start < region_end) {
if (interval.par[start] == '{') {
{
while (start < region_end) {
if (interval.par[start] == '{') {
- int closing = interval.findclosing(start+1, region_end);
+ // Closing is allowed past the region
+ int closing = interval.findclosing(start+1, interval.par.length());
interval.addIntervall(start, start+1);
interval.addIntervall(closing, closing+1);
}
interval.addIntervall(start, start+1);
interval.addIntervall(closing, closing+1);
}
ostringstream os;
LatexInfo li(par);
KeyInfo DummyKey = KeyInfo(KeyInfo::KeyType::isMain, 2, true);
ostringstream os;
LatexInfo li(par);
KeyInfo DummyKey = KeyInfo(KeyInfo::KeyType::isMain, 2, true);
DummyKey._tokensize = 0;
DummyKey._tokenstart = 0;
DummyKey._dataStart = 0;
DummyKey._tokensize = 0;
DummyKey._tokenstart = 0;
DummyKey._dataStart = 0;