TEI general structure

This is a very limited example to illustrate the nesting of some important TEI tags.
Click on tag names to expand them. To expand an entire sub-tree, hold down any key while clicking on the tag name.
This Javascript application was first developed by Martin Holmes at Unversity of Victoria. (Used with permission.) I changed some of the description and added a few.
Marcus Bingenheimer, Oct.2006

TEI
teiHeader
fileDesc
titleStmt
title
Title of the digital document
author
name
Name of author 1
author
name
Name of author 2....
respStmt
resp
Marked up by
name
Name of person responsible for the markup...
publicationStmt
p
Where is this electronic text published?
sourceDesc
bibl or p
What was the (paper) source(s) for this electronic edition? Full <bibl> preferable to a <p> description.
encodingDesc
projectDesc
Description of your project.
editorialDecl
Provides details of editorial principles and practices applied during the encoding of a text. This is the place to explain how you have applied markup to what why.
profileDesc
(text-profile description) provides a detailed description of non-bibliographic aspects of a text, specifically the languages and sublanguages used, the situation in which it was produced, the participants and their setting.
revisionDesc
list
item
Description and date of changes (may include date tag)
item
Description and date of changes (may include date tag)
text
front
docTitle
titlePart
Title of the document
docAuthor
name reg="last, first"
Author's name
titlePart type="affil"
Affiliation of the preceding author
docAuthor
name reg="last, first"
Author's name
body
div0

This is an example for numbered divisions. TEI allows for div0 to div7. In the following div0 however only div0 to div2 are shown. For deeper nesting use unnumbered divs or change the schema.

Within div sections, the following tags can be used (among many others):

head
Heading for this section (level 0)
p

The p tag is used for normal paragraphs. It can contain the following tags (among many others):

title
The title tag is used to mark something as a title (of a book, article etc.) Different types of title are distinguished by the level attribute, which can have values of m, a, j, u, and s, as explained in the TEI Guidelines.
emph
The emph tag is used to mark emphasis. It will normally be rendered in italics.
hi
The hi tag can be used express common forms of formatting, specified through the rend attribute, which could have e.g. the values bold, italics, underline, and code.
foreign
The foreign tag is used to mark text in a language different from the surrounding text. The xml:lang attribute is used to specify the language, using ISO language codes.
cit

The cit can be used for quotations where a bibliographical reference is given.

q
The q tag encloses the quoted text. Quotation marks can be rendered by the stylesheet or directly inserted.
bibl
The bibl tag marks the bibliographical citation for the quote.
ab

The ab tag ("anonymous block") is a generic tag used for creating a block of text. It can contain all the same tags as the p tag. Its equivalent on the inline level is the seg element.

table

Very simple tables are supported; these consist of a head (for the caption), rows, and cells. Table tags have these attributes: rows (number of rows in the table), cols (number of columns) and rend.

head
The head tag contains a simple caption for the table.
row

Row elements may use the attribute role="label", which causes them to be formatted with bold, centred text and a grey background, to make column headers. Without this setting, the cells in a row have left-aligned, normal text on a whte background.

cell
Contents of the cell (normally just text).
cell
Contents of a cell. Cell contents can be marked up in paragraphs, and can use any of the elements allowed in paragraphs.
list

List elements can be nested to any level, and can have various types, specified through the type attribute. Possible value could include "unordered" (bullets), "ordered" (1., 2., 3.), "lower-alpha" (a), b), c)), "lower-roman" (i., ii., iii.).

item

A list can contain any number of item elements, usually containing plain text, but anything that appears as a child of a p tag can also appear in a list item.

figure

The figure tag is used to embed images. TEI now supports embedding of SVG graphics. ROMA provides a Relax NG schema that validates SVG namespace elements within <figures>, instead or in conjunction with <graphic>.

head

The head tag contains the image caption.

graphic

The URL of the image file can be given on the target attribute of the graphic tag.

figDesc

The figDesc tag contain a description of the image. It corresponds roughly to the ALT attribute in HTML.

div0

This div0 shows the nesting of three levels of text in a complex structure. As well as the usual paragraphs, blocks, tables, etc. as detailed above, the div0 tag can contain div1 tags.

head
Heading for this section (level 0)
div1
head
Heading for this section (level 1)
As well as the usual paragraphs, blocks, tables, etc. as detailed above, the div1 tag can contain div2 tags.
div2
head
Heading for this section (level 2)
The div2 tag contains paragraphs, blocks, tables, etc. as detailed above.
back
Contains back matter, e.g. indices, appendices, or bibliographies. Here an example how to construct a bibliography.
div type="Bibliography"

The bibliography consists of a listBibl element containing a biblStruct element for each cited item.

head
Bibliography
listBibl
biblStruct
biblStruc is more analytic and exact. If you need a looser framework use bibl.
analytic

If the text is an article, book chapter etc., then its title and authors will be given in an analytic section. Otherwise, all the details will appear in the monogr tag.

author
The author's name. This tag always has a reg attribute with the name in the form "last, first", to aid sorting and searching. In the tag itself, the name is shown "last, first" if it is unique or the first of a list; otherwise it is rendered "first last". This makes it easier to format the output.
title
Title of the article or chapter, with the appropriate level attribute.
monogr

The monogr tag contains all the publication information of the item, or of the book or journal which contains the article or chapter specified in the analytic element above.

author OR editor
The author's or editor's name. There can of course be as many of these tags as are required. This tag always has a reg attribute with the name in the form "last, first", to aid sorting and searching. In the tag itself, the name is shown "last, first" if it is unique or the first of a list; otherwise it is rendered "first last". This makes it easier to format the output.
title
Title of the monograph, with the appropriate level attribute.
biblStruct
etc....