Add text formatting commands to the LaTeX grammar (#19607)

GitOrigin-RevId: f69cd323992c80de3f0a458a637fa8f160017076
This commit is contained in:
Alf Eaton
2024-08-02 08:06:11 +00:00
committed by Copybot
parent 37e897260c
commit 603ff28df0
14 changed files with 389 additions and 294 deletions
@@ -1,5 +1,4 @@
import { FlatOutlineItem } from '../../utils/tree-query'
import { enterNode } from '../../utils/tree-operations/outline'
import { enterNode, FlatOutlineItem } from '../../utils/tree-operations/outline'
import { makeProjectionStateField } from '../../utils/projection-state-field'
export const documentOutline =
@@ -52,6 +52,19 @@ const typeMap: Record<string, string[]> = {
Input: ['$CommandTooltipCommand'],
Ref: ['$CommandTooltipCommand'],
UrlCommand: ['$CommandTooltipCommand'],
// text formatting commands that can be toggled via the toolbar
TextBoldCommand: ['$ToggleTextFormattingCommand'],
TextItalicCommand: ['$ToggleTextFormattingCommand'],
// text formatting commands that cannot be toggled via the toolbar
TextSmallCapsCommand: ['$OtherTextFormattingCommand'],
TextTeletypeCommand: ['$OtherTextFormattingCommand'],
TextMediumCommand: ['$OtherTextFormattingCommand'],
TextSansSerifCommand: ['$OtherTextFormattingCommand'],
TextSuperscriptCommand: ['$OtherTextFormattingCommand'],
TextSubscriptCommand: ['$OtherTextFormattingCommand'],
StrikeOutCommand: ['$OtherTextFormattingCommand'],
EmphasisCommand: ['$OtherTextFormattingCommand'],
UnderlineCommand: ['$OtherTextFormattingCommand'],
}
export const LaTeXLanguage = LRLanguage.define({