\documentclass{article}
\usepackage[english]{babel}
\usepackage{arabtex}

\textwidth=13.7cm\textheight=21.5cm
\oddsidemargin=0mm\evensidemargin=0mm\topmargin=0mm

\lineskip=0pt
\lineskiplimit=-.8\baselineskip

\pagestyle{empty}

\newcommand\rawarab[1]{{\fontencoding{U}\fontfamily{xnsh}\selectfont\char'#1\relax}}

\begin{document}
\setverb\setnash
\hyphenpenalty=10000
\sloppypar

% <k--l> \rawarab{311}\rawarab{004}\rawarab{273}

\section*{Use of arabtex}
Arabtex is a very nice package for typesetting Arabic using TeX or LaTeX.
However, it is a little too smart, and working with it is like typing a
book on a typewriter that has its own opinions about spelling and sometimes
even about the subject matter of the book.

So, it is good that there is a verbatim mode that allows one to say
more precisely what one wants to see on paper.
Below some docs on this verbatim mode.

Verbatim mode is activated by \verb#\setverb# and left again by
\verb#\setarab#.

The 28 Arabic letters, together with the required arabtex input,
are given below.

\medskip
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\rule[-6pt]{0pt}{16pt}
<A> & <b> & <t> & <_t> & <j> & <.h> & <_h> &
<d> & <_d> & <r> & <z> & <s> & <^s> & <.s> \\
\hline
\verb#A# & \verb#b# & \verb#t# & \verb#_t# & \verb#j# & \verb#.h# & \verb#_h# &
\verb#d# & \verb#_d# & \verb#r# & \verb#z# & \verb#s# & \verb#^s# & \verb#.s#\\
\hline
\hline
\rule[-7pt]{0pt}{17pt}
<.d> & <.t> & <.z> & <`> & <.g> & <f> & <q> &
<k> & <l> & <m> & <n> & <h> & <w> & <y> \\
\hline
\verb#.d# & \verb#.t# & \verb#.z# & \verb#`# & \verb#.g# & \verb#f# & \verb#q# &
\verb#k# & \verb#l# & \verb#m# & \verb#n# & \verb#h# & \verb#w# & \verb#y# \\
\hline
\end{tabular}
\end{center}

A few foreign letters:\smallskip
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
<p> & <v> & <^c> & <,c> & <^z> & <g> & <c> & <^n> & <^l> & <.r> \\
\hline
\verb#p# & \verb#v# & \verb#^c# & \verb#,c# & \verb#^z# & \verb#g# &
\verb#c# & \verb#^n# & \verb#^l# & \verb#.r# \\
\hline
\end{tabular}
\end{center}

\medskip
Verbatim mode will select the right letter shape
(isolated, initial, medial, final), e.g.,
\verb#<h hhh># yields <\Large h hhh>.
The font knows about two shapes for a medial h, {\Large\rawarab{352}}
and {\Large\rawarab{356}}, but I do not know how to tell arabtex which
shape to use. Picking the glyph by hand does work: the above two glyphs
were obtained via \verb#\rawarab{352}# and \verb#\rawarab{356}#, after
\verb|\newcommand\rawarab[1]{{\fontencoding{U}\fontfamily{xnsh}\selectfont\char'#1\relax}}|

\medskip
The hamza with various possible carriers, and ta marbuta,
and alif maqsura:

\medskip
\def\strut{\rule{0ex}{3ex}}
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
\strut <'a> & <'i> & <'w> & <'y> & <'h> & <'B> & <'|> & <T> & <Y> \\
\hline
\verb#'a# & \verb#'i# & \verb#'w# & \verb#'y# & \verb#'h# & \verb#'B# & \verb#'|# & \verb#T# & \verb#Y# \\
\hline
\end{tabular}
\end{center}

\medskip
Various vowel signs:

\medskip
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\strut <da> & <di> & <du> & <d"> & <d*> &
<'A> & <"> & <daN> & <diN> & <duN> &
<d_a> & <d_i> & <d_u> \\
\hline
\verb#da# & \verb#di# & \verb#du# & \verb#d"# & \verb#d*# &
\verb#'A# & \verb#"# or \verb#-"# & \verb#daN# & \verb#diN# & \verb#duN# &
\verb#d_a# & \verb#d_i# & \verb#d_u# \\
\hline
\end{tabular}
\end{center}

For <">, an alif with wasla, use \verb#"# at the beginning
of a word, and \verb#-"# elsewhere.

Maybe \verb#\rawarab# is needed to get at the separate signs.
(For fatha, kasra, damma, madda, shadda, fathatan,
kasratan, dammatan, sukuun, wasla, quranalif the font indices are
013, 013, 014, 016, 017, 023, 023, 024, 025, 026, 027,
and some manoeuvering is needed to move them to the right place.)

Tatwil (kashida) is given by \verb#--# or \verb#B#.

Vowel signs can be put on kashida: \verb#<Ba># <Ba>,
\verb#<BaN># <BaN>, \verb#<|B"># <|B">, \verb#<|BB># <|BB>, etc.

Verbatim mode is broken near alif and alif maqsura.
An unwanted fatha is added to the preceding consonant,
and a quote is needed to prevent this:
\verb#'ilY#~<'ilY>, \verb#'il"Y#~<'il"Y>.\smallskip \\
When also kashida is present, it is put in the wrong place:
\verb#k--A#~<k--A>.
(Cf.\ \verb#kl# <kl>, \verb#k--l# <k--l>, \verb#kA#~<kA>,
\verb#k----A#~<k----A>, \verb#k"A#~<k"A>, \verb#<k--|"A># <k--|"A>.)

\medskip
Finally there are the ligatures, especially lam-alif.
One gets the ligature without vowel by use of the quote.

\medskip
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
<l"A> & <lA> & <l'a> & <la'a> & <l'aa> & <la'aa> &
<l'i> & <la'i> & <l'ii> & <la'ii> \\
\hline
\verb#l"A# & \verb#lA# & \verb#l'a# & \verb#la'a# & \verb#l'aa# &
\verb#la'aa# & \verb#l'i# & \verb#la'i# & \verb#l'ii# & \verb#la'ii# \\
\hline
\end{tabular}
\end{center}

\medskip

% Contrary to some docs, a + in the input seems to put a madda on
% the preceding letter, whatever it is:
% \verb#A+# <A+> \verb#b+# <b+> \verb#bay+t# <bay+t>

% \shadda and \madda do work, \sukun doesnt seem to:
% <b\shadda A\madda t\sukun y\sukun >

\end{document}
