ArabTeX is an excellent extension to TeX/LaTeX designed for typesetting the right-to-left scripts of the Orient. It comes up with very intuitive and comprehensible lower ASCII transliterations, the expressive power of which is even better than that of the scripts.

Since the ArabTeX notation is not a simple mapping to the graphemes of the Arabic script, encoding the script into the notation is ambiguous. Two different strings in the notation may correspond to identical strings in the script. Heuristics must be engaged to decide which of the representations is more appropriate.

Together with this bottle-neck, encoding may not be perfectly invertible by the decode operation, due to over-generation or approximations in the encoding algorithm.

There are situations where conversion from the Arabic script to the ArabTeX notation is still convenient and useful. Imagine you need to edit the data, enhance it with vowels or other diacritical marks, produce phonetic transcripts and trim the typography of the script ... Do it in the ArabTeX notation, having an unrivalled control over your acts!

Nonetheless, encoding is not the very purpose for this module's existence ;)

Hamza carriers are determined from the context in accordance with the Arabic orthographical conventions. The first level of mapping expands every <'> into the verbatim encoding of the relevant carrier. This level of processing can become optional, if people ever need to encode the hamza carriers explicitly.

Interpretation of geminated hamza<''> is correct here, as opposed to ArabTeX itself. In order to deduce the proper spelling rules, we resorted to http://www.arabic-morphology.com/ and experimented with words like <ra''asa>, <ru''isa>, <tara''usuN>, etc.

On this level, word-internal occurrences of <T> get translated into <t>, which is an extension to the notation that simplifies some requirements in modeling of the Arabic morphology.

The core level includes most of the rules needed, and converts the ArabTeX notation to Arabic graphemes in Unicode. The engine recognizes all the consonants of Modern Standard Arabic, plus the following letters:

There are many nice features in the notation, like assimilation, gemination, hyphenation, all implemented here. Defective and historical writings of vowels are supported, too! Try yourself if your fonts can handle these ;)

Word-initial sequences like <lV-all>, <lV-al->, <lV-al-CC> and <lV-aC-C>, where V stands for a short, possibly quoted or missing, vowel, and C represents a fixed consonant, are processed according to the requirements of the Arabic orthography. Thus, <li-al-laylaTi> reduces to <li-llaylaTi>, <li-al-rra^guli> becomes <lir-ra^guli>, and <la-al-ma^gdu> equals <lal-ma^gdu>, while <li-alla_dI> turns into <lilla_dI>.

Wasla is introduced if there is a preceding long or short vowel, and the blank space is one newline, one tabulator, or up to four single spaces. Optionally, diacritical marks in between laam and 'alif go after the latter letter, since most of the current systems rendering the Arabic script do not produce the desired ligatures if the two kinds of graphemes are not adjacent immediately.

There are modes and options in ArabTeX that have not been dealt with yet in Encode::Arabic::ArabTeX. Still, mutual consistency of the systems is very high. This new release does support vowel quoting and works in the ArabTeX's \vocalize mode by default. The other conversion modes are implemented, too, as described below within the enmode and demode methods.

The module exports as if use Encode also appeared in the package. The import options, except for the first-place subsequence of :xml, :simple or :describe, are just delegated to Encode and imports performed properly.

If the first element in the list to use is :xml, all XML markup, or rather any data enclosed in the well-paired and non-nested angle brackets< and >, will be preserved. Properties of the Encode::Arabic::ArabTeX engines can be generally controlled through the Encode::Mapper API.

In case the next, possibly the first, element in this list is :simple, rules in the engines get simplified so that quotes be mapped to empty strings and infrequent or experimental notations of vowels not be interpreted in the extra manner of ArabTeX. Using :simple is recommended for simple every-day tasks where these nuances would have no impact and where full initialization would be bothering.

The :describe option calls the Encode::Mapper's describe method on the module's engines right after their compilation.

Initialization of the engines takes place the first time they are used, unless they have already been defined. There are two explicit methods for it:

Initialize or redefine the encoder engine. If no parameters are given, rules in the module are compiled into a list of Encode::Mapper objects. Currently, the --dump and --load options have some experimental meaning.

There are five conversion modes currently recognized in this module, and their aliases are mapped according to the module's %modemap hash. Selection of the appropriate mode is done best through the enmode and demode functions of Encode::Arabic, or with a direct call of the namesake methods in Encode::Arabic::ArabTeX: