User defined tags

User defined tags

Kile gives the user the ability to make tags for their document. A tag is similar to a shortcut, where the user can create their own commands or text they use often in their document and access that tag using the keys Ctrl-Shift-1. For example, when writing I often use the phrases "I prefer LaTeX to TeX" in my text and "What would I do without Linux?" To create these as user defined tags I would:

This will give me a dialog where I can create my own user defined tags.


The edit user tag dialog.

Invoking a user defined tag.

To create my two user defined tags I use often when writing I would give each a name that can clearly identify them. The name you give your tag gets entered in the section marked "Menu Item" and the text of command I use often would get entered into the section labeled "Value". Once I have them both entered, I can use them quickly in my text by using the shortcut Ctrl-Shift-1 for my first tag to enter "I prefer LaTeX to TeX" and Ctrl-Shift-2 to enter "What would I do without Linux?"

Unique characters in User defined tags

There are several unique characters in Kile, these characters have unique meaning in user defined tags and they are %, %S, %M, %C and %env.

  • % : A character used to comment your source code

  • %S : Replaces the source file name

  • %M : This stands for marked text; where the selected text is inserted when using user defined tags

  • %C : This is where the cursor will be placed after using a user defined tag

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

KDE Logo