}
}
}
+
+function lookup_tex(texmacro)
+{
+ texmacro = texmacro.substring(1);
+ return unescape(macro2utf8[texmacro]);
+}
function keypress(e)
{
match = unlocked.innerHTML.substring(i,j);
pre = unlocked.innerHTML.substring(0,i);
post = unlocked.innerHTML.substring(j);
- if (match == '\\to') {
- unlocked.innerHTML = pre + "-> " + post;
+
+ sym = lookup_tex(match);
+ if (typeof sym != "undefined") {
+ unlocked.innerHTML = pre + sym + " " + post;
restoreSelection();
return suppressdefault(e,true);
}