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 LaTeX->User Tags->Edit 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.

To show you how this works let's say for example that we have a user-defined tag, which contains the value \bfseries{%M}%C, and I have a selection of text highlighted in my document that we want to turn into bold text. So, we highlight the phrase I love Fridays, apply our user-defined tag by pressing Ctrl-Shift-1, and we get the text \bfseries{I love Fridays}, with the cursor placed at the end of the text.