University of Calgary Textual Editing Workshop


Jeffrey C. Witt (Loyola University Maryland) | @jeffreycwitt


2018 University of Calgary, March 9th

Slide Deck: http://jeffreycwitt.com/slides/2018-03-09-calgary-tei

A place for shared files: http://bit.ly/2wi4acf

# Schedule * 8:30am - 9:00 Breakfast and Introductions * [9:00-10:30 - Session 1](#session-1) * [Introduction and Goals](#/3) * [Visual vs. Semantic Encoding](#/4) * [Introduction to XML](#/5) * [Styling and Presentation](#/6) * [10:45-12:30 - Session 2](#session-2) * [What is TEI and Why Do We Need It](#/8) * [Encoding and Styling with TEI](#/9) * Lunch 12:30-1:30 * [1:30-2:30 - Session 3](#session-3) * Examples of Publications with TEI * [Publishing an Edition with TEI](#/11) * [2:30-4:30pm - Session 4](#/12) * [Advanced Topics in TEI](#/13) * [Wrap Up Discussion](#/18)
# Session 1 [Back to Schedule](#schedule)
# Goals [Back to Schedule](#schedule)
### 1. To understand Semantic Encoding as distinct from Visual Encoding a. To be able to weigh the pros and cons of each method and to accurately assess the additional stages required by each approach to achieve different end goals.
### 2. To understand what XML and TEI are and how to use these technologies a. To be able to understand the relationship between XML and semantic encoding b. To be able to understand the relationship between XML and TEI c. To understand the relationship between TEI and TEI Customizations
### 3. To be able to encode a document in XML and TEI and to understand the basic rules of XML encoding.
### 4. To be able to do simple styling of an XML or TEI document in order to create different “presentations” of that document a. To understand various options for presenting and representing an XML/TEI text b. To have a sense of the various tools available to help with the presentation of an XML/TEI document.
### 5. To be able to publish a simple TEI edition to the web
### 6. To have an understanding of “advanced” textual encoding practices. a. To understand how to do basic encoding of common features of a critical edition, such as a critical apparatus, an apparatus fontium, diplomatic transcriptions, segment classification. b. To know what resources are available both to guide your encoding and to help you go further.
# Visual versus Semantic Encoding [Back to Schedule](#schedule)
#### Activity 1) With a pen or pencil, draw a box around examples of these data types and give each data type a “label”. 2) Figure out how many different kinds of data are on this page. 3) Identify or explain how these data types are communicated to you as a human reader. 4) Identify what kinds of relationships between data types are communicated and how this is communicated. Question: Were there any data types or relationships presented in ambiguous or unclear ways? What made these features ambiguous?
# Introduction to XML ## What is XML and How to Use It [Back to Schedule](#schedule)
## What is XML XML stands for eXtensible Markup Language and it is a specific technology or tool designed to allow us to semantically describe a text, document, or any kind of structured information.
## Advantages of XML 1. It is a well established technology with a long history 2. It is well supported. 3. It is system independent.

Basic Rules of XML

XML semantically identifies pieces of data using opening and closing tags which are enclosed with angle brackets.

<div>This is a division</div>

<div>This is a paragraph </div>

Tags cannot be cross-nested.

wrong

<div>Overlap is <emphasis>not allowed!</div></emphasis>

correct

<div>This is <emphasis>correct</emphasis></div>

Tags must be either siblings of another set of tags or children of a set of tags.

In XML talk, all tags are called 'elements'

In Aristotle talk, elements are like subjects that can take on differentiating accidents.

In addition to containing text and other elements, elements can take on "attributes".

<quote type="paraphrase">This a paraphrased quotation </quote>

<div type="articulus">This is an article division </div>

All elements must be contained inside one Root Element

The result of following these rules is a document whose content is nicely organized into a tree structure.

Activity

Use Oxygen to begin encoding our sample texts

To start a new file, open oxygen, select file->new, select "xml document"

Then start encoding. Remember you can create your own tags to describe your data. Just follow these basic rules: https://www.w3schools.com/xml/xml_syntax.asp

# Styling and Presentation [Back to Schedule](#schedule)
## Styling with Cascading Style Sheets (CSS) Because we have encoded our text semantically, we can now use this logic to programmatically style and restyle our text. Styles can be added by linking a stylesheet to our XML document like so:
      <?xml-stylesheet type="text/css" href="mystyles.css"?>
    

CSS Treats every element as block

## Each block can be modified with an number of properties using the CSS Syntax ![css-syntax](https://www.w3schools.com/css/selector.gif) ```css body { display: block; margin: 10px; border: 1px black; padding: 2px; color: blue; } ```
### Activity 1. In Oxygen, open a new css file (file->new->css). 2. Save the file as `mystyles.css`. 3. Add a link to this file at the top of your xml document like so: ` <?xml-stylesheet type="text/css" href="mystyles.css"?>` 4. Use this resource [https://www.w3schools.com/css/default.asp](https://www.w3schools.com/css/default.asp) to start adding styles to your css stylesheet. 5. Open your xml document in your browser to see how your styles affect your document.
# Session 2 [Back to Schedule](#schedule)
# What Is TEI and Why Do We Need It? [Back to Schedule](#schedule)

Question: Where do the element and attribute names come from?

How do we know what elements or attributes we can use?

The X in XML stands for eXtensible

This means that XML actually does not specify any set of tags or element names. Anyone can make up their own set of elements and use them however they like.

Extensibility provides a lot flexibility

It allows different industries and fields to create tags that meet their needs and their data.

Extensibility can also cause confusion

If everyone can just make up their own tags, we can create confusion about what different tags mean and the datatypes they are encoding.

Someone might choose to tag something as <paragraph> and another person might choose to tag something as <para> and a third person might choose <p>.

How do we avoid this confusion?

Enter TEI

TEI: a predefined set of elements designed by and for humanities scholars and textual editors

About TEI and the TEI Guidelines

Activity

Explore the TEI Guidelines http://www.tei-c.org/release/doc/tei-p5-doc/en/html/index.html

Tutorials: http://teibyexample.org/


Question: What element should I use to encode a line in a poem?

Question: What element should I use to encode a new page and or a new column in a manuscript?

Question: What element (or elements) should I use to add an image?

The Core Structure of a TEI Document

See: http://teibyexample.org/modules/TBED01v00.htm?target=generalstructure#generalstructure

<TEI>
<teiHeader>The place for information about the author, the editor, publisher, sources used, and other types of metadata</teiHeader>
<text>
<body> The place for division and paragraph elements and of course the text itself </body>
</text>
</TEI>

The Core Structure of the TEI Header

See: http://teibyexample.org/modules/TBED02v00.htm

<teiHeader>
<fileDesc>
<titleStmt>
<title>Title of Document</title>
</titleStmt>
<publicationStmt>
<p>Simple statement about publisher here</p>
</publicationStmt>
<sourceDesc>
<p>Description of source being represented in tei</p>
</sourceDesc>
</fileDesc>
</teiHeader>

The Core Prose Structure

See: http://teibyexample.org/modules/TBED03v00.htm?target=structure#structure

<body>
<div>
<head>header of section</head>
<p>Text goes here</p>
<p>More text goes here</p>
</div>
<div>
<head>header of section</head>
<p>Text goes here</p>
</div>
</body>
# Encoding and Styling with TEI [Back to Schedule](#schedule)

Creating a New TEI File with Oxygen

In Oxygen: select new->Framework Templates->TEI P5->All

### Activity: Use the texts we worked with earlier and begin to encode them according to the TEI guidlines, working to make a valid TEI document. Use the guidines to look up new elements: http://www.tei-c.org/release/doc/tei-p5-doc/en/html/index.html and http://teibyexample.org/ Once, you have a valid document, create a new style sheet, and create a new presentation of your document. Experiment with conversions of your file using Oxgarage: [http://www.tei-c.org/oxgarage/](http://www.tei-c.org/oxgarage/)
# Session 3 [Back to Schedule](#schedule)
# Publishing an edition online with github pages [Back to Schedule](#schedule)
## Create a github account [http://github.com](https://tei-web-editor.herokuapp.com/)
## Head over to the TEI-Web-Editor ### Login with your new github credentials [https://tei-web-editor.herokuapp.com/](https://tei-web-editor.herokuapp.com/)
### Fork the TEI SIMPLE REPOSITORY 1. Open 2. Select the Simple TEI Edition Link 3. Create a new branch called "gh-pages" 4. Open the file xml/index.xml 5. Add a new pargraph 6. Save your changes 7. View your file on the web at: [you-user-name].github.io/simple-tei-edition
# Session 4 [Back to Schedule](#schedule)
## TEI Customizations and Advanced TEI Topics 1. Diplomatic Transcriptions 2. Recording Names, Places, Interpretations, et alia 3. Recording Citations (Apparatus Fontium) 4. Recording Variations (Apparatus Criticus) [Back to Schedule](#schedule)
### Diplomatic Transcriptions TEI Guidelines: [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/PH.html#PHST](http://www.tei-c.org/release/doc/tei-p5-doc/en/html/PH.html#PHST) Question: Why isn't TEI always enough?
### TEI Customizations EpiDoc: [http://www.stoa.org/epidoc/gl/latest/app-alltrans.html](http://www.stoa.org/epidoc/gl/latest/app-alltrans.html) LombardPress-Schema Diplomatic: [http://lombardpress.org/schema/docs/diplomatic/](http://lombardpress.org/schema/docs/diplomatic/)]
### Activity Using Page 2 of the "Billy Bud" manuscript, in the "examples" folder -- [https://drive.google.com/open?id=0ByU6rbuuJtxGSFFYbjdWZjg1VzQ](https://drive.google.com/open?id=0ByU6rbuuJtxGSFFYbjdWZjg1VzQ) -- use one or all of the following guidelines to encode a diplomatic transcription of the manuscript page. - [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/PH.html#PHST](http://www.tei-c.org/release/doc/tei-p5-doc/en/html/PH.html#PHST) - [http://www.stoa.org/epidoc/gl/latest/app-alltrans.html](http://www.stoa.org/epidoc/gl/latest/app-alltrans.html) - [http://lombardpress.org/schema/docs/diplomatic/](http://lombardpress.org/schema/docs/diplomatic/)
### Recording Names, Places, Interpretations, et alia TEI has different elements to help you group different types of text classifications.
### For example: * [listPerson](http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-listPerson.html) - person * [listBibl](http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-listBibl.html) - bibl * [taxonomy](http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-taxonomy.html) - category * [interGroup](http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-interpGrp.html) - interp These lists can be added in various places within your TEI document.
#### These classifications -- with the help of referring attributes -- can be used to characterize various elements in your text. For example: ```xml <listPerson> <person xml:id="Bob1"> <persName>Bob Smith</persName> </person> </listPerson> <!-- --> <p>Text dicussion a <name ref="#Bob1">Mr Smith</name></p> ```
#### Style these classifications with a CSS selector ```css-syntax name[ref="#bob1"]{ background-color: yellow; } ```
### Apparatus Fontium Using the `<cit>` element is a common way to group a quotation with bibliographic reference. For example: ```xml <cit> <quote>Quoted text</quote> <bibl>Augustine, Book V</bibl> </cit> ``` See [http://lombardpress.org/schema/docs/critical/#apparatus-fontium](http://lombardpress.org/schema/docs/critical/#apparatus-fontium)
### Activity Create your file in Oxygen and upload to [http://ciham-digital.huma-num.fr/](http://ciham-digital.huma-num.fr/) and see what happens! Or ...
Using the [TEI-WEB-EDITOR](https://tei-web-editor.herokuapp.com/) that we worked with earlier... * Open the file called: `/xml/lbp-1.0.0-critical-edition.xml` * Follow the LombardPress-Critical Schema for creating an apparatus fontium [http://lombardpress.org/schema/docs/critical/#apparatus-fontium](http://lombardpress.org/schema/docs/critical/#apparatus-fontium) * Then view your file on githubpages at [your-username].github.io/simple-tei-edition/critical.html. * Hover over the places you've marked with a citation, and view those citations in the bottom of the browser.
### Apparatus Criticus Using the `<app>` a variation in witnesses can be recorded as follows: ```xml <app> <lem>fides</quote> <rdg wit="#V">fidei</bibl> </cit> ``` See the TEI Guidelines: [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/TC.html](http://www.tei-c.org/release/doc/tei-p5-doc/en/html/TC.html) See the Lbp-Schema for an example of a customization of these guidelines [http://lombardpress.org/schema/docs/critical/#apparatus-criticus](http://lombardpress.org/schema/docs/critical/#apparatus-criticus)
### Activity Create your file in Oxygen and upload to [http://ciham-digital.huma-num.fr/](http://ciham-digital.huma-num.fr/) and see what happens! Or ...
Using the [TEI-WEB-EDITOR](https://tei-web-editor.herokuapp.com/) that we worked with earlier... * Open the file called: `/xml/lbp-1.0.0-critical-edition.xml` * Follow the LombardPress-Critical Schema for creating an apparatus fontium [http://lombardpress.org/schema/docs/critical/#apparatus-criticus](http://lombardpress.org/schema/docs/critical/#apparatus-criticus) * [more instructions on next slide]
### Activity Continued * Then view your file on githubpages at [your-username].github.io/critical.html. * Hover over the places you've marked with a citation, and view those citations in the bottom of of the browser window. * To see, a print out view. Save a copy of your file to your desktop. Make sure it validates in Oxygen and then upload for conversion at [http://print.lombardpress.org](http://print.lombardpress.org)
# Wrap Up and Discussion [Back to Schedule](#schedule)