# 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
• 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
• Ideally SAM should be implemented by the fonts, unfortunately OpenType does not have a provision for such a character (there was recently a proposal to add a new feature for it, but it can be years before such feature is widely implemented, if ever) :( – Khaled Hosny Apr 23 '13 at 12:24
• @DanielLyons: Newer versions of HarfBuzz and newer versions of the OpenType spec support it now, see github.com/behdad/harfbuzz/issues/141. Didn’t test it in XeTeX though. – Khaled Hosny May 5 '16 at 0:42

It's implemented in the font now (per Werner's question).

Random unicode input, compiled with xelatex.

MWE:

\documentclass[12pt]{article}
\usepackage{xcolor}
\pagecolor{red!3}

\usepackage{polyglossia}
%Options:
%‣ numerals = western (i.e., 1234567890), eastern (for which the Oriental Arabic
%numerals are used: ١٢٣٤٥٦٧٨٩٠), or abjad.  .
%v1.0.1
%Commands:
%\aemph ‣ \aemph (see section 6.1).

\setotherlanguage{english}

\newfontfamily\fgfontc[Scale=2.3,Script=Syriac,Colour=green]{Noto Sans Syriac Eastern}
\newfontfamily\fgfontck[Scale=2.3,Script=Syriac,Colour=blue]{Noto Sans Syriac Eastern}\newfontfamily\fgfontd[Scale=4.5,Script=Syriac,Colour=red]{Noto Sans Syriac Eastern}
\newfontfamily\fgfontdk[Scale=4.5,Script=Syriac,Colour=blue]{Noto Sans Syriac Eastern}

\setmainfont{Noto Sans Syriac Eastern}
\newfontfamily\englishfont{Noto Serif}

\begin{document}

\pagestyle{empty}

\begin{center}

\begin{english}
Syriac font,
with \textbackslash kern and \textbackslash llap commands.
\end{english}

\fgfontc ܞ܏ܞܭܬܩܨܧܦܗܡܠܡܐ\kern-1.25pt\llap{\fgfontck ܞ܏ܞܭܬܩܨܧܦܗܡܠܡܐ}

܏ܘܗܖ܏ܛܚܙ܏ܩ܏ܨܧ܏܏܏ܤ

\fgfontd  ܞ܏ܞܭܬܩܨܧܦܗܡܠܡܐ\kern-1.45pt\llap{\fgfontdk ܞ܏ܞܭܬܩܨܧܦܗܡܠܡܐ}

\end{center}

\begin{english}
Syriac font, regular and bold:
\end{english}

ܞ܏ܞܭܬܩܨܧ ܦܗܡܠܡܐ

\bfseries
ܞ܏ܞܭܬܩܨܧ ܦܗܡܠܡܐ

\mdseries\Large
ܞ܏ܞܭܬܩܨܧܦܗܡܠܡܐ

\bfseries
ܞܭܬܩ܏ܨܧ܏ܦܗܡܠܡܐ
܏ܘܗܖ܏ܛܚܙ܏ܩܨܧܤ

\end{document}


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

OpenType have already introduced 'stch' feature which used to generate this special overline, if you use some TeX engines as latest version of XeTeX you could get proper effect.

• Can you provide an example showing that? – Werner Oct 27 '16 at 3:08