# Syriac Abbreviation Mark

I'm trying to implement in XeLaTeX the Syriac Abbreviation Mark (see here: http://en.wikipedia.org/wiki/Syriac_Abbreviation_Mark).

The code I came up with is the following:

\catcode^^^^070f=13
\chardef\zwj="200D
\def^^^^070f#1 {\zwj\aemph{#1}\ }


Now I can use the control character in the text (assuming I have a Syriac font):

\documentclass{article}

\usepackage{polyglossia}

\setmainlanguage{syriac}

\setmainfont{Estrangelo Edessa}

\catcode^^^^070f=13
\chardef\zwj="200D
\def^^^^070f#1 {\zwj\aemph{#1}\ }

\begin{document}

ܫܠ܏ܡܳܐ ܫܠܡܐ.

\end{document}


Here is the result:

This is not perfect for two reasons. First, it requires a space to end the control sequence (in fact, it should be ended by any non-Syriac character). Second, ideally the result should be an overline with 3 dots in it (beginning, end and middle - see above Wikipedia article for example).

Could anyone help me out with this?

-
Welcome to TeX.sx! As it stands the code is completely wrong and it's difficult to understand what it should do. – egreg Apr 23 '13 at 9:01
I realized now that I could simplify the code using the \aemph command defined in Polyglossia. This would yield the following code: \catcode܏=13 \newcommand{\zwj}{‍} \def܏#1 {\zwj\aemph{#1}\ } – Ariel Apr 23 '13 at 9:18
\catcode13=  is meaningless. Or, better, it has a meaning that's surely not what you want. Also \def1# { is illegal. It seems that you're mixing left-to-right with right-to-left. – egreg Apr 23 '13 at 9:20
There is a problem here with the rendering of this Unicode character (which is Right-To-Left and thus messes up the order). It just makes the SAM character (U+070F) an active character. The second command defines \zwj as a substitute for the ZWJ character (U+200D). The last command defines the the SAM character followed by an argument and then a space as {\zwj\aemph{#1}\ }. – Ariel Apr 23 '13 at 9:25
You can use the ^ convention: \catcode^^^^070f=13 and then \def^^^^070f#1{...}; you can also say \chardef\zwj="200D which is easier. May you try it and expand to a complete example? – egreg Apr 23 '13 at 9:31

Here is a tikz method:

\documentclass{article}
\usepackage{tikz}
\usepackage{xspace}
\tikzstyle{zwj}=[inner sep=0pt,outer sep=0pt,anchor=base]
\tikzstyle{zwjdot}=[circle,draw,fill,inner sep=0pt,outer sep=0pt,minimum width=1pt]
\newcommand{\zwj}[1]{%
\tikz[baseline]{
\node[zwj] (text) {#1};
\useasboundingbox (text.base west) rectangle (text.north east);
\draw ([yshift=2ex]text.base west) -- ([yshift=2ex]text.base east)
node[pos=0,zwjdot] {}
node[pos=1,zwjdot] {}
node[pos=0.5,zwjdot] {};
}%
}
\begin{document}

\begin{tabular}{ll}
foobar         & puckluck \\
\zwj{foo}bar   & \zwj{puck}luck
\end{tabular}
\end{document}
`

At this point the descenders are changing the vertical alignment. I'll try more later.

-
The line looks beautiful, but this has the unfortunate side effect of not respecting the text order (which is Right-to-Left in Syriac). By the way, one should probably call your macro \sam as it stands for Syriac Abbreviation Mark (ZWJ = Zero-Width-Joiner, which is responsible for the contextual shaping of the letters). – Ariel Apr 23 '13 at 9:38
@Ariel: Hm.. I'll have to think more about RTL. But I did fix the baseline problem. – Matthew Leingang Apr 23 '13 at 10:00