Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Cell styles.' topicStudent Support Forum > General > "Cell styles."

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Forum Moderator
email me
09/29/00 7:32pm

>I have a completely blank notebook. On that notebook I have one cell of style ''Text.'' Using the Options Inspector I can see that for Global, Notebook, and Selection scope the SingleLetterItalics property is ''False.'' At the global and notebook scopes the DefaultInlineStyle property is ''None'', which as I understand things implies that any new inline cell will inherit the properties of the surrounding text. However, when I create an inline cell, the SingleLetterItalics property is set to true. All I am trying to do is to type in chemical symbols (e.g. H2O) into the text cell but they come out looking funny because single letter symbols like H, O, N, etc. are slanted while double letter symbols like Na, Cl, Fe, etc. are not. Thank you for the help.

======

One of our FrontEnd developers offers this response:

There are a select few cell styles for which there are default format
types specified. The format types may be adjusted through the aggregate
option CommonDefaultFormatTypes, which is usually set at the global level.
You may query the front end for the value of this option like so:

In[1]:= Options[$FrontEnd, CommonDefaultFormatTypes]

Out[1]=
{CommonDefaultFormatTypes ->
{Text -> TextForm, Input -> StandardForm,
Output -> StandardForm, TextInline -> TraditionalForm,
InputInline -> StandardForm,
OutputInline -> StandardForm}}

Notice that the value of the suboption ''TextInline'' is
TraditionalForm. This means that inline cells that occur within Text
style cells will inherit options from the TraditionalForm prototype cell
in the notebook's style sheet. Options specified in the format type
prototype override the settings of the parent cell. The TraditionalForm
prototype is where inline cells get the SingleLetterItalic behavior.

The workaround is to define a custom cell style for inline use only by
adding a prototype cell to the notebook's style sheet. Here is one such
example.

Cell[
StyleData[''Chemical''],
StyleMenuListing->None,
SingleLetterItalics -> False
]

After you create an inline cell with a formula, simply select the contents
of the inline cell and then perform the keystroke sequence:

Windows: Alt-0
Mac OS: Command-0
X Window: Mod1-0

This will summon a dialog box wherein you may enter a cell style. Enter
''Chemical'' and then click OK. This sets down a StyleBox[] that overrides
the FormatType settings.

The underlying Cell expression looks like this:

Cell[TextData[{
''The chemical formula for water is '',
Cell[BoxData[
FormBox[
StyleBox[
RowBox[{
SubscriptBox[''H'', ''2''], ''O''}],
''ChemicalFormula''], TraditionalForm]]]
}], ''Text'']


Forum Moderator


URL: ,

Subject (listing for 'Cell styles.')
Author Date Posted
Cell styles. Forrest 09/28/00 8:47pm
Re: Cell styles. Aaron Honecker 09/29/00 6:22pm
Re: Cell styles. Forum Modera... 09/29/00 7:32pm
< Previous CommentHelp | Reply To Comment | Reply To Topic