Questions tagged [boxes]

Boxes are the underlying representation of two-dimensional forms in notebooks.

Boxes are the underlying low-level representation of two-dimensional formatted expressions in notebooks. Boxes can be encoded in terms of Mathematica expressions or in a more compact way as strings. Expressions can be converted to/from their box forms using ToBoxes and ToExpression. MakeBoxes defines how an expression will be converted to boxes for display by the front end.

Questions about the general typesetting capabilities of Mathematica should use the tag .

Useful links:

Example questions:

167 questions
3
votes
1 answer

Custom MakeBoxes are issued also for different pattern expressions

Suppose I want to display some expression, say foo[p1_,p2_], as a point in a circle. I can achieve this using MakeBoxes, like in the following: ClearAll[foo]; foo /: MakeBoxes[foo[p1_, p2_], fmt_] := GraphicsBox[{CircleBox[{0, 0}], PointSize@0.08,…
glS
  • 7,623
  • 1
  • 21
  • 61
1
vote
2 answers

How to convert comment in RowBox to DisplayForm string

ToExpression[RowBox[{"a","(*","what", "*)"}],StandardForm] This conversion above ignores the commment content (*what*) The result I expected is something like the DisplayForm below. RowBox[{"a","(*","what","*)"}]//DisplayForm Update: one of my…
HyperGroups
  • 8,619
  • 1
  • 26
  • 63
1
vote
0 answers

How to do indentation of nesting of Associations, Lists and other heads?

I was looking at the presentation about Wolfram's Symbolic ERP Project and in this video, they had functions to do nice indentation of nested Associations, List and other Heads. Is there an easy way to implement this or is there a hidden…
user13892
  • 9,375
  • 1
  • 13
  • 41
0
votes
0 answers

For DisplayForm[ButtonBox[ _String ]], "2%" displays as "2 x %". How to prevent this?

Seems that the ButtonBox is visually (not functionally) treating the String as an Expression. (* 1 *) DisplayForm[ButtonBox["2%"]] (* 2 *) Button["2%"] (* 3 *) DisplayForm["2%"] (* 4 *) "2%" (* 5 *) 2% The text in 1 and 5 appear the same (2x%).…
jWey
  • 73
  • 6