Paragraph

From DM

Jump to: navigation, search

The Paragraph[1] is a basic rhetorical and visual structural unit of prose texts.

Most (probably all) markup languages have a relevant element, although the precise definition and syntax for the element can vary, in some cases significantly.

Contents

Source documents

Print

In print, paragraphs begin with a new line and are usually indented. Exceptions include the first paragraph after section headings (which are commonly not indented in printed sources) and electronic documents (in which paragraphs are commonly separated by a blank line rather than indented).

In addition to running text, paragraphs may contain other material such as block quotations, tables, figures, images, and the like. These commonly begin on a new line and often are indented or centered. If the paragraph resumes after this inserted material, the continuation begins on a new line and is never indented (Example).

The insertion of elements such as block quotations, tables, and the like are the most significant difficulty likely to be encountered in a structural encoding of paragraphs. Such insertions are treated very differently in several common markup languages.

Other paragraph-like structural units include items in a list and lines and stanzas of verse. Depending on the markup language, these may be encoded using a paragraph element or some other more specific element.

Manuscripts

Paragraphs in the typographical sense of a "block of text" are less commonly found in manuscripts, though they do occur, often preceded by a pilcrow-like mark (¶).

Paragraphs in the rhetorical sense, however, are ubiquitous. They may be marked off as sections, chapters, books, or treated as items in a list.

Structural encoding

Most structural languages use an element called <p>, <para>, or the like to encode paragraphs. The main differences involve how they treat paragraph-internal lists, tables, figures, and block quotations.

(X)HTML

In strict (X)HTML, paragraphs are encoded using the following structural element:

<p>: Paragraph

Other elements used to encode special types of paragraphs and paragraph-like constructions are

<blockquote>: Block quotation
<pre>: Preformatted text
<ol>: Ordered (numbered) list
<ul>: Unordered (bulleted) list
<li>: List item

Line breaks can be forced using

<br/>: Line break

Other block-type elements

<h1>: First level heading
<h2>: Second level heading
<h3>: Third level heading
<h4>: Fourth level heading
<h5>: Fifth level heading
<h6>: Sixth level heading
<table>: Table
<tr>: Table row

In (X)HTML <p> is a block-level element. This means it cannot contain other block-level elements such as <blockquote>, <pre>, or <h1> through <h6>. An important result of this restriction is that complex paragraphs involving internal block quotations and subsequent text cannot be encoded as a single logical paragraph. This contrasts particularly with the equivalent element in TEI XML. Transformations from strictly encoded TEI paragraphs to XHTML paragraphs, therefore, can be quite complicated.

Most visual commercial browsers render paragraphs by default as right-justified blocks separated from preceding and following text by a blank line. The appearance of this and most other elements can also be controlled by external (e.g. CSS stylesheets. See below #Stylesheets.

TEI

In TEI XML (P4), paragraphs most commonly are encoded using the following structural element:

 <p>: Paragraph

Line breaks (which should not be used for dividing paragraphs) are encoded using

<lb>: Line break

In addition to these elements, TEI also has a number of elements for more specialised (or abstract) paragraph-like constructions. These fall into two main classes:

  1. Elements that cannot be found within paragraphs
  2. Elements that can be found instead of or within paragraphs.

Elements that cannot be found within paragraphs

The following is a partial list of elements that can be used instead of <p> to encode paragraph-like structures, but may not occur withing <p>:

<ab>: Anonymous block
<argument>: Argument or abstract
<byline>: Byline
<epigraph>: Epigraph
<head>: Head (e.g. section title)
<l>: Line (verse)
<lg>: Line group (e.g. stanza)
<sp>: Speech (e.g. in play)
lt;witList>: Witness list (textual apparatus)

Elements that can be found instead of or within paragraphs

The following is a partial list of elements that may be used either instead of or within <p> to encode paragraph-like structures:

<bibl>: Bibliographic item
<biblFull>: Complete bibliographic item
<biblStruct>: Structured bibliographic item
<castList>: Cast list
<label>: Label
<item>: Item (in a list)
<row>: Row (in a table)
<list>: List
<listBibl>: Bibliographic List
<note>: Label
<table>: Label
<q>: Quotation
<quote>: Quotation

In TEI, <p> is a | "chunk"-level element. This means it can contain | "phrase"- and "inter"- level elements, including elements for structures like block quotations or long code fragements that cannot be included in the equivalent XHTML element. Transformations from strictly encoded TEI paragraphs to XHTML paragraphs, therefore, can be quite complicated.

Most commercial browsers do not have a default stylesheet for this or any other TEI element (although they may render it as the XHTML equivalent). Its display characteristics, therefore, must be controlled by stylesheets, either directly (i.e. using a formatting style language such as CSS or XSL-FO or indirectly, after conversion to XHTML for display.

CSS

Several CSS properties control the appearance of paragraph-like elements:

display

display is used to control whether the element is displayed as a block, in-line, etc.

The relevant value for most paragraphs is

block : places a hard return before and after element

Other permissible values include

inline : displays text without breaks before or after
list : displays text as indented block
none : prevents element from displaying at all

block is the default value for XHTML <p> in most commercial browsers.

text-align

text-align controls justification and alignment

Relevant values for paragraphs are

left : aligns (justifies) text down the left hand margin; right margin is ragged
right : aligns (justifies) text down the right hand margin; left margin is ragged
center : centers text down the middle of the display area; both margins are ragged
justify : aligns text down both margins except for in the last line, which
          is left justified. Neither margin is ragged.

left is the default value for XHTML <p> in most commercial browsers.

text-indent

text-indent controls indentation.

This property takes a relative or absolute value (e.g. 3em; 10%; 12pt). Positive values 'indent' the first line (i.e. move it to the right); negative values create a 'hanging indent' (i.e. move the first line into the left margin).

0 or none is the default value for XHTML <p> in most commercial browsers.

margin

margin (esp. margin-top, margin-bottom) controls the space between adjacent elements.

This property takes a relative or absolute value (e.g. 3em; 10%; 12pt). It is important to remember that margin controls the distance between adjacent elements or between the edge of the display area and an element, not the distance between individual lines within an element (see #line-height). 1

1 em is the default value for margin-top and margin-bottom for <p> in most commercial XHTML browsers (i.e. equivalent to an extra line above and below).

line-height

line-height controls the distance between lines within an element.

This property takes an absolute or relative length (e.g. 1.2 em; 12 pt), multiple of the font size (e.g 1.2 [= 1.2 × the base font size]), or percentage of the font-size (e.g. 120%). In each case, these are minimum values: if the element contains material that is taller than the space provided, the line height will be adjusted to fit.

The default value for line-height for <p> in most commercial XHTML browsers is probabably between 1 to 1.2 (i.e. equivalent to 1.0 to 1.2 times the base font size).

Example

The following example formats an XHTML <p> element to display in a manner similar to an indented print paragraph:

p {
  display: block;
  text-align: justify;
  text-indent: 1em;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.2
}

XSLT

There is no relevant XSLT category.

XSL-FO

(unknown)

LaTeX

(unknown)



Notes

1 Between adjacent elements, the margin is "collapsed". This means that the distance between elements is equal to the widest margin, rather than the sum of the two margins. E.g. if an element with a bottom margin of 1 em is immediately above an element with a top margin of 2 em, the distance between the two elements is 2 em, not 1 em + 2 e

Personal tools