4

I'm totally new to ConTeXt; how to use Arabic and German in one document?

\mainlanguage[de]

\definefont[ArabicFont][file:alq2.ttf*arabic at 18pt]

\setuppapersize [A5] 

\starttext
\setupalign[r2l]
\ArabicFont

بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ

\stoptext 

How to modify, so that I can swith between Arabic and German? (I knew LaTeX, and have defined there some macros, but here everything might change...)

  • Possibly related question: how to switch fonts via language switches. Are you primarily interested in a font or a hyphenation switch? – Philipp Gesang Oct 15 '12 at 11:18
  • I am not sure about the difference. The solution in the link is far too complicated for me, I just want an environment like \begin{arab} Arabtext in unicode \end{arab}, which I always used in LaTex, but I dont know how to make that. – Mustafa Oct 15 '12 at 11:43
  • Have you seen the information at wiki.contextgarden.net/Arabic_and_Hebrew ? It should get you going. – Thomas Oct 15 '12 at 20:57
  • Yes, but that does not work for me. Now I have made an environment, which begins arabic font by \def\Arab{\setupalign[r2l]\ArabicFont} But how to switch back to normal (german) text? Best, I would have an option \startarabic ... \stoparabic, but how to make that? – Mustafa Oct 16 '12 at 5:55
  • Ok, done, I had to investigate the start/stop commands in ConTeXt, now it works. – Mustafa Oct 16 '12 at 7:33
0

Here my solution:

\startenvironment arabic
\definefont[Sheh][name:Scheherazade*arabic at 12pt]

\definestartstop[Arab][commands=\setups{Arabic}]
\def\Arab{\dodoubleempty\doArab}
\def\Arab[#1]{
\startArab 
\setupalign[r2l]\Sheh #1
\stopArab
}
\stopenvironment

Where the Font is the famous Sheherazade. But there should be one enhancement: The grid=yes should be disabled in this environment, since the grid is not suitable for arabic letters. I dont know how to do that, to add simply \setuplayout[grid=no] to the environment does not work, seems to be overwritten by the \setuplayout[grid=yes] of the mainfile.

  • But this is no complete answer, as I see now! For \Arab[ يَـٰٓأَيُّهَا ٱلنَّاسُ ٱتَّقُوا۟ رَ‌بَّكُمُ ٱلَّذِى خَلَقَكُم مِّن نَّفْسٍ وَٰحِدَةٍ وَخَلَقَ مِنْهَا زَوْجَهَا وَبَثَّ مِنْهُمَا رِ‌جَالًا كَثِيرً‌ۭا وَنِسَآءً وَٱتَّقُوا۟ ٱللَّـهَ ٱلَّذِى تَسَآءَلُونَ بِهِۦ وَٱلْأَرْ‌حَامَ إِنَّ ٱللَّـهَ كَانَ عَلَيْكُمْ رَ‌قِيبًا ] has far too many space between the arabic lines. Why? – Mustafa Oct 16 '12 at 10:09
  • I solved this, see here tex.stackexchange.com/questions/77847/… – Mustafa Oct 17 '12 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.