Text Encoding Initiative logo and banner

Text Encoding Initiative

 

TEI XSL Customization Handbook


Contents

Introduction

This section describes how to produce a customization of the TEI stylesheets. It describes all the parameters which you can set, the templates which are designed to be changed, and the empty templates provided into which you can add your own code.

There are 13 areas for customization. In most cases there are parameters and templates which are specific to one of the three output methods (HTML, FO and LaTeX), and those which are common to all three.

Making HTML: example

You can simply refer to the specification html/tei.xsl directly with your XSL processor, or install it locally on your own server. For more flexibility, you may prefer to reference the specifications from an XSL wrapper of your own. The minimal specification would look like this:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="html/tei.xsl"/> </xsl:stylesheet>
You can customize the result by adding to this wrapper file (see previous section). The normal result will be a single stream of HTML which you can save in a file. You can also configure it to produce multiple output files, one per top-level <div> , <div0> , or <div1> .

Layout

There are three ways to provide a constant navigation aid. You can either make the whole page into a table, where the first column has a table of contents, or you can make an HTML frameset, or you can just have a table of links on the left or right

Hypertext links present special problems, as we have to choose whether they should start a new window, occupy all of the current window, or stay within the frame. These stylesheets implement the following rules:
  1. Any <ref> or <ptr> link stays within the frame
  2. Any link containing ‘://’ uses the whole browser window
  3. Any link starting ‘.’ uses the whole browser window
  4. If the stylesheet sets no splitting of the document, any <xref> or <xptr> link uses the whole browser window
  5. If a <xref> or <xptr> link has a rend attribute value of ‘noframe’, the whole browser window is used
  6. If a <xref> or <xptr> link has a rend attribute value of ‘new’, a new browser window is started

Variables

Type Name Description Default
html consecutiveFootnoteNumbers Number footnotes consecutively [boolean] false
html footnoteBackLink Link back from footnotes to reference [boolean] false
html contentStructure How to use the front/body/back matter in creating columns. [string] body
html divOffset The difference between TEI div levels and HTML. headings. [integer] 2
html footnoteFile Make a separate file for footnotes [boolean] false
html linksWidth Width of left-hand column when $pageLayout is "Table" [string] 15%
html navbarFile XML resource defining a navigation bar. [anyURI]
fo backMulticolumns Put back matter in multiple columns [boolean] false
fo bodyMarginBottom Margin at bottom of text body [string] 24pt
fo bodyMarginTop Margin at top of text body [string] 24pt
fo bodyMulticolumns Put body matter in multiple columns [boolean] false
fo bulletFour Symbol for 4th level itemized list [string] +
fo bulletOne Symbol for top-level itemized list [string]
fo bulletThree Symbol for 3rd level itemized list [string] *
fo bulletTwo Symbol for 2nd level itemized list [string]
fo columnCount Number of columns, when multiple-column work is requested [integer] 1
fo distanceBetweenStarts XSL FO "provisional-distance-between starts" [string] 18pt
fo distanceBetweenGlossStarts XSL FO "provisional-distance-between starts" for gloss lists [string] 42pt
fo divRunningheads Display section headings in running heads [boolean] false
fo exampleAfter Space below examples [string] 4pt
fo exampleBefore Space above examples [string] 4pt
fo exampleMargin Left margin for examples [string] 12pt
fo flowMarginLeft Left margin of flow [string]
fo forcePageMaster Which named page master name to use [string]
fo formatBackpage How to format page numbers in back matter (use XSLT number format) [string] 1
fo formatBodypage How to format page numbers in main matter (use XSLT number format) [string] 1
fo formatFrontpage How to format page numbers in front matter (use XSLT number format) [string] i
fo frontMulticolumns Put front matter in multiple columns [boolean] false
fo indentBibl Indentation for bibliography entries [string] 1em
fo labelSeparation XSL FO "provisional-label-separation" [string] 6pt
fo listAbove-1 Space above lists at top level [string] 6pt
fo listAbove-2 Space above lists at 2nd level [string] 4pt
fo listAbove-3 Space above lists at 3rd level [string] 0pt
fo listAbove-4 Space above lists at 4th level [string] 0pt
fo listBelow-1 Space below lists at top level [string] 6pt
fo listBelow-2 Space below lists at 2nd level [string] 4pt
fo listBelow-3 Space below lists at 3rd level [string] 0pt
fo listBelow-4 Space below lists at 4th level [string] 0pt
fo listItemsep Spacing between list items [string] 4pt
fo listLeftGlossIndent Left margin for gloss lists [string] 0.5in
fo listLeftGlossInnerIndent Left margin for nested gloss lists [string] 0.25in
fo listLeftIndent Indentation for lists [string] 0pt
fo listRightMargin Right margin for lists [string] 10pt
fo pageHeight Paper height [string] 297mm
fo pageMarginBottom Margin at bottom of text area [string] 100pt
fo pageMarginLeft Left margin [string] 80pt
fo pageMarginRight Right margin [string] 150pt
fo pageMarginTop Margin at top of text area [string] 75pt
fo pageWidth Paper width [string] 211mm
fo parIndent Paragraph indentation [string] 1em
fo parSkip Default spacing between paragraphs [string] 0pt
fo parSkipmax Maximum space allowed between paragraphs [string] 12pt
fo readColSpecFile External XML file containing specifications for column sizes for tables in document [anyURI]
fo regionAfterExtent Region after [string] 14pt
fo regionBeforeExtent Region before [string] 14pt
fo sectionHeaders Construct running headers from page number and section headings [boolean] true
fo spaceAfterBibl Space after bibliography [string] 0pt
fo spaceAroundTable Space above and below a table [string] 8pt
fo spaceBeforeBibl Space above bibliography [string] 4pt
fo spaceBelowCaption Space below caption of figure or table [string] 4pt
fo titlePage Make title page [boolean] true
fo twoSided Make 2-page spreads [boolean] true
latex classParameters Optional parameters for documentclass [string] 11pt
latex latexLogo Logo graphics file [string]
latex pagebreakStyle When processing a "pb" element, decide what to generate: "active" generates a page break; "visible" genrates a bracketed number (with scissors), and "bracketsonly" generates a bracketed number (without scissors) [float]
latex tableMaxWidth When making a table, what width must be constrained to fit, as a proportion of the page width [float] 0.85
latex verseNumbering Whether to number lines of poetry [boolean] false
latex everyHowManyLines When numbering poetry, how often to put in a line number [integer] 5
latex resetVerseLineNumbering When numbering poetry, when to restart the sequence; this must be the name of a TEI element [string] div1

Templates

columnHeader
(for html) Banner for top of column
hdr
(for html) Header section across top of page
<xsl:call-template name="pageHeader"> <xsl:with-param name="mode"/></xsl:call-template>
hdr2
(for html) Navigation bar
<xsl:call-template name="navbar"/>
preBreadCrumbPath
(for html) Text or action to take at the start of the breadcrumb trail
hdr3
(for html) Breadcrumb trail
<a href="#rh-column" title="Go to main page content" class="skiplinks">Skip links</a> <a class="hide">|</a> <xsl:call-template name="crumbPath"/> <a class="hide">|</a> <a class="bannerright" href="{$parentURL}" title="Go to home page"> <xsl:value-of select="$parentWords"/></a>
lh-col-bottom
(for html) Bottom of left-hand column
<xsl:param name="currentID"/> <xsl:call-template name="leftHandFrame"> <xsl:with-param name="currentID" select="$currentID"/></xsl:call-template>
lh-col-top
(for html) Top of left-hand column
<xsl:call-template name="searchbox"/> <xsl:call-template name="printLink"/>
logoPicture
(for html) Logo
<a class="framelogo" href="http://www.tei-c.org/Stylesheets/teic/"> <img src="http://www.tei-c.org/Stylesheets/teic/teixsl.png" vspace="5" width="124" height="161" border="0" alt="created by TEI XSL Stylesheets"/></a>
metaHTML
(for html) Making elements in HTML <head>
<xsl:param name="title"/> <meta name="author"> <xsl:attribute name="content"> <xsl:call-template name="generateAuthor"/></xsl:attribute></meta> <meta name="generator" content="Text Encoding Initiative Consortium XSLT stylesheets"/> <meta name="DC.Title" content="{$title}"/> <meta name="DC.Type" content="Text"/> <meta name="DC.Format" content="text/html"/> <meta http-equiv="Content-Type" content="text/html; charset={$outputEncoding}"/>
navbar
(for html) Construction of navigation bar
<xsl:if test="not($navbarFile='')"> <xsl:for-each select="document($navbarFile,document(''))"> <xsl:for-each select="tei:list/tei:item"> <span class="navbar"> <a href="{$URLPREFIX}{tei:xref/@url}" class="navbar"> <xsl:apply-templates select="tei:xref/text()"/></a></span> <xsl:if test="following-sibling::tei:item">|</xsl:if></xsl:for-each></xsl:for-each></xsl:if>
pageHeader
(for html) Banner for top of page
<xsl:param name="mode"/> <xsl:choose> <xsl:when test="$mode='table'"> <table width="100%" border="0"> <tr> <td height="98" class="bgimage" onclick="window.location='{$homeURL}'" cellpadding="0"> <xsl:call-template name="makeHTMLHeading"> <xsl:with-param name="class">subtitle</xsl:with-param> <xsl:with-param name="text"> <xsl:call-template name="generateSubTitle"/></xsl:with-param> <xsl:with-param name="level">2</xsl:with-param></xsl:call-template> <xsl:call-template name="makeHTMLHeading"> <xsl:with-param name="class">title</xsl:with-param> <xsl:with-param name="text"> <xsl:call-template name="generateTitle"/></xsl:with-param> <xsl:with-param name="level">1</xsl:with-param></xsl:call-template></td> <td valign="top"/></tr></table></xsl:when> <xsl:otherwise> <xsl:call-template name="makeHTMLHeading"> <xsl:with-param name="class">subtitle</xsl:with-param> <xsl:with-param name="text"> <xsl:call-template name="generateSubTitle"/></xsl:with-param> <xsl:with-param name="level">2</xsl:with-param></xsl:call-template> <xsl:call-template name="makeHTMLHeading"> <xsl:with-param name="class">title</xsl:with-param> <xsl:with-param name="text"> <xsl:call-template name="generateTitle"/></xsl:with-param> <xsl:with-param name="level">1</xsl:with-param></xsl:call-template></xsl:otherwise></xsl:choose>
rh-col-bottom
(for html) Bottom of right-hand column
<xsl:param name="currentID"/> <xsl:call-template name="mainFrame"> <xsl:with-param name="currentID" select="$currentID"/></xsl:call-template>
rh-col-top
(for html) Top of right-hand column
<xsl:call-template name="columnHeader"/>
searchbox
(for html) Make a search box
singleFileLabel
(for html) Construct a label for the link which makes a printable version of the document.For Printing
latexPackages
(for latex)
<xsl:text>\usepackage[</xsl:text> <xsl:value-of select="$latexGeometryOptions"/> <xsl:text>]{geometry} \usepackage{longtable} \usepackage{colortbl} \usepackage{ulem} \usepackage{fancyvrb} \usepackage{fancyhdr} \usepackage{graphicx} \usepackage{endnotes} \def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}</xsl:text> <xsl:if test="$reencode='true'"> <xsl:text>\IfFileExists{tipa.sty}{\usepackage{tipa}}{} \usepackage{times}</xsl:text></xsl:if> <xsl:if test="not($userpackage='')">\usepackage{ <xsl:value-of select="$userpackage"/>}</xsl:if> <xsl:text>\pagestyle{fancy}</xsl:text>
latexSetup
(for latex)
<xsl:if test="$reencode='true'">\IfFileExists{utf8x.def}% {\usepackage[utf8x]{inputenc}}% {\usepackage[utf8]{inputenc}} \usepackage[russianb,greek,english]{babel} \usepackage[T1]{fontenc} \usepackage[]{ucs}</xsl:if>\usepackage{relsize} <xsl:if test="$reencode='true'">\uc@dclc{8421}{default}{\textbackslash } \uc@dclc{10100}{default}{\{} \uc@dclc{10101}{default}{\}}</xsl:if>\DeclareTextSymbol{\textpi}{OML}{25} \def\textsubscript#1{% \@textsubscript{\selectfont#1}} \def\@textsubscript#1{% {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}} \def\textquoted#1{`#1'} \def\textcal#1{\ensuremath{\mathcal{#1}}} \def\textsmall#1{{\small #1}} \def\textlarge#1{{\large #1}} \def\textoverbar#1{\ensuremath{\overline{#1}}} \def\textgothic#1{\ensuremath{\mathscr{#1}}} \RequirePackage{array} \def\@testpach{\@chclass \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else \ifnum \@lastchclass=7 5 \else \ifnum \@lastchclass=8 \tw@ \else \ifnum \@lastchclass=9 \thr@@ \else \z@ \ifnum \@lastchclass = 10 \else \edef\@nextchar{\expandafter\string\@nextchar}% \@chnum \if \@nextchar c\z@ \else \if \@nextchar l\@ne \else \if \@nextchar r\tw@ \else \z@ \@chclass \if\@nextchar |\@ne \else \if \@nextchar !6 \else \if \@nextchar @7 \else \if \@nextchar (8 \else \if \@nextchar )9 \else 10 \@chnum \if \@nextchar m\thr@@\else \if \@nextchar p4 \else \if \@nextchar b5 \else \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} \gdef\arraybackslash{\let\\=\@arraycr} \def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}} \gdef\arraybackslash{\let\\=\@arraycr} <xsl:text disable-output-escaping="yes">\newcolumntype{L}[1]{){\raggedright\arraybackslash}p{#1}} \newcolumntype{C}[1]{){\centering\arraybackslash}p{#1}} \newcolumntype{R}[1]{){\raggedleft\arraybackslash}p{#1}} \newcolumntype{P}[1]{){\arraybackslash}p{#1}} \IfFileExists{xcolor.sty}% {\RequirePackage{xcolor}}% {\RequirePackage{color}} \definecolor{label}{gray}{0.75}</xsl:text>\DeclareRobustCommand*{\xref}{\hyper@normalise\xref@} \def\xref@#1#2{\hyper@linkurl{#2}{#1}} \def\Div[#1]#2{\section*{#2}} \catcode`\_=12\relax
latexLayout
(for latex)
\paperwidth211mm \paperheight297mm \def\@pnumwidth{1.55em} \def\@tocrmarg {2.55em} \def\@dotsep{4.5} \setcounter{tocdepth}{3} \clubpenalty=8000 \emergencystretch 3em \hbadness=4000 \hyphenpenalty=400 \pretolerance=750 \tolerance=2000 \vbadness=4000 \widowpenalty=10000 <xsl:if test="not($docClass='letter')">\renewcommand\section{\@startsection {section}{1}{\z@}% {-1.75ex \@plus -0.5ex \@minus -.2ex}% {0.5ex \@plus .2ex}% {\reset@font\large\bfseries\sffamily}} \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% {-1.75ex\@plus -0.5ex \@minus- .2ex}% {0.5ex \@plus .2ex}% {\reset@font\large\sffamily}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {-1.5ex\@plus -0.35ex \@minus -.2ex}% {0.5ex \@plus .2ex}% {\reset@font\normalsize\sffamily}} \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {1.5ex \@plus0.5ex \@minus.2ex}% {-1em}% {\reset@font\normalsize\bfseries}} \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% {1.5ex \@plus1ex \@minus .2ex}% {-1em}% {\reset@font\normalsize\bfseries}}</xsl:if>\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt} \@tempdima 1.5em \begingroup \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth \bfseries \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par \endgroup} \def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}} \def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}} \def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}} \def\l@subparagraph{\@dottedtocline{5}{10em}{5em}} \@ifundefined{c@section}{\newcounter{section}}{} \newif\if@mainmatter \@mainmattertrue \def\frontmatter{% \setcounter{secnumdepth}{-1} \@mainmatterfalse \pagenumbering{roman}} \def\mainmatter{% <xsl:if test="$numberHeadings='true'">\setcounter{section}{0} \setcounter{secnumdepth}{4}</xsl:if>\@mainmattertrue \pagenumbering{arabic}} \def\backmatter{% \clearpage \appendix \@mainmatterfalse} \newenvironment{bibitemlist}[1]{% \list{\@biblabel{\@arabic\c@enumiv}}% {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep \@openbib@code \usecounter{enumiv}% \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}% }% \sloppy \clubpenalty4000 \@clubpenalty \clubpenalty \widowpenalty4000% \sfcode`\.\@m}% {\def\@noitemerr {\@latex@warning{Empty `bibitemlist' environment}}% \endlist} \def\tableofcontents{\section*{\contentsname}\@starttoc{toc}} \usepackage[pdftitle={ <xsl:call-template name="generateSimpleTitle"/>}, pdfauthor={ <xsl:call-template name="generateAuthor"/>}]{hyperref} \hyperbaseurl{ <xsl:value-of select="$baseURL"/>} <xsl:call-template name="latexPreambleHook"/>
latexBegin
(for latex)
\makeatletter \thispagestyle{plain} <xsl:if test="not(tei:text/tei:front/tei:titlePage)"> <xsl:call-template name="printTitleAndLogo"/></xsl:if>\markright{\@title}% \markboth{\@title}{\@author}% \makeatother \fvset{frame=single,numberblanklines=false,xleftmargin=5mm,xrightmargin=5mm} \fancyhf{} \setlength{\headheight}{14pt} \fancyhead[LE]{\bfseries\leftmark} \fancyhead[RO]{\bfseries\rightmark} \fancyfoot[RO]{\TheFullDate} \fancyfoot[CO]{\thepage} \fancyfoot[LO]{ <xsl:value-of select="$REQUEST"/>} \fancyfoot[LE]{\TheFullDate} \fancyfoot[CE]{\thepage} \fancyfoot[RE]{ <xsl:value-of select="$REQUEST"/>} \fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}} <xsl:call-template name="beginDocumentHook"/>
latexEnd
(for latex)

Headings

Headings for sections can be customized in various ways.

Variables

Type Name Description Default
autoHead Construct a heading for <div> elements with no <head> [boolean]
headingNumberSuffix Punctuation to insert after a section number [string]
<xsl:text>.</xsl:text> <xsl:value-of select="$numberSpacer"/>
numberSpacer Character to put after number of section header [string]
<xsl:text></xsl:text>

Templates

autoMakeHead
(for common) How to make a heading for section if there is no <head>
<xsl:choose> <xsl:when test="tei:head"> <xsl:apply-templates mode="plain" select="tei:head"/></xsl:when> <xsl:when test="@type"> <xsl:value-of select="@type"/></xsl:when> <xsl:otherwise> <xsl:text> </xsl:text></xsl:otherwise></xsl:choose>

Numbering

Section headings, figures, tables and notes can be numbered automatically. We can set the numbering of front matter and back matter separately. If you prefer to supply your own numbering, using the n attribute, you can choose this over automatic numbering.

Normally, heading numbers are followed by ‘. ’, but you can vary this. This would let you use eg fixed spaces.

Variables

Type Name Description Default
numberBackFigures Automatically number figures in back matter [boolean] false
numberBackHeadings How to construct heading numbering in back matter [string] A.1
numberBackTables Automatically number tables in back matter [boolean] true
numberBodyHeadings How to construct heading numbering in main matter [string] 1.1.1.1
numberFigures Automatically number figures [boolean] true
numberFrontFigures Automatically number figures in front matter [boolean] false
numberFrontHeadings How to construct heading numbering in front matter [string]
numberFrontTables Automatically number tables in front matter [boolean] true
numberHeadings Automatically number sections [boolean] true
numberHeadingsDepth Depth to which sections should be numbered [integer] 9
numberTables Automatically number tables [boolean] true
prenumberedHeadings Use value of "n" attribute to number sections [boolean] false
html numberParagraphs Automatically number paragraphs [boolean] false

Templates

numberBackDiv
(for common) How to number sections in back matter
<xsl:if test="not($numberBackHeadings='')"> <xsl:number count="tei:div|tei:div0|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" format="A.1.1.1.1.1" level="multiple"/></xsl:if>
numberBodyDiv
(for common) How to number sections in main matter
<xsl:if test="$numberHeadings='true'"> <xsl:number count="tei:div|tei:div0|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" level="multiple"/></xsl:if>
numberFrontDiv
(for common) How to number sections in front matter
<xsl:if test="not($numberFrontHeadings='')"> <xsl:number count="tei:div|tei:div0|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" level="multiple"/></xsl:if>

Output

You can set a name for the output file(s); if you ask for multiple output files, this name will be used to create unique filenames for each section. By default, results will go to wherever your XSLT processor normally writes (usually standard output). If you opt to have files created, you can specify the name of the directory where the output is to be placed.

If you are making HTML, do you want a single output page, or a separate one for each section of the document? You can decide to have a different splitting policy for front and back matter.

Variables

Type Name Description Default
REQUEST The complete URL when the document is being delivered from a web server (normally set by Apache or Cocoon) [string]
STDOUT Write to standard output channel [boolean] true
html ID An ID passed to the stylesheet to indicate which section to display [string]
html URLPREFIX A path fragment to put before all internal URLs [string]
html outputName The name of the output file [string]
html outputDir Directory in which to place generated files [string]
html outputEncoding Encoding of output file(s) [string] iso-8859-1
html outputMethod Output method for output file(s) [string] html
html outputSuffix Suffix of output file(s) [string] .html
html doctypePublic Public Doctype of output file(s) [string] -//W3C//DTD HTML 4.0 Transitional//EN
html doctypeSystem System Doctype of output file(s) [string] http://www.w3.org/TR/html4/loose.dtd
html pageLayout The style of HTML (Simple, CSS or Table) which creates the layout for generated pages. [string] Simple
html rawXML Pass through input essentially unchanged [boolean] false
html splitBackmatter Break back matter into separate HTML pages (if splitting enabled) [boolean] true
html splitFrontmatter Break front matter into separate HTML pages (if splitting enabled) [boolean] true
html splitLevel Level at which to split sections. [integer] -1
html standardSuffix Suffix for generated output files [string]
<xsl:choose> <xsl:when test="$rawXML='true'">.xml</xsl:when> <xsl:when test="tei:teiCorpus">.html</xsl:when> <xsl:when test="$STDOUT='true'"/> <xsl:otherwise> <xsl:value-of select="$outputSuffix"/></xsl:otherwise></xsl:choose>
html topNavigationPanel Display navigation panel at top of pages [boolean] true
html urlChunkPrefix How to specify infra-document links [string] ?ID=
html useIDs Construct links using existing ID values. [boolean] true
html virtualPages Whether to make split pages appear virtually as layers in HTML, or physically as separate pages or server requests [boolean] false
html xhtml Make XHTML-compatible markup [boolean] false
fo language Language (for hyphenation) [string] en_US
fo foEngine Name of intended XSL FO engine [string]
latex baseURL URL root where referenced documents are located [string]
latex reencode Whether or not to load LaTeX packages which attempt to process the UTF-8 characters [boolean] true
latex realFigures Use real name of graphics files rather than pointers [boolean] true

Table of contents generation

You probably want tables of contents built for your document, using the <div> structure. However, if you have used a <divGen type="toc"> explicitly, that will also create a table of contents, so you can suppress the automatic one. When a table of contents is created, you choose how many levels of headings it will show. You can choose whether or not the front and backmatter appear in the table of contents.

Variables

Type Name Description Default
html autoToc Make an automatic table of contents [boolean] true
html class_subtoc CSS class for second-level TOC entries [string] subtoc
html subTocDepth Depth at which to stop doing a recursive table of contents. [integer] -1
html tocBack Include the back matter in the table of contents [boolean] true
html tocDepth Depth to which table of contents is constructed [string] 5
html tocFront Include the front matter in the table of contents [boolean] true
html tocElement Which HTML element to wrap each TOCs entry in [string] p
html tocContainerElement Which HTML element to wrap each TOC sections in [string] div
html refDocFooterText Text to link back to from foot of ODD reference pages [string] TEI Guidelines
html refDocFooterURL URL to link back to from foot of ODD reference pages [anyURI] index.html
fo div0Tocindent Indentation for level 0 TOC entries [string] 0in
fo div1Tocindent Indentation for level 1 TOC entries [string] 0.25in
fo div2Tocindent Indentation for level 2 TOC entries [string] 0.5in
fo div3Tocindent Indentation for level 3 TOC entries [string] 0.75in
fo div4Tocindent Indentation for level 4 TOC entries [string] 1in
fo tocBack Make TOC for sections in <back> [boolean] true
fo tocFront Make TOC for sections in <front> [boolean] true
fo tocNumberSuffix Punctuation to insert after a section number in a TOC [string] .
fo tocStartPage Page number on which TOC should start [integer] 1

Internationalization

At various places, the system has to create text. You can choose the words it uses (eg translate them to another language).

CSS

Setting up material for the CSS file to accompany HTML output.

Variables

Type Name Description Default
class_toc CSS class for TOC entries [string] toc
html class_ptr CSS class for links derived from <ptr> [string] ptr
html class_ref CSS class for links derived from <ref> [string] ref
html class_xptr CSS class for links derived from <xptr> [string] xptr
html class_xref CSS class for links derived from <xref> [string] xref
html cssFile CSS style file to be associated with output file(s) [anyURI] http://www.tei-c.org/stylesheet/tei.css
html cssPrintFile Secondary CSS style file; this will be given a media=screen attribute, so that it does not affect printing [anyURI]
html cssSecondaryFile CSS style file for print; this will be given a media=print attribute [anyURI]

Tables

Default behaviour of table elements.

Variables

Type Name Description Default
cellAlign Default alignment of table cells [string] left
tableAlign Default alignment of tables [string] left
fo defaultCellLabelBackground Default colour for background of table cells which are labelling rows or columns [string] silver
fo inlineTables Force tables to appear inline [boolean] false
fo makeTableCaption Put a caption on tables [boolean] true
fo tableCaptionAlign Alignment of table captions [string] center
fo tableCellPadding Default padding on table cells [string] 2pt

Templates

tableCaptionstyle
(for fo) Set attributes for display of table
<xsl:attribute name="text-align">center</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> <xsl:attribute name="end-indent"> <xsl:value-of select="$exampleMargin"/></xsl:attribute> <xsl:attribute name="start-indent"> <xsl:value-of select="$exampleMargin"/></xsl:attribute> <xsl:attribute name="space-before"> <xsl:value-of select="$spaceAroundTable"/></xsl:attribute> <xsl:attribute name="space-after"> <xsl:value-of select="$spaceBelowCaption"/></xsl:attribute> <xsl:attribute name="keep-with-next">always</xsl:attribute>

Figures and graphics

Sometimes you need to prefix the names of all graphics files with a directory name or a URL, or provide a default suffix. You can also tell <figure> elements whether or not to produce anything.

Variables

Type Name Description Default
graphicsPrefix Directory specification to put before names of graphics files, unless they start with "./" [string]
graphicsSuffix Default file suffix for graphics files, if not directly specified [string] .png
standardScale Scaling of imported graphics [decimal] 1
html dpi Resolution of images [integer] 96
html showFigures Display figures [boolean] true
fo autoScaleFigures How to scale figures if no width and height specified (pass to XSL FO content-width) [string]
fo captionInlineFigures Put captions on inline figures [boolean] false
fo showFloatHead Show the contents of <head> in a cross-reference to table or figure [boolean] false
fo showFloatLabel Show a title for figures or tables (eg Table or Figure) in a cross-reference [boolean] false
fo xrefShowPage Show the page number in a cross-reference to table or figure [boolean] false

Templates

figureCaptionstyle
(for fo) Set attributes for display of figures
<xsl:attribute name="text-align">center</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> <xsl:attribute name="end-indent"> <xsl:value-of select="$exampleMargin"/></xsl:attribute> <xsl:attribute name="start-indent"> <xsl:value-of select="$exampleMargin"/></xsl:attribute>

Style

You can choose lots of features which affect the font, size, etc
  • What font to use for URLs.
  • Whether titles, dates and authors are shown.
  • Whether headings of objects are included in cross-references.

Variables

Type Name Description Default
pagebreakStyle Display of <pb> element [string] none
displayMode How to display Relax NG schema fragments (rnc or rng) [string] rnc
minimalCrossRef Provide minimal context for a link [boolean] false
postQuote Character to insert at end of quote [string]
preQuote Character to insert at start of quote [string]
html urlMarkup HTML element to put around visible text of display URLs [string] span
fo activeLinebreaks Make <lb> active (ie cause a line break) [boolean] true
fo alignment Alignment of text (ie justified or ragged) [string] justify
fo authorSize Font size for display of author name [string] 14pt
fo biblSize Font size for bibliography [string] 16pt
fo bodyFont Default font for body [string] Times
fo bodyMaster Default font size for body (without dimension) [string] 10
fo bodySize Calculation of normal body font size (add dimension) [string]
<xsl:value-of select="$bodyMaster"/> <xsl:text>pt</xsl:text>
fo dateSize Font size for display of date [string] 14pt
fo divFont Font for section headings [string] Times
fo exampleColor Colour for display of <eg> blocks [string] black
fo exampleBackgroundColor Colour for background display of <eg> blocks [string] yellow
fo exampleSize Calculation of font size for examples (add dimension) [string]
<xsl:value-of select="$bodyMaster * 0.8"/> <xsl:text>pt</xsl:text>
fo footnoteSize Font size for footnotes [string] 8pt
fo footnotenumSize Font size for footnote numbers [string] 7pt
fo giColor Colour for display of element names [string] black
fo headingOutdent Indentation of headings [string] -3em
fo hyphenate Hyphenate text [boolean] true
fo identColor Colour for display of <ident> values Customization parameter [string] black
fo runFont Font family for running header and footer [string] sans-serif
fo runSize Font size for running header and footer [string] 9pt
fo sansFont Sans-serif font [string] Helvetica
fo smallSize Calculation of small font size (add dimension) [string]
<xsl:value-of select="$bodyMaster * 0.9"/> <xsl:text>pt</xsl:text>
fo tableSize Create font size for tables, by reference to $bodyMaster [string]
<xsl:value-of select="$bodyMaster * 0.9"/> <xsl:text>pt</xsl:text>
fo titleSize Font size for display of title [string] 16pt
fo tocSize Font size for TOC heading [string] 16pt
fo typewriterFont Font for literal code [string] Courier

Templates

divXRefHeading
(for fo) How to display section headings in a cross-reference
<xsl:param name="head"> <xsl:apply-templates mode="section" select="tei:head"/></xsl:param> <xsl:text>(</xsl:text> <xsl:value-of select="normalize-space($head)"/> <xsl:text>)</xsl:text>
linkStyle
(for fo) Set attributes for display of links
<xsl:attribute name="text-decoration">underline</xsl:attribute>
setupDiv0
(for fo) Set attributes for display of heading for chapters (level 0)
<xsl:attribute name="font-size">18pt</xsl:attribute> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="space-after">6pt</xsl:attribute> <xsl:attribute name="space-before.optimum">12pt</xsl:attribute> <xsl:attribute name="text-indent"> <xsl:value-of select="$headingOutdent"/></xsl:attribute>
setupDiv1
(for fo) Set attributes for display of heading for 1st level sections
<xsl:attribute name="font-size">14pt</xsl:attribute> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="space-after">3pt</xsl:attribute> <xsl:attribute name="space-before.optimum">9pt</xsl:attribute> <xsl:attribute name="text-indent"> <xsl:value-of select="$headingOutdent"/></xsl:attribute>
setupDiv2
(for fo) Set attributes for display of heading for 2nd level sections
<xsl:attribute name="font-size">12pt</xsl:attribute> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> <xsl:attribute name="space-after">2pt</xsl:attribute> <xsl:attribute name="space-before.optimum">4pt</xsl:attribute> <xsl:attribute name="text-indent"> <xsl:value-of select="$headingOutdent"/></xsl:attribute>
setupDiv3
(for fo) Set attributes for display of heading for 3rd level sections
<xsl:attribute name="font-size">10pt</xsl:attribute> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> <xsl:attribute name="space-after">0pt</xsl:attribute> <xsl:attribute name="space-before.optimum">4pt</xsl:attribute> <xsl:attribute name="text-indent"> <xsl:value-of select="$headingOutdent"/></xsl:attribute>
setupDiv4
(for fo) Set attributes for display of heading for 4th level sections
<xsl:attribute name="font-size">10pt</xsl:attribute> <xsl:attribute name="space-before.optimum">4pt</xsl:attribute> <xsl:attribute name="text-indent"> <xsl:value-of select="$headingOutdent"/></xsl:attribute>
showXrefURL
(for fo) How to display the link text of a <ptr>
<xsl:param name="dest"/> <xsl:value-of select="$dest"/>

Hooks

A set of templates which are empty by default; they can be used to add code at strategic points. The content must be valid XSLT.

Variables

Type Name Description Default

Templates

bodyHook
(for html) Hook where HTML can be inserted just after <body>
bodyEndHook
(for html) Hook where HTML can be inserted just before the <body> ends.
bodyJavascriptHook
(for html) Hook where Javascript calls can be inserted just after <body>
cssHook
(for html) Hook where extra CSS can be inserted
headHook
(for html) Hook where code can be added to the HTML <head>.
imgHook
(for html) Hook where HTML can be inserted when creating an <img>
javascriptHook
(for html) Hook where extra Javascript functions can be defined
preAddressHook
(for html) Hook where HTML can be inserted just before the <address>
startDivHook
(for html) Hook where HTML can be inserted at the start of processing each section
startHook
(for html) Hook where HTML can be inserted at the beginning of the main text, after the header
teiEndHook
(for html) Hook where HTML can be inserted after processing <TEI>
teiStartHook
(for html) Hook where HTML can be inserted before processing <TEI>
xrefHook
(for html) Hook where HTML can be inserted when creating an <a> element
afterBodyHook
(for fo) Hook where extra material can be inserted after the <body> has been processed
blockStartHook
(for fo) Hook where work can be done at the start of each block
pageMasterHook
(for fo) Hook where extra page masters can be defined
beginDocumentHook
(for latex) Hook where LaTeX commands can be inserted after the beginning of the document
latexPreambleHook
(for latex) Hook where LaTeX commands can be inserted in the preamble before the beginning of the document

Miscellaneous and advanced

Finally, some miscellaneous or advanced features which you probably won't use much.

Variables

Type Name Description Default
teixslHome The home page for these stylesheets [anyURI] http://www.tei-c.org/Stylesheets/teic/
teiP4Compat Process elements according to assumptions of TEI P4 [boolean] false
useHeaderFrontMatter Title, author and date is taken from the <teiHeader> rather than looked for in the front matter [boolean] false
html generateParagraphIDs Generate a unique ID for all paragraphs [boolean] true
html rendSeparator Character separating values in a rend attribute. [string] ;
html showTitleAuthor Show a title and author at start of document [boolean] false
html verbose Be talkative while working [boolean] false