Skip to content

captureCellRun emits Syntax::sntx when a cell has a TraditionalForm[HoldForm[...]] display label (e.g. a Manipulate Item) #59

Description

@mbahram

Building a cell that renders a TraditionalForm[HoldForm[...]] label (a Manipulate Item label showing a vector/fraction such as {Cos[\[Phi]] Sin[\[Theta]], ...} or {Cos[\[Theta]/2], \[ExponentialE]^(\[ImaginaryI] \[Phi]) Sin[\[Theta]/2]}) emits Syntax::sntx: Invalid syntax in or before "{cos(----...)}" (3x for a cell with two such labels).

Cause

captureCellRun (MarkdownToNotebook.wl ~lines 849-889) runs the cell and captures output. Somewhere in the output-capture / reparse path the TraditionalForm label is typeset to its ASCII form ({cos(----)}, the ---- being a fraction bar) and then reparsed as WL, which is invalid syntax -> Syntax::sntx.

Impact

Benign for the artifact: the built .nb is correct (labels render as proper FractionBox/SuperscriptBox, no sntx text or ASCII art in the notebook body). But it violates the no-messages-during-build bar and spams 3 warnings per rebuild.

Repro

QIS-book ch02 Manipulate cell (BlochSpherePlot with theta/phi controls and two Item[Row[{..., TraditionalForm[HoldForm[{...}]]}]] labels). Deleting the Manipulate block makes the messages vanish; the two TraditionalForm labels are the source.

Suggested direction

In the output-capture path, avoid reparsing a TraditionalForm-rendered display label as WL input (treat already-typeset FormBox/TraditionalForm output as boxes, not as code to reparse). Found while cleaning ch02 (#57/#58 context).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions