Saturday, October 23, 2010

Typing mathematical characters in X

Unicode provides many useful characters for mathematics. If you've studied the traditional notation, an expression like « Γ ⊢ Λt.λ(x:t).x : ∀t. t → t » is much more readable than an ASCII equivalent. However, most systems don't provide an easy way to enter these characters.

The compose key feature of X Windows provides a nice solution on Linux and other UNIX systems. Compose combinations are easy-to-remember mnemonics, like -> for →, and an enormous number of characters are available with just a few keystrokes.

Setting it up

I cooked up a config file with my most-used mathematical symbols. With recent Xorg, you can drop this file in ~/.XCompose, restart X, and you should be good to go.

The include line will pull in your system-wide configuration, e.g. /usr/share/X11/locale/en_US.UTF-8/Compose. This already contains many useful characters. I was going to add <3 for ♥ and CCCP for ☭, but I found that Debian already provides these.

GTK has its own input handling. To make it defer to X, I had to add an environment variable in ~/.xsession:

export GTK_IM_MODULE="xim"

The "Fn" key on recent ThinkPads makes a good compose key. It normally acts as a modifier key in hardware, but will send a keycode to X when pressed and released by itself. I used this xmodmap setting:

keycode 151=Multi_key

Tweaking the codes

Being boilerplate-averse, I specified the key combinations in a compact format which is processed by this Haskell script.

Obviously, not everyone will like my choice of key combinations. If you tweak the file and come up with something particularly nice, I'd like to see it. If you can't run Haskell code for whatever reason, it's not too hard to edit the generated XCompose file.

Though my use of Haskell here may seem gratuitous, I actually started writing this script in Python, but ran into trouble with Python 2's inconsistent treatment of Unicode text. Using Haskell's String type with GHC ≥ 6.12 will Just Work, at least until you care about performance.


If you don't like this solution, SCIM provides an input mode which uses LaTeX codes.


  1. When I want to write Unicode characters in text files, I'm very fond of emacs Tex input-method. It can be activated with `M-x set-input-method` or `C-x Enter C-\`, and then by selecting `TeX`.

    It allows to write UTF8 characters by using their TeX name : for example typing `\lambda` in an emacs buffer with the TeX input method will produce the `λ` character. Not all character are accessible (all UTF8 characters can be inserted by their unicode name with `M-x ucs-inert`), but the coherent TeX naming is very nice.

    I have used it to write simple text files about type systems that have near-LaTeX readability.

  2. Another satisfied Compose-C-C-C-P customer. :D

    Great post. I've been meaning to write something like this up. I've also been meaning to look into better synchronizing Gtk+ and X's ideas of the compose table, but it's hairy and fraught with backwards-compatibility woes. I think it would also be neat to have a graphical compose sequence viewer, maybe integrated into the Gnome character map. (So, you hunt for a symbol, find it, and there's a hint saying “to type this character, press …” or an “add a shortcut for this character…” as appropriate.)

  3. I suppose this isn't very useful to non-CJK speakers, but... on Windows, you can achieve the same thing using the IMEs (eg. the Japanese IME). FYI.

  4. Jio Giga Tv
    ohh really your post is Amazing...
    I enjoyed your content

  5. food ordering app india
    hello today i Reached ypur site and I find your site speed is so Amazing and posts are wow

  6. Hey,
    Thanks for sharing this helpful & wonderful post. i really appreciate your hard work. this is very useful & informative for me.
    thanks for sharing with us. thanks a lot.

    Easy Cut Studio Pro Crack is a useful place where you can easily find Activators, Patch, Full version software Free Download, License key, serial key, keygen, Activation Key and Torrents. Get all of these by easily just on a single click.

    vMix Crack is the vision mixer software that available in the window operating system. This software produced by StudioCoast PTY LTD. stable release of this software is Witten by VB.Net language. The operating system required by this software is window 7 and another later window. software launch in IA-32 and x86-64.vMix an available at least 9 languages German, English, Spanish, French, Japanese, Korean, Portuguese, is like live streaming software. License use trialware. The website used to publish this software is vMix.

    One Click Root Crack is the professional root program for android. It can run on Windows XP, Vista, server 2008, 7 and Windows 10. It is introduced by the team of authoritative android programs. One Click Root allows you to root your android devices within a click. The software can download on a computer with a USB cable, linked to mobile or automatically on android.

    MorphVOX Pro Crack is a software helps to change the form of your voice. It is introduced by screaming bee Inc. MorphVOX Pro Produces multiple surprising results, as you say something in your microphone. It permits the program to distort your cry into something new. Morph VOX Pro is a voice changer software. The software can run on Windows 8.1, 10, 8, Windows XP, 7, and windows vista.

    Cinema 4D Crack is a useful place where you can easily find Activators, Patch, Full version software Free Download, License key, serial key, keygen, Activation Key and Torrents. Get all of these by easily just on a single click.

    MorphVOX Pro Crack is the latest software that can help you to change the voice. On the other hand, it can also introduce it by your screaming in your bee Inc. While, on the other hand, the Morph VOX Pro crack can also help to produce the multiple surprising of all kinds of results. Furthermore, this thing is also permitting all the programs and the distort of the cry in something to the new one.

    YouTube By Click 2020 Crack it’s an all in one media provider and downloader software. Best known for downloading videos in one click. And also famous as the best online videos streaming sits. It supports millions of sites worldwide. It gives you every type of video that you want. All you have to do is to type the video name or hint that you want.

    Virtual DJ Pro 2020 Crack is all good, for anybody to place a flaw. It has tabbed playback, which enables you to make and save samples special buttons and has several different sound editing purposes and permits one to edit just two monitors in real-time to earn a stay mixture. Virtual DJ Serial Number includes a lot of sound instruments, builtin effects on that I’ve written previously may produce your paths of these MP3 songs records from the player that is built-in.

    Adobe Acrobat Pro Dc Serial Key, comprises a completely free app that allows you to combine and ship PDF files.

  16. gta 2 free downloads
    Grand Theft Auto II Pc Download: an famous action, adventure game. DMA Design developed Grand Theft Auto 2 Torrent. Rockstar Games published GTA 2 Torrent. It is the sequel to the earlier released game Grand Theft Auto 1997 in the GTA Games Series. GTA 2 Free Download Full Version Pc Game Highly Compressed features both single player as well as the multiplayer gameplay modes. The players can explore the game world by foot or by the use of vehicle.

  17. bhai content tgda likhe ho …sabse acha apka yeh article lga mujhe ..i really like ur content bro
    The tech tushar

  18. thanks for your post i have found the information that i want on your blog its such a nice theme .
    thanks for your infomative post .
    Free Full Pro Keys for Windows & Mac software

    Full Pro Keys


  19. bhai content tgda likhe ho …sabse acha apka yeh article lga mujhe ..i really like ur content bro
    The tech tushar


  20. post bahut acha hai ..i really like ur post bro
    The tech tushar

  21. Online health & safety essay writing services are very difficult to complete and many students are always searching for Health & Safety Writing Services to help them complete their health & safety research paper writing services and health & safety coursework writing services.

  22. People daily search for many Pc Games on web form different ages and from different parts of the world. Do they find the games of their interest?

    Many famous websites are available to download many games the old ones and the new games too. Pc Games Here is a place where you can find and Download Pc Games Full Version.

    On this site you can find all the games in different catogeries like GTA Games, NFS Games, Car Racing Games, Fighting Games, Cricket Games and Football Games. Some Of The Pc Games are described below.

    I love to play football and this is my favorite game which i play most. You can also visit here for
    The Crew Wild Run Download

    God Of War 3 Pc Game Highly Compressed Free Download

  23. After watching so much tv and eating fast food as well as laying all the day also effect our health so much. So that make us feel tired as well as feeling not good. So you must use several medicines for the eradication of all these type of symptoms. You would love to have this if you want to know about

  24. Before knowing about the process to connect the printer to the computer or other devices, we can see about the ij start canon. Technology Info

  25. Windows 10 Activator Crack
    Windows 10 Activator Crack is a tool that can use to activate all editions of Windows 10 and ultimately explore the fantastic features you never thought of before. In normal mode, we use a disabled version of Windows and cannot use all features. Therefore, to use all tools and functions, we must first enable Windows.

  26. Avast Cleacnup Crack
    Avast Cleanup Crack method after scanning the crap document to prepare the PC for removal with a variant will be here now. The application form has a wish to remove crap, temporary re-cycled files. It’s a high-level scanning option since it arranged and organized. There are similar kinds of files that last the HD format, but you needn’t delete them. After you download the HD arrangement of data, pictures there remain distance. Well, it’s about to earn mileage.

  27. Malwarebytes Crack
    VSDC Video Editor can serve you to set the minor bugs. So you can work with it efficiently. You can easily avail of both reading and writing formats. You can create a video without any struggle with visual and audio effects. There are various video editors in the market, but it has excellent functionalities through which you can upload your videos to the online programs. You can also create many kinds of diagrams like Pyramid 3D Radar Spline, 3D sketches, Pyramid, and several more. From this application, you can download videos from various platforms. With the help of a multicolor Chroma key, you can produce high-quality videos in a brief time.

  28. Camtasia Studio Crack
    Cracked Here is a useful place where you can easily find Activators, Patch, Full version software Free Download, License key, serial key, keygen, Activation Key and Torrents.
    Get all of these by easily just on a single click.

  29. Mailbird Pro Crack
    Cracked Here is a useful place where you can easily find Activators, Patch, Full version software Free Download, License key, serial key, keygen, Activation Key and Torrents.

  30. The students will be able to check their UP Board Result for Class 12 via SMS also. The UP Board 12th Result 2021 would comprise the student's roll UPMSP 12th Result 2021 Around 25 lakh students will be able to check their UP Board Result 2021 Class 12 for the UP 12th examination which will be conducted in April and May 2021.

  31. Hey, I'm Santana Blackwell. I'm from Los Angeles. I'm a Software Engineer. Here's my web URL

    And I make Softwares like::


  32. طرق كشف تسريب المياه

    تتعدد طرق الكشف عن تسربات المياه ما هو يدوي، وحتى نتأكد من ذلك نقوم بإغلاق كافة المصادر التي تمد المنزل بالمياه من محابس وحنفيات مع إعطاء كافة أفراد المبنى بعدم استعمال المياه نهائياً في الفترة الزمنية التي تُغلق فيها المصادر في خطوة لتحديد قراءة العداد ورصدها ويُفضل أن يستمر الحال على هذا النحو مدّة تصل إلى خمس ساعات وبعد مضي الفترة يتم قراءة العداد مرة أخرى، ففي حال تطابق اقراءة الاولى والثانية يكون المنزل خالياً من التسريبات، وفي حال وجود فارق بينهما فإنّ ذلك يدل على مقدار المياه المتسربة ويستدعي الأمر الاستعانة بشركات كشف تسربات المياه لإصلاح المسألة بصورة سريعة كي لا تتفاقم المشكلة.
    شركة تنظيف مكيفات بجدة
    شركة تنظيف خزانات بمكة
    شركة كشف تسربات المياه بجدة

  33. Working with this program is very simple and you just need to select which folder or video file you want to download and after separating it from the area to be edited, review the output results before final storage. This Site

  34. Download the latest Cracks with CracCOol website patch, Serial Key, License Key and Keygen Full Free

  35. Thanks for nice post and information... recentjobs

    You can transfer any document from Microsoft’s workstation and translate it mechanically to its original format. No need to waste time duplicating and pasting or formatting your text. It is comfortable and easy to use.

  37. Draw your own models with Easy Cut Studio keygen – drawing and design couldn’t be easier! This powerful vinyl cutting software comes with a set of various look and feels tools you need. Easily draw unique shapes, edit signs, edit vector images, create logos, customize the text with all fonts on your computer, plus special effects. Easy Cut Studio will make your design and cut your marks easier than any other cutting plotter Easy Cut Studio serial number on the market today. It is a small design unit for cutting vinyl.

  38. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to
    morphvox pro crack
    cyberlink powerdirector crack
    typing master pro crack
    imyfone umate pro crack
    tenorshare 4ukey crack

  39. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    Babylon Pro NG Key Crack

  40. PC Software Download
    You make it look very easy with your presentation, but I think this is important to Be something that I think I would never understand
    It seems very complex and extremely broad to me. I look forward to your next post,
    ACDSee Photo Studio Crack
    Easypano Tourweaver Pro Crack
    Easy Cut Studio Crack
    Facebook Video Downloader Crack
    PostgreSQL Maestro Crack
    MediaMonkey Gold Crack
    SuperAntiSpyware Professional Crack

  41. Nice information. I’ve bookmarked your site, and I’m adding your RSS feeds to my Google account to get updates instantly. WM Capture Crack

  42. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.
    MorphVox Pro Crack
    Microsoft Office 2010 Crack
    Cinema 4D Crack

  43. รวมไอเดียตกเเต่งบ้าน ไอเดีย DIY ตกเเต่งสวนหลังบ้านให้สวยงามได้ง่ายๆ เชิญทางนี้ shanalya เว็บไซต์ที่ใจใครหลายๆคนอย่างเเน่นอน รวมเทคนิคในการตกเเต่งบ้าน รวมบ้านหลากลหายสไตล์ ไอสวนหลังบ้านหลากหลายเเบบ รวมไว่ที่นี่เเล้ว เว็บเดียวจบบครบเรื่องบ้าน.

  44. Really good Information sir

  45. Thanks For Allowing us to Share Our Views In This Blog. Share PcsCrack With others.
    free email extractor registration key

  46. Thanks For Allowing us to Share Our Views In This Blog. Share With others.
    clave avast driver updater

  47. You make it so easy to do with your presentation, yet I think that this issue is something I can't fully understand.
    It appears to me too intricate and too broad. I'm looking ahead to your next position, I'll attempt to hold it!
    corel draw x7 serial number
    synthesia key crack
    bandicam serial number
    plagiarism checker x 6 free download with crack

  48. Gutt Websäit : Zonahobisaya
    Gutt Websäit : Zonahobisaya
    Gutt Websäit : Zonahobisaya
    Gutt Websäit : One Piece
    Gutt Websäit : Zonahobisaya
    Gutt Websäit : Zonahobisaya
    Gutt Websäit : Biodata
    Gutt Websäit : Zonahobisaya