Dear Sava, On 7 November 2017 at 13:48, Sava Maksimović wrote:
Hi,
Is there a way in context, that for some text ascii input (in source .tex file) define mapping in internal tex system ?
For example, if i put two ascii characters "dj" in .tex file, can i get cyrillic character "ђ" in .pdf ? And so on, for input b, v, g, d, ... to get output б, в, г, д, ...
Or more general, for every letter/string in unicode to define the way that it should be read.
ConTeXt can do that with some additional tricks (font features) in lua (I don't know the code by heart, but I assume someone else will answer that). But you'll have to wrap all the code that you want transliterated in blocks, so instead of having to switch the keyboard, you'll likely have to type additional commands. (Maybe it would work satisfactory without having to change too often, but I would probably not want to do that and would prefer to go for Unicode.)
It's benefit for non ascii language users, because in that case they don't need to switch keyboard layout all the time between command, math input and text input.
Keep in mind that you could in principle also translate the command names, so that you could use (excuse me, it's probably grammatically incorrect): \почнитекст a, б, в, г, д, ђ, е, ж, з \завршитекст
In Latex, package fontenc(precisely OT2 encoding) do that things.
Minimal example:
\starttext
a, b, v, g, d, dj, e, zh, z
\stoptext
should produce
a, б, в, г, д, ђ, е, ж, з
Just curious: why do you use "zh" instead of "ž"? Mojca