Modifying selected text with Autohotkey

Autohotkey is an amazing tool to define hotkeys such as s# that get automatically expanded to \section{}. On earlier occasions I had already written some blog posts on this topic. Today (encouraged by a question on tex.stackexchange) I managed to compile a short script, which takes some selected text, inserts a specific command and pastes the selected text again. Quite helpful if one want’s to define a shortcut to e.g. make the selected text bold.

F4::
Send ^c
Send \command{{}{}}{LEFT}
Send ^v
Return

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website