---
title: "TextCell"
language: "en"
type: "Symbol"
summary: "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, SubscriptBox[style, 1], SubscriptBox[style, 2], ...] gives a text cell with multiple styles applied to it."
keywords: 
- document generation
- high-level text cells
- notebook content
- notebook elements
- report generation
canonical_url: "https://reference.wolfram.com/language/ref/TextCell.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Notebook Document Generation"
    link: "https://reference.wolfram.com/language/guide/DocumentGeneration.en.md"
  - 
    title: "Cell Styling Options"
    link: "https://reference.wolfram.com/language/guide/CellStylingOptions.en.md"
  - 
    title: "Automated Reports"
    link: "https://reference.wolfram.com/language/guide/AutomatedReports.en.md"
  - 
    title: "Textual Elements in Notebooks"
    link: "https://reference.wolfram.com/language/guide/TextualElementsInNotebooks.en.md"
  - 
    title: "Toolbars"
    link: "https://reference.wolfram.com/language/guide/Toolbars.en.md"
  - 
    title: "Text Generation"
    link: "https://reference.wolfram.com/language/guide/TextConstruction.en.md"
related_workflows: 
  - 
    title: "Programmatically Insert a Cell in a Notebook"
    link: "https://reference.wolfram.com/language/workflow/ProgrammaticallyInsertACellInANotebook.en.md"
  - 
    title: "Create a Section Heading"
    link: "https://reference.wolfram.com/language/workflow/CreateASectionHeading.en.md"
related_functions: 
  - 
    title: "Text"
    link: "https://reference.wolfram.com/language/ref/Text.en.md"
  - 
    title: "Row"
    link: "https://reference.wolfram.com/language/ref/Row.en.md"
  - 
    title: "TextGrid"
    link: "https://reference.wolfram.com/language/ref/TextGrid.en.md"
  - 
    title: "ExpressionCell"
    link: "https://reference.wolfram.com/language/ref/ExpressionCell.en.md"
  - 
    title: "CellGroup"
    link: "https://reference.wolfram.com/language/ref/CellGroup.en.md"
  - 
    title: "CellPrint"
    link: "https://reference.wolfram.com/language/ref/CellPrint.en.md"
  - 
    title: "Cell"
    link: "https://reference.wolfram.com/language/ref/Cell.en.md"
  - 
    title: "CreateDocument"
    link: "https://reference.wolfram.com/language/ref/CreateDocument.en.md"
  - 
    title: "NotebookImport"
    link: "https://reference.wolfram.com/language/ref/NotebookImport.en.md"
---
# 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","Subscript[style, 1]","Subscript[style, 2]",\[Ellipsis]]
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:

|               |                                                         |
| :------------ | :------------------------------------------------------ |
| Background    | the color of the background for the cell                |
| CellBaseline  | alignment relative to surrounding text                  |
| CellFrame     | whether to draw a frame around the cell                 |
| CellTags      | tags for the cell                                       |
| Editable      | whether to allow the contents of the cell to be edited  |
| FontSize      | the default size of text in the cell                    |
| TextAlignment | how to align text in the cell                           |

## Examples (10)

### Basic Examples (2)

This represents a cell that contains text:

```wl
In[1]:= TextCell["abcde"]

Out[1]= TextCell["abcde"]
```

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

```wl
In[2]:= CellPrint[%]
```

abcde

---

Create a cell with the Section style:

```wl
In[1]:= TextCell["abcde", "Section"]

Out[1]= TextCell["abcde", "Section"]
```

### Scope (4)

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

```wl
In[1]:= CellPrint[TextCell[Row[{a + b, "aasa", Sqrt[2]}], "Text"]]
```

a + baasaSqrt[2]

---

Text cells can contain styled text:

```wl
In[1]:= CellPrint[TextCell[Row[{Style["bold", FontWeight -> Bold], " text"}], "Text"]]
```

**bold** text

---

Use different styles:

```wl
In[1]:= Table[TextCell["text", s], {s, {"Text", "Subsection", "Section", "Title"}}]

Out[1]= {TextCell["text", "Text"], TextCell["text", "Subsection"], TextCell["text", "Section"], TextCell["text", "Title"]}
```

---

Use more than one style:

```wl
In[1]:= TextCell["text", "Section", "TI"]

Out[1]= TextCell["text", "Section", "TI"]
```

### Applications (1)

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

```wl
In[1]:=
documentSolve[ eqns_, vars_] := 
	DocumentNotebook@TextCell[Row[{"The equation ", ExpressionCell[TraditionalForm[eqns]], " has the following solutions: ", ExpressionCell[Row[vars /. NSolve[eqns, vars], ", "]]}], "Text"]

In[2]:= documentSolve[x^3 + x == 1, x]

Out[2]= [image]
```

### Properties & Relations (2)

``TextCell`` and ``ExpressionCell`` format contents differently:

```wl
In[1]:= CellPrint[{TextCell["abcde", "Text"], ExpressionCell["abcde", "Text"]}]
```

abcde

"abcde"

---

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

```wl
In[1]:= CellPrint[{TextCell[Sqrt[x], "Output"], ExpressionCell[Sqrt[x], "Output"]}]

Out[1]= Sqrt[x]

Out[1]= Sqrt[x]
```

### 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:

```wl
In[1]:= TextCell["abcde", CellDingbat -> "◆", CellLabel -> "Example"]

Out[1]= TextCell["abcde", CellDingbat -> "◆", CellLabel -> "Example"]

In[2]:= TextCell["abcde", CellDingbat -> "◆", CellLabel -> "Example"]//CellPrint
```

Example abcde

## See Also

* [`Text`](https://reference.wolfram.com/language/ref/Text.en.md)
* [`Row`](https://reference.wolfram.com/language/ref/Row.en.md)
* [`TextGrid`](https://reference.wolfram.com/language/ref/TextGrid.en.md)
* [`ExpressionCell`](https://reference.wolfram.com/language/ref/ExpressionCell.en.md)
* [`CellGroup`](https://reference.wolfram.com/language/ref/CellGroup.en.md)
* [`CellPrint`](https://reference.wolfram.com/language/ref/CellPrint.en.md)
* [`Cell`](https://reference.wolfram.com/language/ref/Cell.en.md)
* [`CreateDocument`](https://reference.wolfram.com/language/ref/CreateDocument.en.md)
* [`NotebookImport`](https://reference.wolfram.com/language/ref/NotebookImport.en.md)

## Related Guides

* [Notebook Document Generation](https://reference.wolfram.com/language/guide/DocumentGeneration.en.md)
* [Cell Styling Options](https://reference.wolfram.com/language/guide/CellStylingOptions.en.md)
* [Automated Reports](https://reference.wolfram.com/language/guide/AutomatedReports.en.md)
* [Textual Elements in Notebooks](https://reference.wolfram.com/language/guide/TextualElementsInNotebooks.en.md)
* [`Toolbars`](https://reference.wolfram.com/language/guide/Toolbars.en.md)
* [Text Generation](https://reference.wolfram.com/language/guide/TextConstruction.en.md)

## Related Workflows

* [Programmatically Insert a Cell in a Notebook](https://reference.wolfram.com/language/workflow/ProgrammaticallyInsertACellInANotebook.en.md)
* [Create a Section Heading](https://reference.wolfram.com/language/workflow/CreateASectionHeading.en.md)

## History

* [Introduced in 2007 (6.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn60.en.md) \| [Updated in 2017 (11.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn112.en.md)