Skip to content

Unify text/math LaTeX command registration and serialization #297

Description

@Happypig375

Commands that exist in both text and math parsing should not require separate registration and serialization definitions. Introduce a shared command descriptor/dispatch layer once the common token and mode-transition contract exists.

Scope:

  • Represent command spelling, allowed modes, argument shape, parse behavior, and serialization behavior in one shared definition where semantics overlap.
  • Migrate duplicated font-style, color, text, spacing, and escaped-symbol handling incrementally.
  • Keep mode-specific commands explicit; do not force unrelated text-layout behavior into the math atom model.
  • Preserve supported customization points and frontend package boundaries.

Acceptance criteria:

  • Every migrated shared command has one registration and one round-trip definition.
  • The math and text suites cover the same spelling, bracing, escaping, and error behavior for migrated commands.
  • Unknown and mode-invalid commands retain deterministic, source-indexed errors.
  • Existing public parser/painter APIs and serialization output remain compatible unless a separately documented correction is required.

Blocked by the shared lexer/mode contract from the #58 work breakdown.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area/ParsingLaTeX tokenization, parsing, commands, and serialization.Type/EnhancementA concrete change to CSharpMath behavior or capability.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions