Gedit Goes LaTeX (2) – Snippets
As we set up LaTeX in the previous blog entry, it’s now time to make our LaTeX-publishing-life easier with Snippets. Snippets is a plugin shipped with gedit that helps you enter code, that you use very often. All you have to do is activate it! Open gedit, go to:
Edit->Preferences->Plugins
and activate Snippets (“Schnipsel” in the German version of gedit) by checking the checkbox.
Now you can manage your Snippets by opening:
Tools->Manage Snippets...
if your actual document (opened in gedit) is a blank file or a *.txt file, then the section Global will be opened. Otherwise the section according to your actual type of file is opened (e.g. LaTeX for *.tex). Open the LaTeX section and study the Snippets in this section.
A few hints:
- the content of the field “Edit snippet:” will be inserted when you enter the characters/symbols of the field “Tab trigger:” followed by the TAB-key
- if you want to print a ” in your file, you have to enter ‘\’ in the “Edit snippet:” field
- $1 is the position where the cursor jumps after hitting the TAB-key
- $2…$n is the position where the cursor jumps after hitting the TAB-key 2…n times
A simple Snippet (exp-function with size-fitting brackets) could look like:
\exp{\left( $1 \right)}
A more complicated one:
\section{${1:section name}}\label{${2:label}}
Try it out and have fun!
See you, Simon
_______________________________________
Screenshot of the Snippets Manager: