# using AutoHotKey to streamline LaTeX document authoring

Is it possible to use AutoHotKey to facilitate LaTeX document authoring? In which ways? Is there any off the shelf AutoHotKey script for this purpose?

-
It doesn't really matter from which language you call (la|con)?tex(t)? (given that the language supports executing system commands). Unless you mean implementing TeX in AutoHotKey. That'd be a feat. –  morbusg Jun 28 '12 at 14:38
@morbusg I want to know experiment of TeX.SE users in using AutoHotKey if any. –  PHPst Jun 28 '12 at 16:17

In general, I'm very inaccurate when typing things like "\", "{", "$" etc. It's especially cumbersome to navigate text with the Left, Right, Up and Down keys and you do all of these things constantly when typing tex. I haven't spent much time learning how to write scripts with AHK, but I did write a few things to make a few shortcuts and to save the amount of which my wrists have to bend while typing tex. For example, these I wrote for my preference. ^space:: Send {{}{}}{Left} CapsLock:: Send {$}{\$}{Left}
^9:: Send {(}{)}{Left}
^l:: Send {Right}
^j:: Send {Left}
^i:: Send {Up}
^m:: Send {Down}
^k:: Send {Down}
+^l:: Send +{Right}
+^j:: Send +{Left}
+^i:: Send +{Up}
+^m:: Send +{Down}
+^k:: Send +{Down}
^f:: Send {^}
^p:: Send \pause{Enter}{Enter}
^h:: Send \
^n:: Send \{{}\{}}{Left}{Left}
^;:: Send {End}
^Backspace:: Send {Delete}
^=:: Send {&}={&}


I came here because I too was wondering if someone with professional knowledge of AHK had written something useful for writing tex.

-

You can use AutoHotKeys to define a bunch of keyboard shortcuts for the most often used LaTeX commands:

\begin{<input your environment name>}
\end{<AutoHotKeys automatically closes it with the same environment name>}

\begin{itemize}
\item <cursor is put here>
\item
\end{itemize}

\section{foo}

\alpha,\beta,...


etc.

But if you're willing to invest time in learning a tool to ease LaTeX document authoring, I suggest emacs and the good AUCTeX extension. It has many well-thought keyboard shortcuts, syntax highlighting (including bold for \section), jump to the point of compilation error, table of content navigation, etc. http://www.gnu.org/software/auctex/features.html

Works under Linux, Windows and Mac.

-
How do I get Autohotkey to close the current environment automatically. So far I use b# to expand to \begin{} but I am looking for a more sophisticated solution. –  Uwe Ziegenhagen Sep 25 '13 at 23:25
This comment should be converted to a full question, about autoHotKeys (and this not on TeX.SE). –  jrouquie Sep 26 '13 at 8:49