User-Defined Tags

Kile gives you the ability to make your own tags. A tag is similar to a shortcut that launches some command or writes frequently-used text. For example, Joe Sixpack uses often the sentences I prefer \LaTeX\ to \TeX\ and What would I do without Linux®?. To create user-defined tags to write these sentences, he would access LaTeXUser TagsEdit User Tags...; this will present him a dialog where he can create his own user-defined tags.

The Edit User Tags Dialog

The Edit User Tags Dialog

Invoking a User Defined Tag

Invoking a User Defined Tag

He would probably give each tag a name that can clearly identify it. The name you give your tag is entered in the section marked Menu item, and the text of frequently-used command should be entered into the section labeled Value. Once the commands are entered, he can use them quickly using the shortcut Ctrl+Shift+1 for the first tag to enter I prefer \LaTeX\ to \TeX\ and Ctrl+Shift+2 to enter What would I do without Linux®?.

Placeholders in User-Defined Tags

There are some placeholders you can use in user-defined tags: they are %B, %C, %M and %S.

  • %B: will be replaced by a bullet.

  • %C: this is where the cursor will be placed after the insertion of a user-defined tag.

  • %M: this stands for marked text; the selected text is inserted in its place when inserting user-defined tags.

  • %S: will be replaced by the source file's name without file extension.

Let's consider the example you can see in the screenshots. First, we select a number in our text, let's say 2. Now we press Ctrl+Shift+1 or choose LaTeXUser Tags Frac, and we obtain \frac{2}{} with the cursor begin located within the second pair of brackets.