# [texworks] Side effect!!

Alain Delmotte alain.delmotte at leliseron.org
Wed Jul 22 15:34:43 CEST 2009

Hi!

Sometimes new implementation have side effects, most of the time negative!!!

But here the Lua patch proposed by Stefan do have a positive and very
interesting one.

I have been asking to be able to create short cuts to include selected
text in a formating command, ex. selecting "this", short cut, get
"\emph{this}".

On the other hand it is possible to have accelerators for the menus and
their options (and in dialog boxes); Jonathan did not use them (except
some in the find and replace dialog boxes).

In the lua code proposed by Stefan, if you put an "&" before a letter,
this one becomes accelerator:
-----------------------------------------------------
--[[TeXworksScript
Title: Make &Bold
Description: Encloses the current selection in \textbf{}
-----------------------------------------------------
the b (second line) is now an accelerator and it appears underlined in
the menu as the Title-s: fill the menu entries (note: see my message
"Some comments" 15/12/2008 17:37 to have the underlines under Windows).
For the English version of v0.1r333, I did also add an accelerator for
the "S" of the menu Scripts.
I created a collection of lua scripts to have the formating (see the
attached file*)
So now if, in an existing document, I want to put some text in bold, I
select it, and do [Alt+S] [B] and it is done (so short cut Alt+s for the
menu and b for bold -- under Windows)

Isn't marvelous!!!!

Alain

* of course, even if the name of the script file is in English, my menu
entries are in French; but this you can change very easely.
I am now almost done with a full "accelerated" system for the French
translation.
-------------- next part --------------
A non-text attachment was scrubbed...