Wednesday, January 29, 2020

TexMaker and input method

I write in LaTeX very often, either online via Overleaf, of locally on Texmaker.

Recently, I have to write a report in French, so I need to type accented characters, including "ê". On a french keyboard, one has to type the "dead key" "^" and then the key for "e". But when I did so in Texmaker, I only got the "e", not "ê", as if I did not push on the dead key "^". It was pretty general, since I could not even get the accent alone like in "\^{e}" or on any other letter â, û, î, ô, etc. Since everything was working fine on all other applications, it must be a Texmaker problem.

To make a long story, full of googling and forum and tials and errors, short, I discovered that is was a conflict between Qt (the graphical layer powering the interface of Texmaker) and ibus, the input method switcher I was using to write either in French or in Japanese.

The workaround I found was to install another input method switcher: fcitx.

Now I confess, this blog post is more a note for me to remember the procedure. But it may help others.

So, things are explained on this page.
  1. One need to have fcitx and fcitx-mozc installed
  2. Type in the terminal im-config and select fcitx, validate
  3. reboot (closing the session is not sufficient)
  4. A keyboard icon shows up (on top bar for me). Right click, configure. Ask for your default keyboard (French for me). Validate and close.
  5. Right click again on the keyboard icon, configure. Now you have access to all input methods, including mozc. Add mozc. 
  6. Selecting mosc on the list, click on the bottom icon showing some tools. In the menu, select the layout of your physical keyboard (French AZERTY for me). Validate and close.
Now, I might be a bit optimistic in this procedure because I actually tried much more things. Maybe between step 2 is actually more complex:
  1. Disable ibus for Gnome
    sudo dpkg-divert --package im-config --rename /usr/bin/ibus-daemon
  2. Reboot
  3. Type in the terminal im-config and select fcitx, validate
  4. Reboot
  5. (maybe) Enable back ibus for Gnome
    sudo dpkg-divert --package im-config --rename --remove /usr/bin/ibus-daemon
  6. Reboot