TextCell

TextCell["string"]

gives a text cell that can appear in a Wolfram System notebook.

TextCell["string","style"]

gives a text cell with the specified style.

TextCell["string","style1","style2",]

gives a text cell with multiple styles applied to it.

Details and Options

  • Text cells are formatted like text, with appropriate spacing and line breaking.
  • CellPrint[TextCell[expr]] inserts a text cell into your current notebook.
  • Typical possible styles for text cells include "Title", "Section", "Text", etc.
  • TextCell[Row[{expr1,expr2,}]] generates a text cell containing a concatenation of the expri, which need not be only strings.
  • TextCell can have any of the many options of Cell, including:
  • Backgroundthe color of the background for the cell
    CellBaselinealignment relative to surrounding text
    CellFramewhether to draw a frame around the cell
    CellTagstags for the cell
    Editablewhether to allow the contents of the cell to be edited
    FontSizethe default size of text in the cell
    TextAlignmenthow to align text in the cell

Examples

open allclose all

Basic Examples  (2)

This represents a cell that contains text:

This turns the cell expression into an actual cell in the current notebook:

abcde

Create a cell with the Section style:

Scope  (4)

Text cells can contain a mixture of simple text and Wolfram Language expressions:

Text cells can contain styled text:

Use different styles:

Use more than one style:

Applications  (1)

Here is a simple function that produces a document as an answer using expression and text cells:

Properties & Relations  (2)

TextCell and ExpressionCell format contents differently:

If the argument to TextCell is not a string or a Row, it will produce an expression cell:

Possible Issues  (1)

Certain Cell options only affect standalone cells, such as cells produced by CellPrint, and do not affect cells that occur within an output cell:

abcde
Wolfram Research (2007), TextCell, Wolfram Language function, https://reference.wolfram.com/language/ref/TextCell.html (updated 2017).

Text

Wolfram Research (2007), TextCell, Wolfram Language function, https://reference.wolfram.com/language/ref/TextCell.html (updated 2017).

CMS

Wolfram Language. 2007. "TextCell." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/TextCell.html.

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_textcell, organization={Wolfram Research}, title={TextCell}, year={2017}, url={https://reference.wolfram.com/language/ref/TextCell.html}, note=[Accessed: 22-November-2024 ]}