Nonlinear Input for (La)TeX IME

Published on June 25, 2014.

Note

This post was previous published at blog.rgaiacs.com. Some links might got broken during the conversion from reStructuredText to Markdown.

Since (La)TeX is a programming language (yes, it is a Turing-complete language) many of the math symbols are available as commands/functions and to help user type a text is need that the IME change the cursor position based on user inputs. At this post I will show what the IME that I'm writing should do with the cursor.

Notation

To represent the cursor position I will use Unicode black vertical rectangle, .

Change Cursor Key

We need to define a key to move the cursor to the next "place holder". The RETURN key is suitable to do this because have \n inside a command or environment is rare and most of the cases it happens its purpose is make easy to read the source code ((La)TeX treats \n\n as a new paragraph but \n is ignored).

General Commands

(La)TeX commands are, normally, of the form \command[]{} and the jumps are showed below:

General Environments

(La)TeX environments are, normally, of the form \begin{environment}[]\end{environment} and the jumps are showed below:

Special Cases

Vertical Bar

Double Vertical bar

Subscript and Superscript

Underset and Overset

References

default

GSOC

GSOC2014

Tags: