Call mePastichemael

Recreating theMoby-Dick first edition
Tony Graham
XML Division
Antenna House, Inc.
tgraham@antenna.co.jp
tony@antennahouse.com@tgraham_antennaMoby-Dick; or, The WhaleCall Me Pastichemael• What and why• Moby-Dick first edition• XML source• Formatting• Results

What and why?
• Test-bed for Automated Analysis feature– Automated analysis quicker than manual checks• First American edition of Moby-Dick:– Frequent EPUB and CSS example– Out of copyright– Text available as XML– Scans of original pages available

Human or machine?
When justification decisions are taken electronically,in the absence of human imagination andjudgement, avoidable irregularities are likely tooccur, to a degree at which even an imperceptive
reader may be distracted. The options of themachine should therefore be more limited thanthose of the man.
Methods of Book Design
Hugh Williamson, 1983

AH Formatter Automated Analysis
••
•
•
•
•
•
•
•

End blank pages
Hyphens on Consecutive Lines
Repeated First or Last Word
Number of Lines Before or After Current BlockPage Widow
Paragraph Widow
RiverUnbalanced SpreadWhite-spaceMoby-Dick used for…
• ‘Requirements for Latin Text Layout andPagination’ examples• Sample EPUBs• Lorem Ipsum alternatives• Coding exercises and challenges

Quest for the Whale• Project Gutenberg– Source for many EPUBs– Not enough detail• Melville Electronic Library– Color page images but TEI XML not public• Wright American Fiction– TEI XML and bitonal page images

Wright American Fiction• Conceived in 2000
• Indiana University (and associated universities)• Over 750,000 pages scanned• OCR• Nearly 3,000 volumes; 1,200 fully encoded• TEI Lite P3 SGML TEI P4 XML  TEI P5 XMLMoby-Dick TEI• Empty <hi rend="i"/> for italic text
– Except ‘foreign’ words like folio• Capital letters for small-caps• No <fw> for headers• Word split over page repeated second half
• Inaccurate punctuation; ¥ instead of £

pastiche n.

an artistic workin a style that
imitates that ofanother work,artist, or period.
v. create apastiche of (anartist or work).

How pastichey?
• Different fonts and font sizes• Different white-space conventions• One-line orphans

How pastichey?
• Hyphen at page end• Pages run shortSuccessive approximations• First draft: rough approximation• Make changes and review– Repeat until satisfactory– Some changes will need to be rolled back
– Likely to be contexts not covered by thedesign

Page image as background
Straighten page image

Set as background<fo:simple-page-mastermaster-name="PageMaster"
page-height="7.375in"
page-width="4.875in"background-image="page-images/MD_Amer_0038.jpg"
axf:background-size="5.21in"background-position="-0.12in -0.15in"
axf:bleed="0.5in"
axf:crop-offset="0.5in">Front matter• Title• Copyright• Dedication• Table ofContents• Fly title• Etymology• Extracts

Title and fly title<docTitle><titlePart>MOBY-DICK;</titlePart><titlePart type="sub">OR, THE
WHALE.</titlePart></docTitle><div type="fly_title"><head>MOBY-DICK; OR, THE WHALE.</head></div>• Ignore markup• Use xsl:analyze-string
and generate FOs

Table of Contents<div type="contents“><pb n="v (Table of Contents) " xml:id="VAC7237-0003"/><head>CONTENTS.</head><list><item>I.—Loomings. <ref target="VAC7237-0013"
rend="right">1</ref></item><item>II.—The Carpet Bag. <ref target="VAC7237-0017"
rend="right">7</ref></item>• Some references to <pb>inaccurate• Table with generated
cross-references

Quotes<cit><q><p>"Very like a whale."</p></q><bibl><title>Hamlet</title>.</bibl></cit>

Process <bibl> children with <p><xsl:template match="q/p"><fo:block><xsl:apply-templates /><xsl:if test="position() = last() andexists(../following-sibling::*[1][self::bibl])"><fo:leader leader-pattern="space"/><fo:leader leader-pattern="space" leader-length.optimum="100%"/><fo:inline-container padding-left="2em" padding-right="0.125in"max-width="80%" text-indent="0"><fo:block text-align="right"><xsl:apply-templates
select="../following-sibling::*[1]/node()" /></fo:block></fo:inline-container><xsl:template</xsl:if>match="bibl[exists(preceding-sibling::*[1][self::q[p]])]"</fo:block>priority="5" /></xsl:template>Body• 135 chapters• One graphic• Inscriptions• Songs• Speeches andstagedirections

Chapter separator

Automatic chapter separator<xsl:templatematch="div[@type = 'chapter'][exists(head[@type = 'sub'] |fw[@type = 'head'])]"><xsl:if
test="exists(preceding-sibling::div[@type = current()/@type])"><fo:block axf:suppress-if-first-on-page="true"
space-after="0.2in"space-after.precedence="force"><fo:external-graphic src="separator.svg" /></fo:block></xsl:if><fo:blockid="{@type}-{count(preceding::div[@type = current()/@type]) + 1}">

<fo:blockid="{@type}-{count(preceding::div[@type = current()/@type]) + 1}">
<fo:block-container
axf:baseline-grid="none"
axf:baseline-block-snap="none"
keep-together.within-page="always"
keep-with-next.within-page="always"
space-before="{if (exists(preceding::div[1][@type = 'chapter']))then '0.5in'
else '0.72in'}"space-before.conditionality="retain"><xsl:apply-templates select="head" /></fo:block-container><xsl:apply-templates select="* except head" /></fo:block></xsl:template>Whale-size footnotes

Duplicate footnotes on same page
• XML repeatsfootnote text
• XSL 1.1 won’tmerge• axf:suppress-duplicatefootnote

Baseline grid• “Show-through” reduces
legibility• Align lines on front andback• Resume after irregularlines, titles, etc.

axf:baseline-grid• Set common grid
• Blocks can set
own grid or nogrid at allCommon and specific grids
fo:page-sequence

fo:block<xsl:template match="body"><fo:page-sequencemaster-reference="PageMaster"
initial-page-number="1"
axf:baseline-grid="root"><xsl:call-template
name="static-content" /><fo:flow
flow-name="xsl-region-body“
hyphenate="true"
text-align="justify"><xsl:apply-templates /></fo:flow></fo:page-sequence></xsl:template><xsl:template match="body//q"><fo:blocktext-align="center"text-indent="0"
space-before="0.25lh"
font-size="7pt"line-height="9pt"
axf:baseline-block-snap="before margin-box"
axf:baseline-grid="new"><xsl:apply-templates /></fo:block></xsl:template>Handling quotes<p>"Do you is all sharks, and by natur wery woracious, yet I
zay to you, fellow-critters, dat dat woraciousness—'top
dat dam slappin' ob de tail! How you tink to hear, 'spose you
keep up such a dam slappin' and bitin' dare?"</p>• Use regular expression to match on
irregular words

Consecutive em-dashes• Multiple em-dashes• Font includes space• Replace with single
characters<xsl:variable
name="text"
select="replace($text, '&mdash;&mdash;&mdash;', '&#x2E3B;')"
as="xs:string" /><xsl:variablename="text"
select="replace($text, '&mdash;&mdash;', '&#x2E3A;')"
as="xs:string" />Headers<div type="chapter"><head>CHAPTER XXIX.</head><head type="sub">ENTER AHAB; TO HIM, STUBB.</head><fw type="head" place="top-centre">ENTER AHAB.</fw>• Choose content of <fw>, if present<fo:marker marker-class-name="Chapter-Title"><xsl:apply-templates
select="(fw[@type = 'head'], head)[1]/node()"mode="marker" /></fo:marker>

Forme work
• <fw> for “formework”• forme: a body of typesecured in a chase forprinting“Compositor”, Stephen Hampshire (CC BY 2.0)

Headers• Headers are centered• Except when they’re not• Push long headers awayfrom number with
axf:overflow-align="end"Moby-Dick; or, The WhaleSummary• Still a work in progress• Moby-Dick stylesheet
https://github.com/AntennaHouse/moby-dick• Moby-Dick TEI XML
https://github.com/AntennaHouse/moby-dick-tei• Automated analysis is cool, too
https://www.antenna.co.jp/AHF/help/en/ahfanalyzer.html

Questions?

Tony Graham
XML Division
Antenna House, Inc.
tgraham@antenna.co.jp
tony@antennahouse.com@tgraham_antenna

Resources••••

Moby-Dick stylesheet
https://github.com/AntennaHouse/moby-dickMoby-Dick TEI XML
https://github.com/AntennaHouse/moby-dick-tei
AH Formatter
https://www.antennahouse.com/formatter-v7
AH Formatter Automated Analysis
https://www.antenna.co.jp/AHF/help/en/ahf-analyzer.html

Resources•••

IU Digital Library Program. Moby-Dick, or, The Whale. Melville,
Herman, (1819–1891).
http://webapp1.dlib.indiana.edu/TEIgeneral/view?docId=wright/VAC7237&brand=wright
IU Digital Library Program. Moby Dick, or, The Whale.
http://dogwood.dlib.indiana.edu:8080/xubmit/rest/repository/wright/VAC7237.xml
IU Digital Library Program. Wright American Fiction. Indiana
University.
http://webapp1.dlib.indiana.edu/TEIgeneral/welcome.do?brand=wrightResources••“Compositor”, Stephen Hampshirehttps://flickr.com/photos/stephenhampshire/3337704597
CC BY 2.0
https://creativecommons.org/licenses/by/2.0/