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

2.9.9 Styles and Fonts in Output

StyleForm[expr, options] print with the specified style options
StyleForm[expr, "style"] print with the specified cell style

Specifying output styles.
The second  is here shown in boldface.

In[1]:=  {x^2, StyleForm[x^2, FontWeight->"Bold"]}

Out[1]=

This shows the word text in font sizes from 10 to 20 points.

In[2]:=  Table[StyleForm["text", FontSize->s], {s, 10, 20}]

Out[2]=

This shows the text in the Tekton font.

In[3]:=  StyleForm["some text", FontFamily->"Tekton"]


option typical setting(s)
FontSize 12 size of characters in printer's points
FontWeight "Plain" or "Bold" weight of characters
FontSlant "Plain" or "Italic" slant of characters
FontFamily "Courier", "Times", "Helvetica" font family
FontColor GrayLevel[0] color of characters
Background GrayLevel[1] background color for characters

A few options that can be used in StyleForm.

If you use the notebook front end for Mathematica, then each piece of output that is generated will by default be in the style of the cell in which the output appears. By using StyleForm[expr, "style"], however, you can tell Mathematica to output a particular expression in a different style.

Here is an expression output in the style normally used for section headings.

In[4]:=  StyleForm[x^2 + y^2, "Section"]

Out[4]//StyleForm=

Section 2.11.1 describes in more detail how cell styles work. By using StyleForm[expr, "style", options] you can generate output that is in a particular style, but with certain options modified.


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



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