I am trying to create a customized shortcut in WinEdt. After reading a few posts on tex.stackexchange I thing I am close to be able to do it, but somehow it is not working.

I am trying to define the combination of keys Alt+G to generate the following lines: {\ttfamily \ttfamily}.

So what I did was the following: Options -> Options Interface. In the interface that opens up in the lefthand column, double click Menus and Toolbar... and then double click Main Menu. That's when the MainMenu.ini opens.

Then I located the line:


And right after that line I added:

MACRO="Ins('{\ttfamily \ttfamily}');"

Then I reloaded the script, but the shortcut is not working. Any suggestion?


There's a problem in the line


In fact, the scan code (32833) belongs to the Alt+A combination..., and it prevails on Alt+G. Try to press Alt+A and you will see what happens.

The right scan code for Alt+G is 32839.

If you want to insert the right scan code, simply double-click on SHORTCUT and insert the right combination.

Note, however, that Alt+G is already assigned to the Greek popup menu, so I suggest you to think of another shortcut, for example Alt+A which is not assigned.

If you want Alt+G and only that, you have to remove that shortcut from the other menu item.

To know which shortcuts are already used, go to Options Interface -> Menus and Toolbars -> Main Menu and in Tree toolbar choose Copy to Clipboard -> Shortcuts, then paste it in a blank data document.

  • I see. Thanks for the insightful answer. Where can I check scan codes for remaining shortcuts? – phdstudent Feb 6 '17 at 11:32
  • BTW: What's the purpose of inserting {\ttfamily \ttfamily}? – karlkoeller Feb 6 '17 at 11:32
  • It is just a style defined wuth the "lstset" package to insert code within a document. – phdstudent Feb 6 '17 at 11:33
  • @volcompt Ah, OK. – karlkoeller Feb 6 '17 at 11:34
  • @volcompt Added in the answer. – karlkoeller Feb 6 '17 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.