From: Idris Samawi Hamid <ishamid@lamar.colostate.edu>
Subject: Arabic transliteration macros
Date: Sat, 15 Oct 2005 14:11:03 -0600 [thread overview]
Message-ID: <4351DBB3@webmail.colostate.edu> (raw)
Dear syndicate,
I have been using some ugly/naive macros for scientific transliteration of
Arabic up to now. I recently overhauled these after studying the enco-def.tex
method. These might be useful for others who have to transliterate Arabic. (I
have written my own scientific transliteration by the way, based on the German
ZDMG system:)
http://www.gsp-online.org/journals/journaldocs/shi/transliteration.pdf
imacron occurs very frequently in Arabic transliteration, in virtually every
system. In Latin Modern the macron on the `i' is too large and looks really
bad when used frequently. I've redefined it, and would suggest that, for lmr
anyway, that something like the imacron definition below works much better
than the default.
On the other hand, I need to make the imacron definition more general to
include the bold case (which needs a thicker macron). How can I add a
conditional to the macro definition of \itextmacron so that it selects its
argument based on whether \tf (and the like) or \bf (and the like) is in
effect?
I wish that TeX had a simple \iffont test but maybe there is an easy way to do
that?
If there are any other suggestions or comments to improve or streamline this,
please let me know.
Best
Idris
===================arabic-trans.tex===================
\setupoutput[pdftex]
%%%=====================low-level====================
\def\SHIFT#1{\dimen0=.00#1ex \multiply\dimen0 by\fontdimen1\font
\kern-.0156\dimen0}
% compensate for slant/italic in lower accents
\def\USHIFT#1{\dimen0=.00#1ex \multiply\dimen0 by\fontdimen1\font
\kern.0156\dimen0}
% compensate for slant/italic in upper accents
\def\buildtextbottombreve{\bottomaccent{.25ex}{0}{19}{\textbreve}}
%%%=====================basic transliteration====================
\def\Al{\~a\~l}
\unexpanded\def\h#1{{\buildtextbottombreve #1}}
\unexpanded\def\.#1{{\buildtextbottomdot #1}}
\unexpanded\def\:#1{{\buildtextaccent\textdotaccent #1}}
%%%=====================ayn-hamzah====================
\def\cupd{\leavevmode%
\USHIFT{14}\rotate[rotation=180,location=high]{\txx c}%
\SHIFT{14}}
\definecharacter AYN {\leavevmode\raise.9ex\hbox{\txx \USHIFT{1}
c\SHIFT{0}}{}}
\definecharacter HAMZAH {\leavevmode\kern.07em\raise.9ex\hbox{\cupd}{}}
\def\'{\HAMZAH}
\def\`{\AYN}
%% replace grave and acute
\unexpanded\def\Grave#1{{\accent"12 #1}}
\unexpanded\def\Acute#1{{\accent"13 #1}}
%%%=====================imacron====================
\unexpanded\def\itextmacron{\leavevmode\rlap{\USHIFT{14}\kern.033em\raise1.375
ex%
\hbox to .21243em{\leaders\hrule height
.067ex\hfill}}}
\definecharacter imacron {\buildtextaccent\itextmacron \dotlessi}
\starttext
Long vowels:
\blank[small]
\=Adam \ kit\=ab \ {\it \=Adam \ kit\=ab }
\=Im\=an \ M\=irz\=a \ {\it \=Im\=an \ M\=irz\=a}
\=Ul\=a \ n\=un \ {\it \=Ul\=a \ n\=un}
\blank
Consonants:
\blank[small]
\b T\=ar \ \b ma\b tal \ {\it \b T\=ar \ \b ma\b tal}
\.Husayn \ ma\.hall \ {\it \.Husayn \ ma\.hall}
\h H\=alid \ ma\h hzan \ {\it \h H\=alid \ ma\h hzan}
\b Dh\=at \ h\=a\b d\=a \ {\it \b Dh\=at \ h\=a\b d\=a}
\.S\=ali\.h \ ma\.sdar \ {\it \.S\=ali\.h \ ma\.sdar}
\.D\=amin \ mu\.dill \ {\it \.D\=amin \ mu\.dill}
\.T\=ariq \ ma\.tar \ {\it \.T\=ariq \ ma\.tar}
\.Z\=ahir \ ma\.zhar \ {\it \.Z\=ahir \ ma\.zhar}
\:G\=afir \ \:gufr\=an \ {\it \:G\=afir \ \:gufr\=an}
\blank
Glottal stops:
\blank[small]
\`Al\=i \ ba\`du \ {\it \`Al\=i \ ba\`du}
\'Alif \ Qur\'\=an \ {\it \'Alif \ Qur\'\=an}
\blank
Assimilation:
\blank[medium]
a. definite article
\blank[small]
Ibnu \~al-F\=aris {\it Ibnu \~al-F\=aris}
Kit\=abu \Al-S\=ibawayh {\it Kit\=abu \Al-S\=ibawayh}
\blank[medium]
b. t\=a\' marb\=u\.ta\~h
\blank[small]
\h hal\=ifa\~h {\it \h hal\=ifa\~h}
\h hal\=ifa\~tu \Al-nabiyy {\it \h hal\=ifa\~tu \Al-nabiyy}
\stoptext
======================================================
============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
next reply other threads:[~2005-10-15 20:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-15 20:11 Idris Samawi Hamid [this message]
2005-10-15 23:06 ` Henning Hraban Ramm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4351DBB3@webmail.colostate.edu \
--to=ishamid@lamar.colostate.edu \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).