tei:p (paragraph) “marks paragraphs in prose” (http://www.tei-c.org/P4X/ref-P.html). For a discussion of how to encode paragraphs in a variety of structural languages, see Paragraph.

Subclasses and attributes

There are no required attributes or subclasses. @type or @rend may be used to distinguish among different types of paragraphs, e.g.


See the TEI Guidelines for a discussion of available attributes.


Paragraphs may be formatted in a variety of different ways depending on the conventions of the medium and aesthetic sensibility of the text designer. Some common formattings include:

* Block style (justified on one or both sides; first line not indented; 1 line space above and below). This is a common display for text on screen)
* Indented style (justified on one or both sides; first line indented slightly; no leading or trailing space). This is common in print contexts.
* Hanging first line (justified on one or both sides; first line extended slightly into the left-margin; with or without no leading or trailing space). This is common in bibliographies.


If you are attempting to display a TEI XML document directly in a commercial browser, the following CSS fragments can be used to style the element:

Block style

p {

Indented style

p {

Hanging first line

p {

Justified left and right margins

All three of the above fragments will produce right-justified text (i.e. aligned down the left margin [except for the first line, in the Indented style] with a “ragged” right margin). To justify both margins, you can add the following line to any style:



Conversion to XHTML

If you are going to convert your TEI paragraph to XHTML, the basic template looks like this

<xsl:template match="p">

As noted in the Paragraph, however, TEI and (X)HTML have a different model for paragraphs. This becomes an issue with typographically complex paragraphs, particularly those containing internal block quotations, tables, lists, or figures. The specific details of the template used to do this will vary depending on the precise coding of the input XML document. The following example is based on the markup used for articles in the DM journal, where block quotes are encoded as follows (”Lorem ipsum” from the Lorem ipsum generator):

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Nam id lorem. Nulla velit dolor, pulvinar id, dignissim et, lobortis et, eros.
Quisque pretium turpis luctus dui. Praesent dapibus. Nunc tincidunt orci eu arcu.
<p>Curabitur mollis, magna eu ultricies sagittis, justo mi
commodo tellus, sit amet aliquam pede dui sed nunc. Aenean at eros. Aenean eu
quam vel massa laoreet suscipit.</p>
Nunc arcu quam, congue ac, congue et, ullamcorper a, leo. Maecenas dapibus,
sapien non semper semper, neque enim dapibus ligula, in cursus quam dolor sed nunc.
Nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>

Converting this to valid XHTML requires the following the XSLT (version 2.0):

<xsl:template match="p">
<xsl:for-each-group select="node()"
group-adjacent="self::quote[p] or self::table or self::list">
<xsl:when test="current-grouping-key()">
<xsl:apply-templates select="current-group()"/>
<xsl:copy-of select="current-group()"/>

(Based on the example Grouping Alternating Sequences of Elements in the XSLT 2.0 Specification).


The differences between the TEI and XHTML models for paragraph were the subject of an extended discussion on TEI-L, the mailing list of the Text Encoding initiative. To follow the thread, begin with: http://listserv.brown.edu/archives/cgi-bin/wa?A2=ind0501&L=tei-l&F=&S=&P=20212 http://listserv.brown.edu/archives/cgi-bin/wa?A2=ind0501&L=tei-l&F=&S=&P=20212.

The XSLT method proposed here requires XSLT 2.0. A partial solution for XSLT 1.0 was posted by Michael Beddow as part of the tei-l thread: http://listserv.brown.edu/archives/cgi-bin/wa?A2=ind0501&L=tei-l&F=&S=&P=24080 http://listserv.brown.edu/archives/cgi-bin/wa?A2=ind0501&L=tei-l&F=&S=&P=24080.

Related topics

* How do I encode…
* Paragraph

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s