[texworks] Making TeXWorks a real bidi editor

Stefan Löffler st.loeffler at gmail.com
Mon Sep 7 20:07:23 CEST 2009


Hi,

On 2009-09-07 19:28, Mehdi Omidali wrote:
> I use TeXWorks to type farsi documents which obviously contain RTL
> texts and also LTR texts (for math formulas) but texts get really
> mixed when in one line we have both kinds of texts. This problem could
> be solved if we type a whole LTR text inside two LRM (left-to-right
> mark). Now I want to know if it is possible to inform texworks to type
> an LRM mark whenever we change the keyboard layout (maybe as a option
> in the preferences).
>   

If I understand you correctly I'm afraid it's not possible. AFAIK,
there's no way to obtain information about the current keyboard layout
through Qt, let alone determine when it's changed. This is highly
system-dependent and doesn't normally concern individual applications
much. All the translations from actual key presses to virtual codes are
done by the operating system, so that the application only receives the
unique codes and doesn't need to know what key was actually pressed in
the first place. Btw: keyboard layouts can change in a whole variety of
ways; there could be different keyboard layouts for different
applications, for examples, resulting in a change of the layout whenever
the user switches applications.

So, in short, there's no simple way to do what you ask for that I know
of, but then again I'm no Unicode expert. The (some?) Unicode control
characters can be inserted right now from the context menu (after
right-clicking), but I'm not sure if that's what you need. The simplest
way I can think of would be to define shortcuts for inserting the
characters you need, but that sounds pretty much like the ideal case for
scripting, which will probably be implemented once the official release
is over.

HTH
Stefan


More information about the texworks mailing list