| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
%% tei.xmt |
| 3 |
|
| 4 |
%% Copyright 2000 Sebastian Rahtz, David Carlisle |
| 5 |
|
| 6 |
%% This file is distributed under the LaTeX Project Public License |
| 7 |
%% (LPPL) as found at http://www.latex-project.org/lppl.txt |
| 8 |
%% Either version 1.0, or at your option, any later version. |
| 9 |
|
| 10 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 11 |
\XMLname{div}{\DIV} |
| 12 |
\XMLname{figure}{\FIGURE} |
| 13 |
\XMLname{table}{\TABLE} |
| 14 |
\XMLstring\type@equation<>equation</> |
| 15 |
\XMLstring\type@display<>display</> |
| 16 |
\XMLstring\type@subeqn<>subeqn</> |
| 17 |
|
| 18 |
\XMLelement{TEI.2}{} |
| 19 |
{ \documentclass{article} |
| 20 |
\usepackage[bookmarks=false]{hyperref} |
| 21 |
\usepackage{teixml} |
| 22 |
\begin{document} } |
| 23 |
{\end{document}} |
| 24 |
|
| 25 |
\XMLelement{p}{} |
| 26 |
{\par} |
| 27 |
{} |
| 28 |
|
| 29 |
\newcount\SCOUNT |
| 30 |
\global\SCOUNT-1\relax |
| 31 |
|
| 32 |
\XMLelement{div}{ |
| 33 |
\XMLattribute{id}{\idval}{\@nil}} |
| 34 |
{\advance\SCOUNT\@ne} |
| 35 |
{} |
| 36 |
|
| 37 |
\XMLelement{head}{ } |
| 38 |
{\xmlgrab} |
| 39 |
{ |
| 40 |
\ifx\XML@parent\DIV |
| 41 |
\protected@xdef\temp{ |
| 42 |
\expandafter\noexpand\ifcase\SCOUNT |
| 43 |
\section\or\subsection\or\subsubsection\fi |
| 44 |
{#1}\ifx\idval\@nnil\else\noexpand\label{\idval} |
| 45 |
\fi} |
| 46 |
\aftergroup\temp |
| 47 |
\else |
| 48 |
\ifx\XML@parent\TABLE\caption{#1}\fi |
| 49 |
\ifx\XML@parent\FIGURE\caption{#1}\fi |
| 50 |
\fi |
| 51 |
|
| 52 |
} |
| 53 |
|
| 54 |
|
| 55 |
\XMLelement{emph}{} |
| 56 |
{\itshape} |
| 57 |
{} |
| 58 |
|
| 59 |
\XMLelement{formula} |
| 60 |
{\XMLattribute{type}{\Formulatype}{}} |
| 61 |
{ |
| 62 |
\ifx\Formulatype\type@equation |
| 63 |
% \begin{equation} |
| 64 |
\fi |
| 65 |
} |
| 66 |
{ |
| 67 |
\ifx\Formulatype\type@equation |
| 68 |
% \end{equation} |
| 69 |
\fi |
| 70 |
} |
| 71 |
|
| 72 |
\XMLelement{figure} |
| 73 |
{\XMLattribute{id}{\figid}{} |
| 74 |
\XMLattribute{width}{\FIGwidth}{} |
| 75 |
\XMLattribute{height}{\FIGheight}{} |
| 76 |
\XMLattribute{file}{\figfile}{} |
| 77 |
\XMLattribute{entity}{\figent}{} |
| 78 |
} |
| 79 |
{\begin{figure} |
| 80 |
\ifx\FIGwidth\@empty\else\setkeys{Gin}{width=\FIGwidth}\fi |
| 81 |
\ifx\FIGheight\@empty\else\setkeys{Gin}{height=\FIGheight}\fi |
| 82 |
\ifx\@empty\figfile |
| 83 |
\NDATAEntity\figent\@gobble\includegraphics |
| 84 |
\else |
| 85 |
\includegraphics{\figfile}% |
| 86 |
\fi} |
| 87 |
{\ifx\@empty\figid |
| 88 |
\else |
| 89 |
\label{\figid} |
| 90 |
\fi |
| 91 |
\end{figure}} |
| 92 |
|
| 93 |
\XMLelement{code}{} |
| 94 |
{\ttfamily} |
| 95 |
{} |
| 96 |
|
| 97 |
\XMLelement{gi}{} |
| 98 |
{\ttfamily\textless} |
| 99 |
{\textgreater} |
| 100 |
|
| 101 |
\XMLelement{eg}{} |
| 102 |
{\begin{quote}\ttfamily\obeylines} |
| 103 |
{\end{quote}} |
| 104 |
|
| 105 |
\XMLelement{teiHeader}{} |
| 106 |
{\xmlgrab} |
| 107 |
{\xmltexfirstchild#1\@empty\@} |
| 108 |
|
| 109 |
\XMLelement{fileDesc}{} |
| 110 |
{} |
| 111 |
{} |
| 112 |
|
| 113 |
\XMLelement{titleStmt}{} |
| 114 |
{\xmlgrab} |
| 115 |
{} |
| 116 |
|
| 117 |
\XMLelement{sourceDesc}{} |
| 118 |
{\xmlgrab} |
| 119 |
{} |
| 120 |
|
| 121 |
\XMLelement{availability}{} |
| 122 |
{\xmlgrab} |
| 123 |
{\gdef\header@availability{#1}} |
| 124 |
|
| 125 |
\XMLelement{docTitle}{} |
| 126 |
{\xmlgrab} |
| 127 |
{\gdef\nopar{\let\par\relax} |
| 128 |
\title{#1}% |
| 129 |
% \ifx\\unskip\thanks{\protect\nopar\ignorespaces\header@availability} |
| 130 |
} |
| 131 |
|
| 132 |
\XMLelement{xptr} |
| 133 |
{ |
| 134 |
\XMLattribute{doc}{\xptrdoc}{} |
| 135 |
\XMLattribute{url}{\xptrurl}{} |
| 136 |
} |
| 137 |
{ |
| 138 |
\ifx\@empty\xptrurl |
| 139 |
\NDATAEntity\xptrdoc\@gobble\url |
| 140 |
\else |
| 141 |
\url{\xptrurl} |
| 142 |
\fi |
| 143 |
} |
| 144 |
{} |
| 145 |
|
| 146 |
\XMLelement{docDate}{} |
| 147 |
{\xmlgrab} |
| 148 |
{\date{#1}} |
| 149 |
|
| 150 |
\XMLelement{docAuthor}{} |
| 151 |
{\xmlgrab} |
| 152 |
{\author{#1}} |
| 153 |
|
| 154 |
\XMLelement{front}{} |
| 155 |
{} |
| 156 |
{\maketitle} |
| 157 |
|
| 158 |
\XMLelement{item} |
| 159 |
{} |
| 160 |
{\csname Item\listtype\endcsname} |
| 161 |
{} |
| 162 |
|
| 163 |
\XMLelement{label} |
| 164 |
{} |
| 165 |
{\xmlgrab} |
| 166 |
{\gdef\foo{\item[#1]}\aftergroup\foo} |
| 167 |
|
| 168 |
\XMLelement{list}{ |
| 169 |
\XMLattribute{type}{\listtype}{unordered}} |
| 170 |
{\csname List\listtype\endcsname} |
| 171 |
{\csname endList\listtype\endcsname} |
| 172 |
|
| 173 |
\XMLelement{q}{ |
| 174 |
\XMLattribute{rend}{\qrend}{}} |
| 175 |
{\begin{quote} |
| 176 |
\ifthenelse{\equal{\qrend}{eg}}{\ttfamily\obeylines}{}} |
| 177 |
{\end{quote}} |
| 178 |
|
| 179 |
\XMLelement{ptr} |
| 180 |
{\XMLattribute{target}{\ptrtarget}{}} |
| 181 |
{\hyperref[\ptrtarget]{\ref{\ptrtarget}}} |
| 182 |
{} |
| 183 |
|
| 184 |
\XMLelement{ref} |
| 185 |
{\XMLattribute{target}{\reftarget}{}} |
| 186 |
{\xmlgrab} |
| 187 |
{\hyperref[\reftarget]{#1}} |
| 188 |
|
| 189 |
|
| 190 |
\XMLelement{table} |
| 191 |
{\XMLattribute{rend}{\tablerend}{}} |
| 192 |
{\begin{longtable}{*{99}{l}}} |
| 193 |
{\end{longtable}} |
| 194 |
|
| 195 |
\XMLelement{row}{} |
| 196 |
{\xmlgrab} |
| 197 |
{\gdef\temp{#1\\}\aftergroup\temp} |
| 198 |
|
| 199 |
\XMLelement{cell}{} |
| 200 |
{\xmlgrab} |
| 201 |
{\gdef\temp{#1\tabcellsep}\aftergroup\temp} |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
%%%% bibliography |
| 206 |
|
| 207 |
\XMLelement{listBibl} |
| 208 |
{} |
| 209 |
{\begin{thebibliography}{99}} |
| 210 |
{\end{thebibliography}} |
| 211 |
|
| 212 |
\XMLelement{bibl} |
| 213 |
{\XMLattribute{id}{\bibid}{}} |
| 214 |
{\bibitem{\bibid}} |
| 215 |
{} |
| 216 |
|
| 217 |
% cheating, a bit |
| 218 |
\XMLentity{TeX}{\TeX} |
| 219 |
\XMLentity{LaTeX}{\LaTeX} |