How to type a minus char in Windows, or why do Alt-Codes produce different chars in different programs?

6,585

In Word, Alt,+,2212 is taken As Alt+2212, i.e. it produced the character with decimal code 2212 (8A4 hexadecimal). To enter a character conventiently in Word on the basis of its hexadecimal code, type that code normally and the Alt+X. If the code would be immediately preceded by a hexadecimal digit or the letter x, you need to prefix it with u+. Thus e.g. 1u+2212 Alt+X produces 1−.

For some reason, Word has its own handling for input like Alt,+,... Therefore, there is uniform method for entering the minus sign. You can create one by installing a keyboard driver that has a key or key combination assigned for the purpose, such as my Math Keyboard layout for QWERTY keyboards on Windows. (It makes the hyphen “-” is US keyboard produce the minus sign. It is intended to be used so that you switch between it and some normal keyboard layout, using this one for math expressions only. You can of course take any normal layout and just modify it so that e.g. right Alt (AltGr) changes “-” to “−”.)

Share:
6,585

Related videos on Youtube

texnic
Author by

texnic

Updated on September 18, 2022

Comments

  • texnic
    texnic almost 2 years

    I got stuck with a problem with Alt-codes. I frequently need to enter the minus sign in my texts. My company uses Excel, PowerPoint and Word to exchange texts. Therefore I need to be able to type the minus in these three programs.

    Having looked up the codes at http://www.fileformat.info/info/unicode/char/2212/index.htm and experimented with them, I discovered the following:

    • In Word and PowerPoint, Alt+8722 works. Alt,+,2212 doesn't work even after registry modification. Word used to switch to inline equation editor before registry modification, and stopped doing it afterwards.
    • In Excel, Notepad, and here (in Chrome), Alt,+,2212 works after registry modification.

    So Word and PowerPoint behave differently than Notepad, Excel and other programs.

    I wonder: why does the same method produce different results in different Microsoft programs, and if there is a uniform method to get the minus-sign in Windows?

    • SarahofGaia
      SarahofGaia almost 9 years
      If you prefer or wouldn't mind switching to the hexadecimal input codes (for Unicode characters), you could try UnicodeInput. I use it on Windows and it's marvelous.