Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Documentation / Mathematica / Add-ons & Links / XML Capabilities / Working with NotebookML / Syntax of NotebookML /

Options

In Mathematica, various properties of notebooks, cells, and the contents of a cell are described by options. Any notebook with specified options has the following underlying structure.

    Notebook[{cell1, cell2, cell3, ...}, options]

An option has the general form, name Rule value, where the left-hand side specifies the option name and the right-hand side specifies the value of that option. In NotebookML, an option is represented in the following way.

<Option>

<Symbol>
name</Symbol>

NotebookML representation of value

</Option>

For example, this Notebook expression will include a ruler in the toolbar at the top of the displayed window.

Here is the corresponding NotebookML.

In[3]:=

Out[3]=

Multiple options are grouped together in an Options element. Although this is not necessary, it is useful (for ease of programming and efficiency reasons) for many XML applications like XSLT. For example, the cell expression

Cell["some text",FontSizeRule8,FontWeightRule"Bold"]

has the following representation in NotebookML.

In[4]:=

Out[4]=

Options fall into the following four categories.

String/Symbol/Number Options

These options lack any special structure. The left-hand side is rendered as an element that wraps the right-hand side, which is taken as a Symbol element. This can be seen in the following example.

ActiveRuleTrue

<Option>

<Symbol>Active</Symbol>

<Symbol>True</Symbol>

</Option>

Color Values

Several Mathematica options, such as RGBColor or Hue, can take color values. For these options, the head of the right-hand side is treated as a proper element rather than just as a Symbol element. The specified color value is then represented as a sequence of individual Number elements. Here is an example.

BackgroundRuleRGBColor[1,0,0]

<Option>

<Symbol>Background</Symbol>

<Function>

<Symbol>RGBColor</Symbol>

<Number>0</Number>

<Number>0</Number>

<Number>1</Number>

</Function>

</Option>

Suboptions

Many options take a list of suboptions. For these types of options, the option corresponds to the parent element in the NotebookML representation, and each of the suboptions is a child element. Note that in Mathematica, all of the suboptions have left-hand sides that are strings, not symbols. This information is implicit in the XML representation because NotebookML automatically recognizes whether the option should be a string or a symbol on import. The following examples illustrate how this mechanism works.

PrintingOptionsRule{"FirstPageFooter"RuleFalse,"PageFooterMargins"Rule{10,10}}

<Option>

<Symbol>PrintingOptions</Symbol>

<Options>

<Option>

<String>FirstPageFooter</String>

<Symbol>False</Symbol>

</Option>

<Option>

<String>PageFooterMargins</String>

<Function>

<Symbol>List</Symbol>

<Number>10</Number>

<Number>10</Number>

</Function>

</Option>

</Options>

</Option>

List Types

Some options in Mathematica can take a list of any number of values. Since each of the values must be separated from one another, each is enclosed in a separate child element. In this example, each of the True or False values is enclosed in a separate Symbol element.

ColumnLinesRule{True,False,True}

<ColumnLines>

<Symbol>True</Symbol>

<Symbol>False</Symbol>

<Symbol>True</Symbol>

</ColumnLines>

When there are sublists in the option value, each of the sublists is enclosed in its own List element, as in the following examples. The first example shows only numbers as suboptions, while the second shows both symbols and numbers. Here are two examples.

CellFrameRule{{4,0},{0,2}}

<Option>

<Symbol>CellFrame</Symbol>

<Function>

<Symbol>List</Symbol>

<Function>

<Symbol>List</Symbol>

<Number>4</Number>

<Number>0</Number>

</Function>

<Function>

<Symbol>List</Symbol>

<Number>0</Number>

<Number>2</Number>

</Function>

</Function>

</Option>

CellFrameRule{{Inherited,5},{0,Inherited}}

<Option>

<Symbol>CellFrame</Symbol>

<Function>

<Symbol>List</Symbol>

<Function>

<Symbol>List</Symbol>

<Symbol>Inherited</Symbol>

<Number>5</Number>

</Function>

<Function>

<Symbol>List</Symbol>

<Number>0</Number>

<Symbol>Inherited</Symbol>

</Function>

</Function>

</Option>



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information


 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy | [ja] |
Sign up for our newsletter: