\documentclass[12pt,a4paper]{article}
%\newif\ifpdf\ifx\pdfoutput\undefined\pdffalse\else\pdftrue\fi

%\usepackage{german}
\usepackage{times}
%\usepackage{mathptm}
%\usepackage[T1]{fontenc}
%\usepackage{covington}
%\usepackage{multicol}
%\usepackage{fancyhdr}
%\usepackage{graphicx}
\usepackage{url}
\usepackage{alltt}
\usepackage{rotating}
\usepackage{array}
\usepackage{maketitel}
\usepackage{serto}
\usepackage{assyr}

\usepackage{ifxetex}
\ifxetex
   % we use xelatex, so we can display the Estrangelo fonts
   \usepackage{estrangelo} % needs xelatex
\else
\fi
\usepackage{longtable}
\usepackage{chicago2}
%\ifpdf
\usepackage[%
xetex,
%pdftex,
,colorlinks=true,
urlcolor=urlcol, % URL: http://
citecolor=bibcol, % bibTeX
linkcolor=linkcol, % sections, footnotes, ...
pagecolor=linkcol, % links to other pages
filecolor=filecol, % URL: file:/
pdftitle={Serto - A font for Syriac (Aramaic)},
pdfauthor={Johannes Heinecke},
pdfsubject={Oriental alphabets, Semitic languages},pdfkeywords={},pagebackref,
pdfpagemode=None,bookmarksopen=true]{hyperref}
\usepackage{color}
\definecolor{linkcol}{rgb}{0.75,0,0}
\definecolor{bibcol}{rgb}{0,0.5,0}
\definecolor{urlcol}{rgb}{0,0,0.75}
\definecolor{filecol}{rgb}{0,0,0.75}

%\else
%\fi

%\addtolength{\topmargin}{-15mm}
%\addtolength{\textheight}{30mm}
%\addtolength{\textwidth}{0mm}
%\addtolength{\oddsidemargin}{0mm}
%\addtolength{\evensidemargin}{0mm}

% EDIT sertodoc.ptex
% serto.py  sertodoc.ptex > sertodoc.tex
% xelatex sertodoc.tex

\usepackage{parskip}
\usepackage{metalogo}

%\let\S=S % for verbatim
%\let\T=T % for verbatim
\def\st{Ser\d to}
\def\texxet{{\tt TeX-{}-XeT}}
%\def\pdflatex{{\tt pdflatex}}
\def\pdflatex{pdf\LaTeX}

\def\SertoVersion{1.3.2}

\newcommand{\showS}[1]{{\tt <S{}>#1</S{}>}}
\newcommand{\showT}[1]{{\tt <{}T>#1</{}T>}}
\newcommand{\showST}[1]{{\tt <S{}T>#1</S{}T>}}
\newcommand{\showC}[1]{{\tt <C{}>#1</C{}>}}
\newcommand{\showCT}[1]{{\tt <C{}T>#1</C{}T>}}
\newcommand{\showE}[1]{{\tt <E{}>#1</E{}>}}
\newcommand{\showET}[1]{{\tt <E{}T>#1</E{}T>}}
\newcommand{\SE}{{\tt <S>}}
\newcommand{\eSE}{{\tt </S>}}
\newcommand{\TR}{{\tt <T>}}
\newcommand{\eTR}{{\tt </T>}}
\newcommand{\ST}{{\tt <ST>}}
\newcommand{\eST}{{\tt </ST>}}

\font\logo=logo10 scaled \magstep1
\def\MF{{\logo METAFONT}}
\begin{document}
\title{<S>ser.t=a'</S> \emph{\st} -- a font for Syriac (Aramaic)}
\author{Johannes Heinecke}
\date{Version \SertoVersion, 9\textsuperscript{th} March 2025}
\maketitle

\tableofcontents

\section{Introduction}

\emph{\st} is a form of the alphabet used for Aramaic (a
western semitic language) which has been spoken
in the Near East since at least 1100 BC. More precisely, \st\ is used for
Syriac which is the variant of Aramaic spoken since the second century
AD.\footnote{See \citeNP{ungnad1932},
\citeNP{brockelmann1960}, \citeNP{costaz1986} or \citeNP{noeldeke1986}
(English translation \citeNP{noeldeke2001}) for further
information on Syriac.}

Syriac used other alphabets as well, notably \emph{Es\d
trangelo}, which is indirectly contained in this package (for use with
\XeLaTeX\ only, see below). Since \st{} is,
as the Arabic alphabet, a syllabic script, vowels are marked by
diacritic marks above (or under) the consonantic letters.
Modern forms of Aramaic still use either \st{}, the Chaldean alphabet
or Es\d trangelo.
Since Syriac split up in two main dialects in the fifth century AD,
two differing systems of vowel-marking were established: Whereas the
western dialect (Edessean) used Greek letters as vowel symbols, the
eastern dialects uses dots to indicate the vowels (Chaldean vowels).

This package enables you to typeset words or paragraphs in \st{} using a
preprocessor which chooses the correct letter form depending on
context. In order to typeset paragraphs the use of a 
recent version of \pdflatex\  is needed, which
can handle the right-to-left typesetting.
For older version of \LaTeX,  the preprocessor must be used with the
option {\tt -o} (see section \ref{prep}).

This package also includes an adapted version of a  Chaldean font (thanks to Tony 
Khoshaba, who put this font to the Web).

In order to use the Es\d trangelo alphabet, you have to use \XeLaTeX\
instead of pdf\LaTeX, and install the font \emph{Estrangelo Edessa}. 
For copyright reason, this font cannot be
included in this package\footnote{The font can be easily found on the
  Web, or downloaded at
\url{https://fontzone.net/download/estrangelo-edessa}}.
The support for Es\d trangelo is still experimental.

%<S>qa.t.tel qa.tel</S>

%<S> ^sapiyr biy^s l=ak .</S>

\section{The alphabets}

Every letter in \st{} (and some letters in the Chaldean alphabet and Es\d trangelo)
has several forms, depending on its position in
the word: An initial, medial or final form. Since some letters do not
connect to the following letter, there are isolated forms as well
(i.e. a letter which is not connected to the right nor the left).
The coding column in the following table refers to the preprocessor
described below (section \ref{prep}). If you do not want to use the
preprocessor, please refer to the encoding table in section \ref{enc}.

\subsection{Consonants}\label{consonants}

% without Estrangelo
\def\ohne{\begin{longtable}{| >{\rule[-2mm]{0pt}{9mm}}c|c|c|c| c |
                    r l | 
                    >{\it}c | >{\tt}c | }}

% with Estrangelo
\def\mit{\begin{longtable}{| >{\rule[-2mm]{0pt}{9mm}}c|c|c|c| % serto
                    c | c | % estrangelo
                    c | % chaldean
                    r l | % name (serto), name (transcript)
                    >{\it}c | >{\tt}c | }} % translit, coding

\ifxetex\mit\else\ohne\fi

\hline
\ifxetex
 \multicolumn{4}{|c|}{Ser\d to} & 
 \multicolumn{2}{c|}{Estr.} &
 & \multicolumn{2}{c|}{name} & \rm translit. & \rm coding \\
 \cline{1-6}
\else
 \multicolumn{4}{|c|}{Ser\d to} & & \multicolumn{2}{c|}{name} & \rm translit. & \rm coding \\
 \cline{1-4}
\fi
%\hline
\begin{turn}{90}isolated\end{turn} &
\begin{turn}{90}final\end{turn} &
\begin{turn}{90}medial\end{turn} &
\begin{turn}{90}initial\end{turn} & 
\ifxetex
\begin{turn}{90}isolated\end{turn} &
\begin{turn}{90}final\end{turn} &
\fi
\begin{turn}{90}Chaldean\end{turn} & & & & \endhead
\hline
<S>'</S> & <S>-'</S> &            &           &
\ifxetex
      <E>'</E> & <E>-'</E> & 
\fi
      <C>'</C> &
      <S>'=alap+</S> & <T>'=alap+</T> & \raise.2ex\hbox{$\rhook$} & ' \\
\hline
<S>b</S> & <S>-b</S> & <S>-b-</S> & <S>b-</S> &
\ifxetex
      <E>b</E> & <E>-b</E> & 
\fi
      <C>b</C> &
      <S>beyt+</S> & <T>beyt+</T> & b\footnotemark & b \\

         &           &            &           & 
\ifxetex
      <E></E> & <E>-</E> & 
\fi
<C>v</C>\footnotemark &
                   &              & v & v \\
\hline
<S>g</S> & <S>-g</S> & <S>-g-</S> & <S>g-</S> &
\ifxetex
      <E>g</E> & <E>-g</E> & 
\fi
      <C>g</C> &
      <S>g=amal</S> & <T>g=amal</T> & g & g\\
         &           &            &           &
\ifxetex
       &  & 
\fi
       <C>.g</C> &
                   &              & \d g & g \\

         &           &            &           &
\ifxetex
       &  & 
\fi
       <C>j</C> &
                   &              & j & j \\


\ifxetex
          &            &            &           &
      <E>G</E> & <E>-G</E> & 
       &
             \multicolumn{2}{r|}{<T>g=amal gar^suwniy</T>}                   & \d g & G\\
\fi


\hline
<S>d</S> & <S>-d</S> &            &           &
\ifxetex
      <E>d</E> & <E>-d</E> & 
\fi
      <C>d</C> &
      <S>d=alat+</S> & <T>d=alat+</T> & d & d\\

\ifxetex
          &            &            &           &
      <E>D</E> & <E>-D</E> & 
      <C>D</C> &
             \multicolumn{2}{r|}{dotless <T>d=alat+</T>/<T>riy^s</T>}                   & d & D\\
\fi
\hline

<S>h</S> & <S>-h</S> &            &           &
\ifxetex
      <E>h</E> & <E>-h</E> & 
\fi
      <C>h</C> &
      <S>he'</S> & <T>he'</T> & h & h\\
\hline
<S>w</S> & <S>-w</S> &            &           &
\ifxetex
      <E>w</E> & <E>-w</E> & 
\fi
      <C>w</C> &
      <S>waw</S> & <T>waw</T> & w & w \\
\hline
<S>z</S> & <S>-z</S> &            &           &
\ifxetex
      <E>z</E> & <E>-z</E> & 
\fi
      <C>z</C> &
      <S>zayn</S> & <T>zayn</T> & z & z \\
\hline
<S>.h</S> & <S>-.h</S> & <S>-.h-</S> & <S>.h-</S> &
\ifxetex
      <E>.h</E> & <E>-.h</E> & 
\fi
      <C>.h</C> &
      <S>.heyt+</S> & <T>.heyt+</T> & \d h & .h\\
\hline
<S>.t</S> & <S>-.t</S> & <S>-.t-</S> & <S>.t-</S> &
\ifxetex
      <E>.t</E> & <E>-.t</E> & 
\fi
      <C>.t</C> &
      <S>.teyt+</S> & <T>.teyt+</T> & \d t & .t\\

\ifxetex
          &            &            &           &
      <E>.T</E> & <E>-.T</E> & 
      <C>.T</C> &
             \multicolumn{2}{r|}{<T>.teyt+ gar^suwniy</T>}                   & \d t & .T\\
\fi
\hline
<S>y</S> & <S>-y</S> & <S>-y-</S> & <S>y-</S> &
\ifxetex
      <E>y</E> & <E>-y</E> & 
\fi
      <C>y</C> &
      <S>y=ad+</S> & <T>y=ad+</T> & y & y \\
\hline
<S>k</S> & <S>-k</S> & <S>-k-</S> & <S>k-</S> &
\ifxetex
      <E>k</E> & <E>-k</E> & 
\fi
      <C>k</C> &
      <S>k=ap+</S> & <T>k=ap+</T> & k & k\\
         &           &            &           &
\ifxetex
      <E></E> & <E></E> & 
\fi
       <C>_k</C> &
                   &              & \b h & \verb._k. \\

         &           &            &           & 
\ifxetex
      <E></E> & <E></E> & 
\fi
      <C>^k</C> &
                   &              & \v c & \verb.^k. \\
\hline
<S>l</S> & <S>-l</S> & <S>-l-</S> & <S>l-</S> & 
\ifxetex
      <E>l</E> & <E>-l</E> & 
\fi
      <C>l</C> &
      <S>l=amad+</S> & <T>l=amad+</T> & l & l\\
\hline
<S>m</S> & <S>-m</S> & <S>-m-</S> & <S>m-</S> & 
\ifxetex
      <E>m</E> & <E>-m</E> & 
\fi
      <C>m</C> &
      <S>miym</S> & <T>miym</T> & m & m\\
\hline
<S>n</S> & <S>-n</S> & <S>-n-</S> & <S>n-</S> &
\ifxetex
      <E>n</E> & <E>-n</E> & 
\fi
      <C>n</C> &
      <S>nuwn</S> & <T>nuwn</T> & n & n\\
\hline
<S>s</S> & <S>-s</S> & <S>-s-</S> & <S>s-</S> &
\ifxetex
      <E>s</E> & <E>-s</E> & 
\fi
      <C>s</C> &
      <S>semkat+</S> & <T>semkat+</T> & s & s\\
\hline
<S>`</S> & <S>-`</S> & <S>-`-</S> & <S>`-</S> &
\ifxetex
      <E>`</E> & <E>-`</E> & 
\fi
      <C>`</C> &
      <S>`e'</S> & <T>`e'</T> & \raise.2ex\hbox{$\lhook$} & ` \\
\hline
<S>p</S> & <S>-p</S> & <S>-p-</S> & <S>p-</S> &
\ifxetex
      <E>p</E> & <E>-p</E> & 
\fi
      <C>p</C> &
      <S>pe'</S> & <T>pe'</T> & p & p \\
         &           &            &           & 
\ifxetex
      <E></E> & <E></E> & 
\fi
      <C>f</C> &
                   &              & f & f \\
\hline
<S>.s</S> & <S>-.s</S> &          &           &
\ifxetex
      <E>.s</E> & <E>-.s</E> & 
\fi
      <C>.s</C> &
      <S>.s=ade'</S> & <T>.s=ade'</T> & \d s & .s\\
\hline
<S>q</S> & <S>-q</S> & <S>-q-</S> & <S>q-</S> &
\ifxetex
      <E>q</E> & <E>-q</E> & 
\fi
      <C>q</C> &
      <S>q=ap+</S> & <T>q=ap+</T> & q & q \\
\hline
%\newpage
%\hline
<S>r</S> & <S>-r</S> & <S>-r-</S> & <S>r-</S> &
\ifxetex
      <E>r</E> & <E>-r</E> & 
\fi
      <C>r</C> &
      <S>riy^s</S> & <T>riy^s</T> & r & r \\
%\hline
<S>R</S> & <S>-R</S> & <S>-R-</S> & <S>R-</S> &
\ifxetex
      <E></E> & <E></E> & 
\fi
      <C>R</C> &
                   &  & r & R\\


\ifxetex
          &            &            &           &
      <E>R</E> & <E>-R</E> & 
         &
             \multicolumn{2}{r|}{dotless <T>d=alat+</T>/<T>riy^s</T>}                   & r & R\\
\fi
\hline

\hline
<S>^s</S> & <S>-^s</S> & <S>-^s-</S> & <S>^s-</S> &
\ifxetex
      <E>^s</E> & <E>-^s</E> & 
\fi
      <C>^s</C> &
      <S>^siyn</S> & <T>^siyn</T> & \v s & \verb.^s.\\
\hline
<S>t</S> & <S>-t</S> &            &           &
\ifxetex
      <E>t</E> & <E>-t</E> & 
\fi
      <C>t</C> &
 <S>taw</S> & <T>taw</T> & t & t\\
         &           &            &           & 
\ifxetex
      <E></E> & <E>-</E> & 
\fi
      <C>_t</C> &
                   &              & \b{t} & \verb._t. \\

\hline
\end{longtable}
%\end{tabular}

\addtocounter{footnote}{-1}
\footnotetext{The \emph{be\=ga\b dke\=pa\b t} are not yet always processed.
In general, the doubling of the consonant creates a <ST>qu^s^s=ay=a'</ST> in
the syriac text and does not change the
transliteration. On the other hand, a consonant followed by {\tt+} will
receive a <ST>ruwkk=ak+=a'</ST> and in the transliteration \emph{bgdkft}
will appear as \emph{\b b\=g\b d\b h\=p\b t}.}

\stepcounter{footnote}
\footnotetext{Modern Aramaic dialects using the Chaldean alphabet have 
diacritic symbols (dots and tildes) which can be typeset directly.}


\subsection{Vowels}\label{vowels}

The package allows to typeset the greek vowels or Chaldean vowels symbols. 
To have the vowel symbol written in inversed form
under the consonant, user upper case input.


%\begin{quote}
%{\bf ATTENTION:} I had to change the coding of <T>zq=ap+=a'</T>
%(<S>_=a</S>) from {\tt o} to \verb.=a. in order to accomodate the new
%letter <S>_o</S> (coding {\tt o}). In texts encoded up to version 0.4
%{\tt o} has to be replaced by \verb.=a. Sorry for any
%inconveniances.
%\end{quote}


\begin{tabular}[t]{| >{\rule[-3mm]{0pt}{11mm}}c | c | r l |  c | >{\tt}c |}
\hline
Greek & Chaldean & \multicolumn{2}{c|}{name} & \rm transliteration & \rm coding \\
%form & form & & & & \\
\hline
<S>_a</S> & <S>_:a</S> & <S>pt+=a.h=a'</S>  & <T>pt+=a.h=a'</T>  & <T>a</T> & a \\
\hline
<S>_e</S> & <S>_:e</S> & <S>rb+=a.s=a'</S>  & <T>rb+=a.s=a'</T>  & <T>e</T> & e \\
\hline
          & <S>_:E</S> & <S>rb+=a.s=a' arrik=a'</S>  & <T>rb+=a.s=a'  arrik=a'</T>  & <T>E</T> & E \\
\hline
<S>_i</S> & <S>_:i</S> & <S>.hb+=a.s=a'</S> & <T>.hb+=a.s=a'</T> & <T>i</T> & i \\
\hline
<S>_=a</S> & <S>_:=a</S> & <S>zq=ap+=a'</S> & <T>zq=ap+=a'</T>   & <T>=a</T> & =a \\
\hline
<S>_u</S> & <S>_:u</S> & <S>`.s=a.s=a'</S>  &  <T>`.s=a.s=a'</T> & <T>u</T> & u \\
\hline
<S>_o</S> & <S>_:o</S> &                &                  & <T>=a</T> & o \\
\hline
<S>_P</S> &            & <S>sy=a--Pme'</S> & <T>sy=a--Pme'</T> &   & P \\
\hline
\end{tabular}
~~~~~~
\begin{tabular}[t]{| >{\rule[-4mm]{0pt}{11mm}}c | >{\tt}c |}
\hline
Greek &  \rm coding \\
%form &   \\
\hline
<S>_A</S> &  A \\
\hline
<S>_E</S> &  E \\
\hline
<S>_I</S> &  I \\
\hline
<S>_=A</S> &  =A \\
\hline
<S>_U</S> &  U \\
\hline
\end{tabular}

Note: The <T>.hb+=a.s=a'</T> and <T>`.s=a.s=a'</T> of the Eastern or
Chaldean vowels do in general occur together with a \emph{mater
lectionis}:
<S>l:iy</S>, <S>l:ow</S> (or <C>l:iy</C>, <C>l:ow</C>)


The <ST>sy=a--Pme'</ST> is processed as a vowel sign, even if it is not so
from a linguistic point of view. Its coding \showS{P} is chose because
of its plural signification. If you do not want it over a letter, put
it over a word stretch: The Aramaic at the beginning of this paragraph 
has been typset in the following: \showS{sy=a--Pme'}.


To avoid that the simple preprocessor does not mess about
with vowels in ligatures (notably \emph{L\=ama\b d-\=alaf}
and \emph{\=Alaf-l\=ama\b d} the vowel must be set after both
consonants of the ligature:

\showS{l=a'} yields (incorrect) <ST>l=a'</ST>
but \showS{l'=a} yields the vocalized ligature <ST>l'=a</ST>

\showS{'Al=Ah=a'} yields (incorrect) <ST>'Al=Ah=a'</ST>
but \showS{'la=Ah=a'} yields the vocalized ligature <ST>'la=Ah=a'</ST>

The Chaldean letters do not have this ligature. Instead, a
<T>taw-=al=af</T> ligature is provided: 
<CT>sipr=ayuwt'a</CT>

The default vowels are the greek-based vowels. In order to get
Chaldean vowels, it suffices to add {\tt:} in front of the vowel in
coding.
Thus you can set the most famous Aramaic phrase in all Syriac
alphabets in either vowel system:

\showS{eliy eliy lm=an=a' s=ab=akt=aniy}\\
<S>eliy eliy lm=an=a' s=ab=akt=aniy</S>

\showS{:el:iy :el:iy lm:=an:=a' s:=ab:=akt:=an:iy}\\
<S>:el:iy :el:iy lm:=an:=a' s:=ab:=akt:=an:iy</S>

\showC{eliy eliy lm=an=a' s=ab=akt=aniy}\\
<C>eliy eliy lm=an=a' s=ab=akt=aniy</C>

\showC{:el:iy :el:iy lm:=an:=a' s:=ab:=akt:=an:iy}\\
\hfill <C>:el:iy ':el:iy lm:=an:=a' s:=ab:=akt:=an:iy</C>

\ifxetex
\showE{':el:iy ':el:iy lm:=an:=a' s:=ab:=akt:=an:iy}\\
\hfill <ET>':el:iy ':el:iy lm:=an:=a' s:=ab:=akt:=an:iy</ET>
\fi

For Estrangelo the same vowel codings can be used



\subsection{Transliteration and long vowels}

As mention in section \ref{prep} below, the preprocessor can produce a
transliteration as well. The transliteration can be defined in the
table used by the preprocessor {\tt serto.font} and {\tt assyr.font}. The current
definition uses the transcription as shown in the tables in sections
\ref{consonants} and \ref{vowels}, with the exception of long vowels.
In words using a vowel symbol together with a \emph{mater lectionis},
the transliteration shows the transcription instead, for instance
<S>.heyt+</S> transliterates as <T>.heyt+</T> and not \emph{\d hey\b
t} and <ST>q=aye'm</ST>:

\begin{tabular}{| >{\rule[-4mm]{0pt}{11mm}}r | r | c | >{\tt}c |}
\hline
Greek & Chaldean &  \rm transliteration & \rm coding \\
\hline
<S>--=a'</S> & <C>--:=a'</C> & <T>_=a'</T> & =a' \\
\hline
<S>--ey</S>  & <C>--:ey</C>  & <T>_ey</T> & ey \\
\hline
<S>--e'</S>  & <C>--:e'</C>  & <T>_e'</T> & e' \\
\hline
<S>--iy</S>  & <C>--:iy</C>  & <T>_iy</T> & iy \\
\hline
<S>--uw</S>  & <C>--:uw</C>  & <T>_uw</T> & uw \\
\hline
\end{tabular}



\subsection{Punctuation and paragraph marks}

\begin{tabular}{| >{\rule[-4mm]{0pt}{11mm}}c | >{\tt}c |}
\hline
form  & \rm coding \\
\hline
<S>.</S> &  . \\
\hline
<S>:</S> &  : \\
\hline
<S>.X.</S> & .X. \\
\hline
<S>.:.</S> & .:. \\
\hline
\end{tabular}
~~~~~~~
\begin{tabular}{| >{\rule[-4mm]{0pt}{11mm}}c | >{\tt}c |}
\hline
form  & \rm coding \\
\hline
<S>:: </S> & ::  \\
\hline
<S>:- </S> & :-  \\
\hline
<S>.~. </S> & \verb:.~.:  \\
\hline
<S>./.</S> & ./. \\
\hline
\end{tabular}
\ifxetex
~~~~~~~
\begin{tabular}{| >{\rule[-4mm]{0pt}{11mm}}c | >{\tt}c |}
\hline
Estrangelo  & \rm coding \\
\hline
<E>. </E> & .  \\
\hline
<E>: </E> & :  \\
\hline
<E>.:. </E> & \verb:.:.:  \\
\hline
<E>.X.</E> & .X. \\
\hline
\end{tabular}
\fi

\subsection{Unicode}

This package has a limited Unicode support in that texts encoded in UTF8
can be directly typeset. In order to activate the UTF8 interpretation, either
use UTF8 for your whole document by declaring \verb+\usepackage[utf8]+\verb+{inputenc}+
in the preamble of you document, or just put
\verb+%\usepackage[utf8]+\verb+{inputenc}+ somewhere at the beginning of your document.

\subsection{The encoding}\label{enc}

\def\cell#1{\char'#1}

\def\cellrow#1{
&  \cell{#10} & \cell{#11} & \cell{#12} & \cell{#13} &
\cell{#14} & \cell{#15} & \cell{#16} & \cell{#17} \\ \hline}

\def\reihe#1{\it '#10 \cellrow{#1}}



\def\xcell#1{\char"#1}
\def\xcellrow#1{
& \xcell{#10} & \xcell{#11} & \xcell{#12} & \xcell{#13} &
  \xcell{#14} & \xcell{#15} & \xcell{#16} & \xcell{#17} &
  \xcell{#18} & \xcell{#19} & \xcell{#1A} & \xcell{#1B} &
  \xcell{#1C} & \xcell{#1D} & \xcell{#1E} & \xcell{#1F} \\ \hline}
\def\xreihe#1{\it "#1n \xcellrow{#1}}

The following table shows the internal encoding of the
defined letters of \st\ and the Chaldean variant.

\newif\ifhextabelle
\hextabelletrue
%\pdfoutput\undefined\pdffalse\else\pdftrue\fi

\ifhextabelle
{\serto
\begin{tabular}{ r || c | c | c | c | c | c | c | c | 
                      c | c | c | c | c | c | c | c | }
& \it 0 & \it 1 & \it 2 & \it 3 & \it 4 & \it 5 & \it 6 & \it 7  
 & \it 8 & \it 9 & \it A & \it B & \it C & \it D & \it E & \it F  \\
\hline\hline
\xreihe{0}
\xreihe{1}
\xreihe{2}
\xreihe{3}
\xreihe{4}
\xreihe{5}
\xreihe{6}
\xreihe{7}
\xreihe{8}
\xreihe{9}
\xreihe{A}
%\xreihe{B}
%\xreihe{C}
%\xreihe{D}
%\xreihe{E}
%\xreihe{F}
\end{tabular}}


{\assyr
\begin{tabular}{ r || c | c | c | c | c | c | c | c | 
                      c | c | c | c | c | c | c | c | }
& \it 0 & \it 1 & \it 2 & \it 3 & \it 4 & \it 5 & \it 6 & \it 7  
 & \it 8 & \it 9 & \it A & \it B & \it C & \it D & \it E & \it F  \\
\hline\hline
\xreihe{0}
\xreihe{1}
\xreihe{2}
\xreihe{3}
\xreihe{4}
\xreihe{5}
\xreihe{6}
\xreihe{7}
\xreihe{8}
\xreihe{9}
\xreihe{A}
%\xreihe{B}
%\xreihe{C}
%\xreihe{D}
%\xreihe{E}
%\xreihe{F}
\end{tabular}}

\else


{\serto
\begin{tabular}{ r || c | c | c | c | c | c | c | c | }
& \it 0 & \it 1 & \it 2 & \it 3 & \it 4 & \it 5 & \it 6 & \it 7  \\
\hline\hline
\reihe{00}
\reihe{01}
\reihe{02}\reihe{03}
\reihe{04}
\reihe{05}%\reihe{06}
\reihe{07}
\reihe{10}\reihe{11}
\reihe{12}\reihe{13}%\reihe{14}
\reihe{15}\reihe{16}
\reihe{17}
\reihe{20}
\reihe{21}
\reihe{22}
\reihe{23}
\reihe{24}
\reihe{25}
\end{tabular}}



{\assyr
\begin{tabular}{ r || c | c | c | c | c | c | c | c | }
& \it 0 & \it 1 & \it 2 & \it 3 & \it 4 & \it 5 & \it 6 & \it 7  \\
\hline\hline
\reihe{00}
\reihe{01}
\reihe{02}
\reihe{03}
\reihe{04}
\reihe{05}
%\reihe{06}
\reihe{07}
\reihe{10}
\reihe{11}
\reihe{12}
\reihe{13}
\reihe{14}
\reihe{15}
\reihe{16}
\reihe{17}
%\reihe{20}
%\reihe{21}
%\reihe{22}
%\reihe{23}
%\reihe{24}
%\reihe{25}
\end{tabular}}
\fi

\urlstyle{same}

\section{The preprocessor {\tt serto[2].py}}\label{prep}

Typesetting of texts is still not yet possible with standard \LaTeX, since the
right-to-left typesetting (as for
instance as in Arab\TeX) has not yet been implemented. For the time
being I propose a preprocessor (written in {\sc
Python}\footnote{Every version from 2.4 onwards up to version 2.7 should do for {\tt serto2.py}; for {\sc Python 3.*} use {\tt serto.py}.})
and \pdflatex\footnote{\XeLaTeX{} can handle UTF-8. However I have not yet adapted this package to \XeLaTeX.}.

I'm well aware that {\tt serto[2].py} is not part of the most beautiful pieces
of software code, on the contrary, it's rather spaghetti code. Many things could
have been in a more intelligent way, but it works, which is the most important thing.
If you find the time to improve it please share your changes with me!


\subsection{Using the preprocessor}

The preprocessor is called with the \LaTeX-file as argument:

\verb|   serto.py [-o] ppfilename.tex > filename.tex|

The resulting \LaTeX-file can be \LaTeX ed as usually. Please make
sure to have the \verb.\usepackage{serto}. included in your preamble.

The option {\tt -o} is necessary if you use an older version of \LaTeX\ which is
not capable to typeset texts from the right to the left (\texxet{} extension). The {\tt -o}
-option tells the preprocessor to inverse the letters on its
own. In order to typeset whole paragraphs \pdflatex\ is the better
solution. Usually it comes with every modern \TeX-distribution.
At least since Ubuntu 12.04 (texlive package), the standardly installed \pdflatex\ behaves correctly.

The preprocessor recognizes two types of commands. Within a
single line you can put Syriac words between \SE\ and \eSE:
For example \showS{ser.t=a'} becomes <S>ser.t=a'</S>.

\ST\ and \eST\ generate the enclosed part in \st\ and
generates a transliteration as well
(\showST{mdiyt=a'} becomes <ST>mdiyt=A'</ST> ``city''),
whereas \TR\ and \eTR\ can be used for parts only need in
transliterated form (\showT{ser.t=a'} becomes <T>ser.t=a'</T>).
Since in transliteration a ``neutral vowel'' is needed, which does not
appear in \st, the code \verb.@. can be used:
\showST{\^{}s\symbol{64}m=a`} produces <ST>^s@m=a`</ST>

For multiple lines, start a block using {\tt <SERTO>}\footnote{Using
{\tt <SERTO>} or {\tt <TRANS>} cannot work correctly with the {\tt -o}
option of the preprocessor {\tt serto.py}. Use {\tt <CHALDEAN>} \dots{}
{\tt </CHALDEAN>} and
{\tt <ESTRANGELO>} \dots{} {\tt <ESTRANGELO>} for the Chaldean or
Estrangelo alphabets.}
in a line on its
own. This block must be closed by a line containing {\tt </SERTO>}.
%To have a block in \st\ and in transliterated form, use {\tt
%<SERTOTRANS} and {\tt </SERTOTRANS>}.
If you need transliterated Syriac,
use {\tt </TRANS>} and {\tt </TRANS>}. The commands {\tt <SERTO>}/{\tt
</SERTO>} and {\tt </TRANS>}/{\tt </TRANS>} do not work properly with the
{\tt -o} option of the preprocessor and and older \LaTeX. If you add
\TeX-commands in these blocks, a right-to-left typesetting version of \LaTeX\ is obligatory.




For the time being the preprocessor tries to set the hard sign
<ST>qu^s^s=ay=a'</ST> %\emph{qu\v s\v s\=oy\=o}
on top of a consonant if the consonant
is doubled in the input:

\showS{q.tl} yields <S>q.tl</S>
but \showS{q.t.tl} yields <S>q.t.tl</S>

In cases where you need a <ST>qu^s^s=ay=a'</ST> %\emph{qu\v s\v s\=oy\=o}
without wanting to double the consonant, a {\tt *} can be used after
the letter to typeset a dot above a letter: \showS{h*=anon} produces
<ST>h*=anon</ST> and \showS{\^{}sl=amk+on} results in <ST>^sl=amk+on</ST>

%<ST>wadd*=ame'</ST>

To avoid a <T>qu^s^s=ay=a'</T> (when you need to adjacent identical consontants, either use 
a vowel on the first, 
use the stretching symbol: 

\showS{maml'e} yields <ST>maml'e</ST>\\
{\tt <S{}>m\verb.^.ml'</S{}>} yields <ST>m^ml'</ST>\\
\showC{maml'e} yields <CT>maml'e</CT>\\
{\tt <C{}>m\verb.^.ml'</C{}>} yields <CT>m^ml'</CT>\\


To get the soft sign <ST>ruwkk=ak+=a'</ST> %\emph{rukk\=o\b h\=o}
a {\tt +} must \emph{follow} the letter:
\showS{'ab+d=a'} yields <S>'ab+d=a'</S>


An \emph{\=alaf} is autmatically prefixed before an initial vowel:

\showS{etqa.tel} and \showS{'etqa.tel} both yield <S>etqa.tel</S>

Sometimes the letter \emph{r\=\i\v s} is written with two points. To
achieve this, use {\tt R} instead of {\tt r} in the input:

\showS{\^{}sapiyRe'} yields <S>^sapiyRe'</S>

Silent consonants have a bar <ST>mb+a.tl=an=a'</ST> %\emph{mva\d tl\=on\=o}
(\emph{linea occultans})
under the line which is produced by {\tt =} just before the consonant 
(attention {\tt =a}, however, yields <S>=a</S>:

\showS{'an=tt} yields <S>'an=tt</S>

In order to have the \emph{linea occultans} on top of the letter, use {\tt ==}:

\showS{h==wiyt} yields <S>h==wiyt</S>

There is no automatic stretching yet, but the \verb.--. can be used to
insert a ``manual stretch'':

\showS{napiyqt=a'} becomes <S>napiyqt=a'</S> but
\showS{na-{}-piyq-{}-t=a'} is printed as <S>na--piyq--t=a'</S>

This works also for the Chaldean letters
\showC{n:ap:iyqt:=a'} becomes <C>n:ap:iyqt:=a'</C> but
\showC{n:a-{}-p:iyq-{}-t:=a'} is printed as <C>n:a--p:iyq--t:=a'</C>

If you do not use the preprocessor, you can activate \st\ by the
command \verb.\serto.. In this case you have to choose the correct
letters yourself, and use the commands
\verb.\upperserto{.\emph{vowelnumber}\verb.}{.\emph{letter}\verb.}. or
\verb.\lowerserto{.\emph{vowelnumber}\verb.}{.\emph{letter}\verb.}. to
set vowels. Please see the encoding table in section \ref{enc} for the
correct vowel numbers.

In order to get bold letters, you can use \verb.\sertob. with or
without preprocessor (see section \ref{prep} for more information
on the preprocessor.

\section{The format of the {\tt*.font} files}

These files are necessary to tell the preprocessor where (in the font) 
a certain letter is found, and whether it has different forms. The
format is straight forward, with, however, a few idiosynchrasies.
In general there are two sections, the first (starting with a line
\verb.#FONT.) indicates which letter has which form in which position
and a second (\verb.#TRANS.) to define the transcription.

The first part consists of lines like the following\\
\verb.b beth 66+124 66 66 66+124 1.\\
which reads, coding \verb.b. is for the letter \emph{beth}, its
isolated form is character 66 followed by character 124, its initial
and medial form is character 66, it's final form is character 66
followed by character 124 and the next letter (if any) must take it's
medial form.

However, if one of the four last columns has a value of $-1$, no form
is provided in the font.
Values from 0 to 15 are reserved for accents/vowels above the line,
values from 16 to 31 are reserved for vowels under the line.

The lines

\verb. ~  blank   32 32 32 32 0.\\
\verb. Q  shadda  6 6 6 6 2.\\
\verb. -- stretch 45 45 45 45 1.\\

must not be deleted.

The coding for digits (starting with 0 up to 9 in the first column
cannot have the \verb.+. in the position definition

The transcription definition defines for each coding symbol (defined
in the font-section) a valid \TeX-string to be used if transcription
is needed, e.g.

\verb- .t \d{t}-

i.e. the coding \verb-.t- will be representend by \emph{\d{t}} in
transcribed portions.

\section{Two examples}

Some of the following can be found in {\tt example.ptex}
which comes
with this package.
%If you do not have \elatex, you cannot set texts in \st\ but only
%single words.


The following input was used to generate the output below:


\begin{quote}\small
\begin{verbatim}
\documentclass[12pt,a4paper]{article}
usepackage{serto}

\begin{document}
\end{verbatim}

\begin{alltt}
<S{}>men qadiy^se' ho' tetqada^s</S{}>

<S{}T>kmo' dat+basb@suwn pagdo'</S{}T>
\end{alltt}

\begin{verbatim}
\end{document}
\end{verbatim}
\end{quote}


\begin{quote}
<S>men qadiy^se' h=a' tetqada^s</S>

<ST>km=a' dat+basb@suwn pagd=a'</ST>
\end{quote}



%In order to set more than just words
%\elatex\ (needed for the \texxet\ extension) must be used.
%\elatex\ properly sets text from the right to the left.

A long example in Ser\d to:

\begin{quote}
<SERTO>
wk=ad .hzaw kuwmd'e da.h.tIyt=A': medem da`bad na.siy.h=a':
lAbkuwh=y= wa'sruwh=y= wa'ytIywh=y= qd=am malk=a'.
we'^stA`iyw lmalk=a' me----dem da`bad {\sertob l'Al=Ahayhwn}. m=alk=a'
deyn 'ema----r. l'=a hw=a' me^stAwd=ay=aw 'e^stEwdiyt lIy dtEdba.h
l'Ap=aluw: na.siy.h=a' 'emar. liy 'la=Ahe' 'ayleyn dma't`eyn. l'=a
hw=a' 'la=Ahe' 'Enuwn. qareb 'Enuwn lIy lh=ark=a'.
\sertob wl'=A
^suwbh=adhuwn dakiys.ty=ane' l'=a ^s=abeq '=n=a' .had menhuwn
dl'=a mdaqeq '=n=a' `adm=a' lram^s=a'.
</SERTO>
\end{quote}



The preceding text was set typeset with the following
input:


\begin{quote}\small
\begin{verbatim}
\documentclass[12pt,a4paper]{article}
\usepackage{serto}
\begin{document}
\end{verbatim}
\verb.<SERTO>.
\begin{verbatim}
wk=ad .hzaw kuwmd'e da.h.tIyt=A' : medem
da`bad na.siy.h=a': lAbkuwh=y=
wa'sruwh=y= wa'ytIywh=y= qd=am malk=a'.
we'^stA`iyw lmalk=a' me----dem da`bad
{\sertob l'Al=Ahayhwn}. m=alk=a' deyn 'emar. l'=a hw=a'
me^stAwd=ay=aw 'e^stEwdiyt lIy dtEdba.h
l'Ap=aluw: na.siy.h=a' 'emar. liy 'la=Ahe'
'ayleyn dma't`eyn. l'=a hw=a' 'la=Ahe'
'Enuwn. qareb 'Enuwn lIy lh=ark=a'. \sertob wl'=A
^suwbh=adhuwn dakiys.ty=ane' l'=a ^s=abeq
'=n=a' .had menhuwn dl'=a mdaqeq '=n=a'
`adm=a' lram^s=a'.
\end{verbatim}
\verb.</SERTO>.

\verb.\end{document}.
\end{quote}

Replacing {\tt <SERTO>} by {\tt <CHALDEAN>} and \verb.\sertob. by \verb.\assyrb.
results in this

\begin{quote}
<CHALDEAN>
wk=ad .hzaw kuwmd'e da.h.tIyt=A': medem da`bad na.siy.h=a':
lAbkuwh=y= wa'sruwh=y= wa'ytIywh=y= qd=am malk=a'.
we'^stA`iyw lmalk=a' me----dem da`bad {\assyrb l'Al=Ahayhwn}. m=alk=a'
deyn 'ema----r. l'=a hw=a' me^stAwd=ay=aw 'e^stEwdiyt lIy dtEdba.h
l'Ap=aluw: na.siy.h=a' 'emar. liy 'la=Ahe' 'ayleyn dma't`eyn. l'=a
hw=a' 'la=Ahe' 'Enuwn. qareb 'Enuwn lIy lh=ark=a'.
\assyrb wl'=A
^suwbh=adhuwn dakiys.ty=ane' l'=a ^s=abeq '=n=a' .had menhuwn
dl'=a mdaqeq '=n=a' `adm=a' lram^s=a'.
</CHALDEAN>
\end{quote}

Using {\tt <ESTRANGELO>} (and deleting remaining \verb.\sertob. and \verb.\assyrb.) results in

\begin{quote}
<ESTRANGELO>
wk=ad .hzaw kuwmd'e da.h.tIyt=A': medem da`bad na.siy.h=a':
lAbkuwh=y= wa'sruwh=y= wa'ytIywh=y= qd=am malk=a'.
we'^stA`iyw lmalk=a' me----dem da`bad l'Al=Ahayhwn. m=alk=a'
deyn 'ema----r. l'=a hw=a' me^stAwd=ay=aw 'e^stEwdiyt lIy dtEdba.h
l'Ap=aluw: na.siy.h=a' 'emar. liy 'la=Ahe' 'ayleyn dma't`eyn. l'=a
hw=a' 'la=Ahe' 'Enuwn. qareb 'Enuwn lIy lh=ark=a'.
wl'=A
^suwbh=adhuwn dakiys.ty=ane' l'=a ^s=abeq '=n=a' .had menhuwn
dl'=a mdaqeq '=n=a' `adm=a' lram^s=a'.
</ESTRANGELO>
\end{quote}

The file was preprocessed using {\tt serto3.py} and then typeset with \XeLaTeX.

\section{Things still missing}

The todo-list is long. I try to add features etc. as soon as possible.
Please tell me items you would like to have, but which are not yet on
this list. Any volunteers are welcome!


\begin{itemize}
\item proper typsetting of texts (without preprocessor,
maybe in the Arab\TeX\ package)
\item proper treatment of \emph{matr\=es lectionis} (long vowels)
%\item treatment of the <ST>sy=ame'</ST> %\emph{sey\=om\=e}
\item proper treatment of the silent bar <ST>mb+a.tl=an=a'</ST>
%\emph{mva\d tl\=on\=o}
\item proper treatment of \emph{be\=ga\b dke\=pa\b t} with
hard sign <ST>qu^s^s=ay=a'</ST> %\emph{qu\v s\v s\=oy\=o}
and soft sign <ST>ruwkk=ak+=a'</ST> %\emph{rukk\=o\b h\=o}
\item automatic transcription mode
\item interpunction
\item proper dealing with ligatures
%\item Chaldean vowels
%\item unicode input
\item <ST>'es.trangel=a'</ST> %and Chaldean glyphs
\item numbers
%\item support for typical encodings and for unicode (UTF-8) either via
%%the preprocessor or via
the \verb:inputenc.sty: package.
%\item creating Type 1 fonts from the \MF-sources
\item support for existing Syriac fonts
\end{itemize}

\section{Installation}

The easiest way to install the fonts and the preprocessor is by installing
the debian package (this includes only the {\tt pfb}, {\tt tfm} and {\tt afm} files for the fonts),
the needed styles and the preprocessor, but not the \MF{} sources:

{\verb+   +\tt sudo dpkg -i serto-\SertoVersion.deb}

If you are not on a Debian or Ubuntu plateform, you need to install
manually from the {\tt .tgz} file:


\subsection{Using Metafont sources}
Put the {\tt *.mf} files into a subdirectory {\tt serto} of your
metafont branch in your {\tt texmf}-directory. For example using
the texlive distribution under Linux, you should put them into
{\tt\url{/usr/local/share/texmf/fonts/source/serto/}}. Do not forget to call {\tt texhash}
in order to make the tex software find the newly installed fonts.

\subsection{Using vector fonts}
Using vector fonts depends a little from the \TeX-installation used, the following
is tested for Ubuntu 12.04 and 10.04, it will probably work on Debian platforms as well, or
other platforms using the texlive installation.

\begin{itemize}
  \item copy {\tt syriac.map} to {\tt /usr/local/share/texmf/fonts/map/dvips/config/}
  \item copy {\tt *.afm} to {\tt /usr/local/share/texmf/fonts/afm/syriac/serto/}
  \item copy {\tt *.pfb} to {\tt /usr/local/share/texmf/fonts/type1/syriac/}
  \item add {\tt Map syriac.map} to {\tt /etc/texmf/updmap.d/10local.cfg}
  \item run {\tt sudo update-updmap}
  \item run {\tt sudo updmap-sys}
\end{itemize}


\subsection{Other Files}
The Stylefile etc. {\tt *.sty}, {\tt *.fd} go into a directory for
stylefiles,
e.g. \url{/usr/local/share/texmf/tex/latex/serto/}.

The preprocessor {\tt serto.py} and the encoding file {\tt
serto.font} somewhere where it can be found (e.g
{\tt \url{/usr/local/bin}}). They must reside in the same directory unless you specify
in the environment variable {\tt SERTOFONTDIR} the directory containing
{\tt serto.font} and {\tt assyr.font}.
Possibly you have to adjust the first line
of the preprocessor \verb.#!/usr/bin/python. if your python
interpreter is somewhere else. 

In order to typeset using Estrangelo, an external (Unicode encoded) font has to be downloaded.
The examples in this document use \emph{Estrangelo Edessa} designed by Paul Nelson and George Kiraz and copyrighted by the 
Syriac Computing Institute. For copyright reasons this font is not included in this package. Once you have downloaded the {\tt .ttf} file, install it with your system fonts (in both Linux (Ubuntu) and Windows, clicking on the file name usually opens a font viewer application which allows the (local) installation. Note, that Estrangelo only works with \XeLaTeX\ and 
its {\tt fontspec}-package.

If you use a different font, adapt {\tt estrangelo.sty} accordingly.

\section{License}

This Material is subject to the LaTeX Project Public License 1.3 
(\url{http://ctan.org/license/lppl1.3}).

\section{Changelog}

\begin{itemize}
\item Version 1.3.2
  \begin{itemize}
  \item added Chaldean vowel <CT>rb+:=a.s:=a' ':arr:=ik:=a'</CT>: <C>m:E</C>
  \item documentation updated
  \end{itemize}
\item Version 1.3
  \begin{itemize}
  \item documentation updated
  \item error in loading {\tt *.font}-files corrected
  \item {\tt serto.py} (for {\sc Python3}), no more support for {\sc
      Python2} any more.
  \end{itemize}
\item Version 1.1
  \begin{itemize}
  \item encoding script for {\sc Python3}: {\tt serto3.py}
  \item experimental Estrangelo support using a {\tt .ttf} (needs to
    be downloaded)
  \end{itemize}
\item Version 1.0
  \begin{itemize}
  \item adding a character for the \emph{linea occultans} above the letter
  \item {\tt SERTOFONTDIR} enviromnment variable to specify the directory of {\tt *.font} files
  \item some UTF8 support
  \end{itemize}
\item Version 0.7
  \begin{itemize}
  \item Chaldean vowels
  \item Integration of the Chaldean font provided by Tony Khoshaba
  \item Major adjustements to the {\tt serto.py} preprocessor
  \end{itemize}
\item Version 0.2, 0.3 and 0.4
  \begin{itemize}
  \item can't remember, didn't keep track of changelog those days\dots
  \end{itemize}
\item Version 0.1
  \begin{itemize}
  \item Initial version
  \end{itemize}
\end{itemize}

\bibliographystyle{engl}
\bibliography{buch}


\end{document}
