[luatex] accented characters in plain luatex

Dirk Laurie dpl at sun.ac.za
Tue May 31 17:51:55 CEST 2011


On Tue, May 31, 2011 at 03:58:13PM +0200, John Culleton wrote:
> … I find that modifying my keyboard and typing accented characters is more 
> trouble than typing e.g., \'u now and then in TeX. 
> … And the accented letter p is sufficiently odd that it might be difficult to 
> type directly even from a modified keyboard.
Wouldn't know about other systems, but X11 makes it fairly easy to 
define a user-specific Compose key, the abilities of which are defined 
in a locale-dependent Compose file.  

In the locale en_US.UTF-8, more than 5000 key combinations are defined, giving 
more than 1700 distinct UTF-8 characters.

For example,                              
    Compose,quote,p gives ṕ

Dirk

==========================================================================

-- Count the number of different characters in the Compose file 

Compose = io.open("/usr/share/X11/locale/en_US.UTF-8/Compose")
names = {}
chars = {}
for l in Compose:lines() do
    local keys,char,name,description = string.match(l,
    [[^(.*):.*"(.*)"%s*(%S+).*#(.*)]])
    if name then names[name]=keys; 
    if chars[char] and chars[char]~=name then 
        print ("Character ".."char".." has names '"..chars[char]
        .."' and also '"..name.."'")
    end
    chars[char]=name 
    end
    end
count = function(t) local n=0 for _ in pairs(t) do n=n+1 end return n end
print(count(names).." names ",count(chars).." chars")



More information about the luatex mailing list