ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: ASCII input - non ASCII output
Date: Tue, 7 Nov 2017 14:10:02 +0100	[thread overview]
Message-ID: <CALBOmsa6HHqk7QPBwBpdPvyUXXrR9TYX_hf5KYadKC-e1EGYLg@mail.gmail.com> (raw)
In-Reply-To: <CANaQJgmE6XFBGPLLQ2i3ZCajA0wVgMNNXCxwGbBeNpr+_WJK0A@mail.gmail.com>

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2017-11-07 13:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07 12:48 Sava Maksimović
2017-11-07 13:10 ` Mojca Miklavec [this message]
2017-11-07 19:38 ` Thomas A. Schmitz
2017-11-08 10:00   ` Ulrike Fischer
2017-11-08 10:34   ` Mojca Miklavec
2017-11-08 14:36     ` Thomas A. Schmitz
2017-11-08 15:09       ` Mojca Miklavec
2017-11-09  3:15         ` Henri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALBOmsa6HHqk7QPBwBpdPvyUXXrR9TYX_hf5KYadKC-e1EGYLg@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).