Text

Text[expr]

displays with expr in plain text format.

Text[expr,coords]

is a graphics primitive that displays the textual form of expr centered at the point specified by coords.

Details and Options

  • The text is displayed by default in StandardForm, but in a typical textual font such as Arial or Helvetica.
  • Text can be used in both two- and three-dimensional graphics.
  • In graphics, Text[expr] is equivalent to Text[expr,{0,0}] or Text[expr,{0,0,0}].
  • Text[expr,coords] works like Inset[expr,coords].
  • The coordinates can be specified either as {x,y,} or as Scaled[{x,y,}]. »
  • In two dimensions, coordinates can also be specified using Offset. »
  • Text[expr,coords,offset] specifies an offset for the block of text relative to the coordinates given. Giving an offset {sdx,sdy} specifies that the point {x,y} should lie at relative coordinates {sdx,sdy} within the bounding rectangle that encloses the text. Each relative coordinate runs from -1 to +1 across the bounding rectangle.
  • The offsets specified need not be in the range -1 to +1.
  • Sample offsets to use in two-dimensional graphics include:
  • {0,0}text centered at {x,y}
    {-1,0}lefthand end at {x,y}
    {1,0}righthand end at {x,y}
    {0,-1}centered above {x,y}
    {0,1}centered below {x,y}
  • Text[expr,coords,offset,dir] specifies the orientation of the text and is given by the direction vector dir. Possible values of dir are:
  • {1,0}ordinary horizontal text
    {0,1}vertical text reading from bottom to top
    {0,-1}vertical text reading from top to bottom
    {-1,0}horizontal upsidedown text
  • Text in three-dimensional graphics is placed at a position that corresponds to the projection of the point {x,y,z} specified. Text is drawn in front of all other objects.
  • The following options can be given:
  • Background Nonebackground color
    ContentSelectableAutomaticwhether to allow selection of contents
    BaseStyle{}base style specifications for the contents
    FormatType Automaticformat type
  • Outside of graphics, Text[expr] effectively generates a TextCell.

Examples

open allclose all

Basic Examples  (3)

Display an expression in plain text format:

Display text in 2D graphics:

Display text in 3D graphics:

Scope  (10)

Positions  (6)

By default, Center is used for the position of the text in 2D:

Automatic is equivalent to Center:

Specify ordinary coordinates in a graphic:

Use Scaled coordinates:

ImageScaled specifies coordinates in a whole image, including padding:

Use Offset coordinates in 2D:

Symbolic positions can be specified:

Offsets and Directions  (4)

By default, Center is used for the alignment position:

Automatic is equivalent to Center:

Specify an alignment position within the text, using symbolic positions:

Specify the offsets using , coordinates within the text:

Specify the orientation of text using a vector:

Options  (3)

Background  (1)

Specify the background color:

FormatType  (2)

By default, expressions are displayed using TraditionalForm:

Display expressions using StandardForm:

Properties & Relations  (2)

The symbolic positions are relative to ImageScaled coordinates:

Text styles can be specified by using Style:

Neat Examples  (1)

A random collage of text:

Wolfram Research (1988), Text, Wolfram Language function, https://reference.wolfram.com/language/ref/Text.html (updated 2016).

Text

Wolfram Research (1988), Text, Wolfram Language function, https://reference.wolfram.com/language/ref/Text.html (updated 2016).

CMS

Wolfram Language. 1988. "Text." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/Text.html.

APA

Wolfram Language. (1988). Text. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Text.html

BibTeX

@misc{reference.wolfram_2024_text, author="Wolfram Research", title="{Text}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/Text.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_text, organization={Wolfram Research}, title={Text}, year={2016}, url={https://reference.wolfram.com/language/ref/Text.html}, note=[Accessed: 21-November-2024 ]}