* Arabic transliteration macros
@ 2005-10-15 20:11 Idris Samawi Hamid
2005-10-15 23:06 ` Henning Hraban Ramm
0 siblings, 1 reply; 2+ messages in thread
From: Idris Samawi Hamid @ 2005-10-15 20:11 UTC (permalink / 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Arabic transliteration macros
2005-10-15 20:11 Arabic transliteration macros Idris Samawi Hamid
@ 2005-10-15 23:06 ` Henning Hraban Ramm
0 siblings, 0 replies; 2+ messages in thread
From: Henning Hraban Ramm @ 2005-10-15 23:06 UTC (permalink / raw)
Am 2005-10-15 um 22:11 schrieb Idris Samawi Hamid:
> If there are any other suggestions or comments to improve or
> streamline this,
> please let me know.
Please publish this in the wiki at "Arabian" or "Arabian and
Hebrew" (as supposed) liked at http://wiki.contextgarden.net/Fonts
(I don't know nothing about Arabian, but I'd like to see the list of
non-latin scripts enhanced.)
Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net
http://www.cacert.org (I'm an assurer)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-10-15 23:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-15 20:11 Arabic transliteration macros Idris Samawi Hamid
2005-10-15 23:06 ` Henning Hraban Ramm
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).