Mathematica >

TaggingRules

TaggingRules
is an option for selections that specifies a list of strings to be associated with a selection.
  • TaggingRules provides a way of storing additional information with a selection, for example, to be used by other programs in processing a notebook. It can be set to a list of one or more strings.
  • With the default setting TaggingRules->None, no additional information is associated with the selection.
  • Typically, structured metadata is broken up into pieces that can be identified using selector names in the form "selector"->data. The selector can then be individually queried using CurrentValue.
  • Another typical method for storing highly structured data is to use subselectors inside of selectors. For example, . The subselectors can then be queried using CurrentValue. Subselectors can have their own subselectors, to an arbitrary depth.
  • TaggingRules can be set at the cell, notebook, and global level.
Apply TaggingRules at the cell level:
Use nested rules as TaggingRules:
Reference specific TaggingRules values using CurrentValue:
Reference nested values directly by using subselectors in CurrentValue:
Apply TaggingRules at the cell level:
In[1]:=
Click for copyable input
Out[1]=
Use nested rules as TaggingRules:
In[2]:=
Click for copyable input
Out[2]=
 
Reference specific TaggingRules values using CurrentValue:
In[1]:=
Click for copyable input
Out[1]=
Reference nested values directly by using subselectors in CurrentValue:
In[2]:=
Click for copyable input
Out[2]=
Apply TaggingRules at the notebook level:
Apply TaggingRules at the global level:
TaggingRules can be used like a DynamicModule variable that spans cells:
New in 4.0
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF