TEI Best Practices

From DPWiki
Jump to navigation Jump to search

Note: PGTEI is no longer used at DP. Information on this page may be out of date.

Here is the on-going results of the Best Pratices discussion in the forums.

See the final example TEI doc at the end.

Title Page

Two ways to create:

(easy) <divGen type="titlepage" />

(hard) Create a manual title page.

TEI Example Doc

<?xml version="1.0" encoding="utf-8" ?>

<!DOCTYPE TEI.2 SYSTEM "http://www.gutenberg.org/tei/marcello/0.4/dtd/pgtei.dtd">

    <titleStmt><title>Bluntman and Chronic</title>
      <author>Holden McNeil</author>
      <author>Banky Edwards</author>


  <divGen type="pgheader" />

<titlePage rend="text-align: center; page-break-before: right">

    <titlePart type="main" rend="font-size: xx-large">Bluntman and Chronic</titlePart><lb />
    <titlePart type="sub" rend="font-size: x-large">(Bonus Points If You Get This Reference)</titlePart>

  <byline rend="margin-top: 5; margin-bottom: 5">By <docAuthor>Holden McNeil</docAuthor> and 
    <docAuthor>Banky Edwards</docAuthor>

  <docImprint><name>New York</name><lb />
    <name>View Askew Publishers</name><lb />


<div rend="page-break-before: right">
  <index index="pdf" />
  <head rend="text-align: center">Contents</head>
  <divGen type="toc" />



<div rend="page-break-before: right">
<index index="toc" level1="Chapter 1 - Chapters, Sections and Other Major Divisions in a Text" />
<head rend="text-align: center">Chapter 1</head>
<head type="sub" rend="text-align: center">Chapters, Sections and Other Major Divisions in a Text</head>

<p>Instead of using various numbers of blank lines to specify whether something is a chapter break/section/etc., TEI uses 

<div></div> markup to mark a section of text as a separate grouping.  By nesting these <div> markups, 

you can specify sections within chapters within parts ...</p>

<p>Note the "thought-break" below.  You can control the way this renders with the rend attribute.</p>

<milestone unit="tb" rend="stars: 5" />

<p>In this case, we used 5 asterisks.  You can also specify a blank line (default) or a horizontal rule of n% page 


  <index index="toc" />
  <head rend="text-align: center">Sub-section to Chapter 1</head>

  <p>By nesting this section inside the previous section, it will appear as a subsection of Chapter 1.  Theoretically, 

this nesting effect could go on into infinity.  I think the farthest nesting I've run across in practice is about 4 






The HTML results can be viewed here: [1]