How to write Hindi numbers within Arabic text in Emacs 24?

1,193

You can enter them using C-x 8 followed by Enter and then the code point (e.g., 0661 for the Arabic-Indic digit one). That’s tedious, but a more satisfactory answer would not be about TeX or even about Emacs, but rather about configuration of the keyboard in Microsoft Windows. In GNU/Linux, I can enter Arabic digits directly by setting XKBLAYOUT to ara and XKBVARIANT to digits; that works in all of my text editors, which suggests that the problem you’re experiencing is not an Emacs problem.

EDIT

I use Debian, but Ubuntu is probably configured in much the same way. /etc/default/keyboard looks like this:

XKBMODEL="pc104"
XKBLAYOUT="us,gr,ara"
XKBVARIANT=",polytonic,digits"
XKBOPTIONS="grp:lwin_toggle,compose:rwin,grp_led:scroll"

Translation: The left windows key toggles between the usual US keyboard, polytonic Greek, and Arabic with the digits you want. The right windows key is a compose key, allowing me to get the characters needed to spell my name, among others. An LED lights up to alert me that the keyboard is in Greek or Arabic mode.

In .bashrc, I have export GTK_IM_MODULE=xim to make gtk programs acknowledge the compose key instead of doing their gnomish thing.

You’ll need to remember to toggle back to a Latin keyboard whenever you want to do something in the minibuffer, like saving the file. That wouldn’t be necessary if you found an ELisper who could customize the arabic input method of Emacs for you.

There’s a diagram of the keyboard on Dropbox.

Share:
1,193

Related videos on Youtube

doctorate
Author by

doctorate

Updated on December 23, 2020

Comments

  • doctorate
    doctorate almost 3 years

    I use GNU Emacs 24.3.1. I want to write multilingual text including Arabic text and English text in one buffer. Problem is how to write Hindi numbers instead of Arabic numbers when writing Arabic text (ironically arabic numbers are the 1,2,3,...). Yep, that is a misnomer may be.

    Hindi numbers I cannot write them over here (the second line in the screenshot below).

    MS Word screenshot: enter image description here

    Notes:

    • Windows 7-32 bit
    • Admin
      Admin over 9 years
      Perhaps this link might help: emacswiki.org/emacs/DisplayEngineForArabic
    • doctorate
      doctorate over 9 years
      @ChristianHupfer, Hi. I already tried it but to no avail, neither direction nor Hindi numerals. Emacs is very good though, if not the best, to show diacritics of arabic letters. I am sure this editor is the one to go Arabic latexing.
    • Admin
      Admin over 9 years
      Im am pretty sure that Arab speaking/writing users are available here and some of them will use (X)Emacs too.
    • Sean Allred
      Sean Allred almost 9 years
      Better to ask on Emacs.SE; this doesn't have much to do with TeX.
  • doctorate
    doctorate almost 9 years
    you are right a tedious job to hit each time the code! But better than off-topic is to transfer the question to whatever StackExchange site that would answer this question more likely. My suggestion is Emacs SE. Changing keyboard in windows is not the right solution because it will undesirably change numbers of all windows interface to Hindi! So chances that an Emacs solution can be found if it were transferred to Emacs SE.
  • Thérèse
    Thérèse almost 9 years
    @doctorate I haven’t touched Windows in years, but I still think this is a Windows question, not an Emacs question. In GNU/Linux, one can toggle between different keyboards — I have things configured to go from Latin to polytonic Greek to Arabic whenever I press the otherwise useless Windows key. What you need to find out is whether it’s possible to toggle between keyboard layouts in Windows.
  • Thérèse
    Thérèse almost 9 years
    @doctorate If you use M-x list-input-methods and select arabic, you’ll get a keyboard chart from which it’s clear that the input method doesn’t provide the digits you want. However, possibly someone at Emacs SE or emacswiki.org could cook up some elisp to fix that for you.
  • doctorate
    doctorate almost 9 years
    I use Ubuntu rarely, can you please post your settings of how to write Arabic text with Hindi numerals in Linux. In Ubuntu, switching keyboard to Arabic (Space + Win key) and set-input-method to Arabic didn't work either.
  • doctorate
    doctorate almost 9 years
    In LibreOffice I could have the desired effect by going to Tools --> Options -->Language Settings --> Complex Text Layout and set Numerals to Context (for bidirectional). How to replicate that in Emacs. You answer would be helpful for Linux at least and would be much appreciated. I am ready to open new post if you want.
  • Thérèse
    Thérèse almost 9 years
    @doctorate emacs.stackexchange.com/questions/3104/… seems to explain the principles in terms of which you can customize the Arabic input method.