Skip to content

Support standard LaTeX relative size declarations #311

Description

@Happypig375

Support the standard LaTeX size declarations in formula and text content: \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large, \LARGE, \huge, and \Huge.

CSharpMath has no document class, so define each declaration as a documented scale relative to the painter's externally supplied base font size, using the standard 10pt-class ratios as the compatibility baseline. Keep this separate from arbitrary \fontsize{size}{baseline-skip} support.

Acceptance criteria:

  • A declaration applies from its position to the end of the current group and restores the enclosing size afterward; nested declarations and mixed math/text transitions behave predictably.
  • Atom metrics, glyphs, rules, accents, radicals, delimiters, scripts, and multiline text all measure and draw from the same effective size.
  • Script-style scaling composes once with the declared size rather than resetting or double-applying it.
  • Serialization preserves scoped declarations canonically and parse → serialize → parse retains the effective size structure.
  • All ten commands have structural scale tests plus focused cross-frontend rendering coverage at group boundaries and in nested formulas.
  • Existing public FontSize/magnification behavior and text parser \fontsize behavior remain compatible.

The LaTeX font-selection guide lists the ten declarations and their standard 10pt-class sizes: https://www.latex-project.org/help/documentation/fntguide.pdf

Parent backlog: #81. This was identified from the WpfMath parity tracker #145.

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.Area/RenderingTypesetting, measurement, fonts, text layout, and drawing.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