How do I define custom shortcuts like F7 for compiling with XeLaTex and F8 with LuaLaTex ? It's on MainMenu.ini and maybe how do I change F9 for LuaLaTex or XeLaTex if F7, F8 are taken..
[Tex/LaTex] How to define custom shortcuts in WinEdt 10.2
winedt
Related Solutions
I figured it out! Harish is right, it's the MainMenu.ini
file, but you don't need to bother finding it in your filesystem. WinEdt does that for you. And, as far as I understand, you actually have to do the editing in WinEdt itself since WinEdt produces some extra "code" for the shortcut that you create and that code would not be there if you edited manually in another editor.
So here is what you do: Go to the 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 for you!
Now, here's the tricky part: Let's assume the command that you want to create shortcut for is already defined in one of WinEdt's menues (I'll use \emph{}
). Find that Menuitem in the MainMenu.ini code (in my case it's in lines 1261-1266). Here you can see the path to the macro that is being called (%b\Menus\Insert\Emph.edt
) and you may get the idea to use it as a template for other macros, but that's just an aside.
In order to create a shortcut for this existing menu-item, create a new empty line insert SHORTCUT=""
after the line that says REQ_DOCUMENT=1
, i.e. before the line that defines the next ITEM=
... Now move the cursor so that it sits just between the two ""
and click Insert Shortcut
in the Options Interface. It's the icon with the hand on the keyboard. It looks like this (note that you have to have Main Menu
in order to see that button):
The rest is pretty self explanatory. Type in your shortcut and click OK
.
You will see that WinEdt has inserted not only the human-readable version of your shortcut but also some figures which I assume are the machine-readable version of that shortcut. As I mentioned above, I don't think you can create that code yourself and so you better follow the steps described here (correct me if anyone knows more about this).
But wait: You're not done yet! In order for the shortcut to work (and to appear in the Menu), you need to click on Load Current Script
which is the button with the script role on the very left of the image above.
Last step: Unless you are in a Sisyphus mood: hit save
before you close the MainMenu.ini
.
You have a tool bar button in winedt 8.x as in this picture:
Press it to open the symbol panel shown below. There are different tabs using which you can insert different symbols.
Best Answer
Open the option interface (menu Options -> Options interface).
Double click on
Main Menu
inMenus and Toolbars
This will open your local
mainmenu.ini
.Search for the lualatex entry.
Select the value for the shortcut (or add one if you don't have one):
Get the code for the shortcut
In the top bar of the option interface there will now be a small keyboard. Use it to select a shortkey which will be copied to the ini-file.
Load the changed ini-file
This is done with the leftmost symbol in the top bar of the option interface.
If the shortcut doesn't work this normally means that some other tool is already using the shortcut.