Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Notebooks and Documents > Low-Level Notebook Programming > Low-Level Notebook Structure >

TagBox

TagBox[boxes, tag]
is a low-level box construct that displays as boxes but maintains tag to guide the interpretation of boxes on input.
  • TagBox provides a way to store hidden information in Mathematica input and output.
  • By convention, tag is typically a symbol that corresponds to the head of the interpreted form of boxes.
  • The following options can be given:
AutoDeleteFalsewhether to strip the TagBox if boxes are modified
DeletionWarningFalsewhether to issue a warning if boxes are deleted
EditableAutomaticwhether to allow boxes to be edited
SelectableAutomaticwhether to allow boxes to be selected
StripWrapperBoxesFalsewhether to remove StyleBox etc. from within boxes
  • If you modify the displayed form of TagBox[boxes, tag] only boxes will be modified, and there is no guarantee that correct correspondence with tag will be maintained.
TagBox does not change the appearance of its contents:
The standard formatting for some expressions uses TagBox to aid interpretation:
The formatted result looks like this:
Without the TagBox, this notation would be interpreted differently:
A GridBox is normally interpreted as a matrix:
Use a predefined TagBox interpretation to get a different result:
TagBox does not change the appearance of its contents:
In[1]:=
Click for copyable input
Out[1]//DisplayForm=
 
The standard formatting for some expressions uses TagBox to aid interpretation:
In[1]:=
Click for copyable input
Out[1]=
The formatted result looks like this:
In[2]:=
Click for copyable input
Out[2]=
Without the TagBox, this notation would be interpreted differently:
In[3]:=
Click for copyable input
Out[3]=
 
A GridBox is normally interpreted as a matrix:
In[1]:=
Click for copyable input
Out[1]=
Use a predefined TagBox interpretation to get a different result:
In[2]:=
Click for copyable input
Out[2]//InputForm=
The following traditional notations are identical, so you cannot distinguish one from the other:
The box representation contains TagBox data:
The resulting box structures can be unambiguously interpreted:
New in 3
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team