Skip to content

editor: fix false "used inside existing math mode" warning for \tag*#1495

Open
MarkQuach12 wants to merge 6 commits into
overleaf:mainfrom
MarkQuach12:bugfix/tag-star-linter-warning
Open

editor: fix false "used inside existing math mode" warning for \tag*#1495
MarkQuach12 wants to merge 6 commits into
overleaf:mainfrom
MarkQuach12:bugfix/tag-star-linter-warning

Conversation

@MarkQuach12

Copy link
Copy Markdown

Description

Fixes a linter false positive where \tag*{...} (amsmath's unnumbered tag) incorrectly triggered an "open inline math ( used inside existing math mode" warning when its argument contained inline math, e.g. \tag*{\(\dagger\)} or \tag*{$abc$}. The plain \tag{...} form already worked correctly.

Root cause: the linter marks \tag's argument group as text-mode so nested math delimiters are allowed, but the literal * character between \tag and { was being treated as its own token and reset that text-mode flag before the argument group was reached. The fix has \tag consume an immediately following * so the text-mode flag survives to the argument group.

Related issues / Pull Requests

#1255

Contributor Agreement

tommybobbins and others added 6 commits June 2, 2026 19:28
\tag*{...} (amsmath's unnumbered tag) incorrectly triggered an "open
inline math \( used inside existing math mode" warning when its
argument contained inline math, e.g. \tag*{\(\dagger\)} or
\tag*{$abc$}. \tag{...} without the star already worked.

The linter marks \tag's argument group as text-mode so nested math
delimiters are allowed, but the literal * between \tag and { was
tokenized separately and reset that flag before the argument group
was reached. \tag now consumes an immediately following * so the
text-mode flag survives to the argument group.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants