Tuesday, June 5, 2012

TeXmaker: Setting up user tags

Texmaker is a really nice LaTeX editor, and has become my default choice. It has many things to recommend itself, including the fact that it is platform independent, has auto-complete (commands, references, and citations), is easy to configure and use etc.

A particular feature that I have grown to depend on is command shortcuts. Texmaker allows the user to define keyboard shortcuts to commands and environments, by going to User > User Tags > Edit User Tags.

Simple commands are quite easy. For example, if you find yourself using the command "\pause" (in beamer presentations) very frequently, you can go to User > User Tags > Edit User Tags, pick a function key (1-10 - say "1"), enter "\pause" in the LaTeX content box. Pressing Shift+F1, automatically inserts \pause at the cursor.

Let us say you have a lot of vectors in your equations, and you like to bold-face your vectors with \mathbf{}. You can create a shortcut to this by saying "\mathbf{@}" in the LaTeX content box. When you press Shift+FX (X=1-10, as appropriate), you get the \mathbf{} tag, and your cursor lies between the curly braces. You can also select some text and press Shift+FX and the \mathbf{} tag does what you would like/expect it to to.

You can also define shortcuts to environments. Say you use the "\begin{frame} \end{frame}" environment a lot. All you do is say "%frame" in the LaTeX content box.


escudero89 said...

Thanks for your tip. I was searching for a feature like that in texmaker :).


Sachin Shanbhag said...

You're welcome