TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

defined commands which I want to use in fast way. I tried to make a short hotkey, not the long default one for inserting own text blocks, but I did not find an option for that. Then I thought I would use AutoHotkey, but normally in TeXnicCenter when you select some text and use a command like \textit{}the text wont be overwritten. If I use Autohotkey for my customized command, I select my text and it will be overwritten.

Is there a solution I did not see?

share|improve this question
up vote 2 down vote accepted

Well, it is possible at least for the F-keys. The following script copies the selected text, inserts \command{}, moves the cursor left and inserts the text again.

Send ^c
Send \command{{}{}}{LEFT}
Send ^v
share|improve this answer
why only F-keys? – user1234567890 Feb 17 '13 at 12:08
Well, F-keys do not mess with the text you entered, for combinations like Alt+<Key> it should probably work as well. But as soon as any keys are printed out, you do not have the original chars to copy to the clipboard. – Uwe Ziegenhagen Feb 17 '13 at 13:21
Just to go sure: This is an Autohotkey script? Please add a short info. – Speravir Feb 17 '13 at 18:55
Yes, this is Autohotkey. – Uwe Ziegenhagen Feb 17 '13 at 19:05

It's been a while since this question was asked but I had the same problem and solved it with an AutoIt script:


$dll = DllOpen("user32.dll")
While 1   
   if _IsPressed("05") then 
   if _IsPressed("04") then 


Instead of "XXX" you type just the beginning of the window's name of TeXnicCenter (usually the project's name).

The parameter of the _IsPressed-function defines the hotkey (04 for middle mouse button, 05 for X1 mouse button).

"!im2" means it presses ALT+i to get into the insert menu, then m and 2

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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