help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to translate LaTeX into UTF-8 in Elisp?


From: Joost Kremers
Subject: Re: How to translate LaTeX into UTF-8 in Elisp?
Date: Tue, 04 Jul 2017 13:18:43 +0200
User-agent: mu4e 0.9.19; emacs 25.2.50.1


On Mon, Jul 03 2017, Marcin Borkowski wrote:
On 2016-12-08, at 18:04, Marcin Borkowski <mbork@mbork.pl> wrote:

Hi all,

I have a string with embedded sequences like "\'e" or "\H{o}". The Emacs TeX input method knows how to convert them into "é" or "ő" (when typing, of course). Is there a way to use that to perform similar
conversions in a string?

Hi all,

I'm revisiting this old thread now. Since I got no satisfying answers back then, here is my plan for solution. I'm going first to map \', \` etc. onto /names/ (this is a rather short list!), construct a Unicode
name of the character I want and then use =ucs-names=.

For instance, \' maps to "ACUTE", then \'a will map to "LATIN SMALL
LETTER A ACUTE" and this can be fed into =char-from-name=.

It is a horrible hack, but it should work.  Any better ideas?

Have you tried looking into the input method mechanism that translates "\'e" into "é"? The info on how do such translations is stored somewhere somehow, so it should in principle be possible to use it to do the translations you want. I don't know very much about quail (I define a few custom input methods in my init files, but that's about it), but it looks like the info is stored as an alist somewhere of the form ("\\'e" ?é).

Perhaps you've already explored this idea and found it too unwieldy, but you didn't mention it anywhere.


--
Joost Kremers
Life has its moments



reply via email to

[Prev in Thread] Current Thread [Next in Thread]