mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1770 from overleaf/ns-tags-and-tikz
handle math in \tag* and \tikz commands GitOrigin-RevId: 6a71100409f405d58e04d12403acd3f4f24360c7
This commit is contained in:
parent
7e32ed5158
commit
c7ce214f8c
1 changed files with 21 additions and 2 deletions
|
@ -1690,6 +1690,21 @@ var readOptionalGeneric = function(TokeniseResult, k) {
|
|||
return null;
|
||||
};
|
||||
|
||||
var readOptionalStar = function(TokeniseResult, k) {
|
||||
var Tokens = TokeniseResult.tokens;
|
||||
var text = TokeniseResult.text;
|
||||
|
||||
var params = Tokens[k + 1];
|
||||
|
||||
if (params && params[1] === "Text") {
|
||||
var paramNum = text.substring(params[2], params[3]);
|
||||
if (paramNum.match(/^(\*)+\s*$/)) {
|
||||
return k + 1; // got it
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
var readOptionalDef = function (TokeniseResult, k) {
|
||||
var Tokens = TokeniseResult.tokens;
|
||||
var text = TokeniseResult.text;
|
||||
|
@ -1947,9 +1962,13 @@ var InterpretTokens = function (TokeniseResult, ErrorReporter) {
|
|||
} else if (seq === "input") {
|
||||
newPos = read1filename(TokeniseResult, i);
|
||||
if (newPos === null) { continue; } else {i = newPos;};
|
||||
} else if (seq === "hbox" || seq === "text" || seq === "mbox" || seq === "footnote" || seq === "intertext" || seq === "shortintertext" || seq === "textnormal" || seq === "tag" || seq === "reflectbox" || seq === "textrm") {
|
||||
} else if (seq === "hbox" || seq === "text" || seq === "mbox" || seq === "footnote" || seq === "intertext" || seq === "shortintertext" || seq === "textnormal" || seq === "reflectbox" || seq === "textrm") {
|
||||
nextGroupMathMode = false;
|
||||
} else if (seq === "rotatebox" || seq === "scalebox" || seq == "feynmandiagram") {
|
||||
} else if (seq === "tag") {
|
||||
newPos = readOptionalStar(TokeniseResult, i);
|
||||
if (newPos === null) { /* do nothing */ } else {i = newPos;};
|
||||
nextGroupMathMode = false;
|
||||
} else if (seq === "rotatebox" || seq === "scalebox" || seq == "feynmandiagram" || seq === "tikz") {
|
||||
newPos = readOptionalGeneric(TokeniseResult, i);
|
||||
if (newPos === null) { /* do nothing */ } else {i = newPos;};
|
||||
newPos = readDefinition(TokeniseResult, i);
|
||||
|
|
Loading…
Reference in a new issue