8

The shortcut Alt + SHIFT + ( inserts \left( \right) within the text.

How to create new shortcuts in Kile to insert other delimiters, such as [] {}?

Olivier
  • 208
Regis Santos
  • 14,463
  • Presumably you know you can assign shortcut key combinations to \left[, \right], ... individually through the usual kile assign shortcuts mechanism? – mas Sep 02 '11 at 19:51

1 Answers1

12

In the German community UbuntuUsers a similar question was answered. Here the original Question: Kile: eigene Shortcuts definieren?

So I answer this question in relation to the linked post. I tested my answer with Kile 2.1 beta 4

  1. Open Kile
  2. go to: LaTeX -> User-Tags -> Edit User Tags
  3. Add your own user tag.

If these settings are lost after a restart, use the following guideline:

First add a new shortcut to your own kilerc:

  1. Open the file kilerc

    gedit $HOME/.kde/share/config/kilerc
    

    I use gedit in Ubuntu, but you can use a different editor if you want.

  2. Search for the following string in the open kilerc: [User]

  3. Under [User] add the following lines:

    nUserTags=1
    userTag0={%C}
    userTagName0=bracket`
    
  4. Open Kile and go to

    Settings -> Configure Shortcuts

  5. Search for bracket and set the shortcut.

EDIT Today I found the correct documentation

User-Defined Tags

Marco Daniel
  • 95,681
  • Thank Marco. And cursor between {and}? equal to $ $ where the cursor is in the middle. – Regis Santos Sep 04 '11 at 04:37
  • Might I repeat the question of Regis da Silva: How does one ensure that the cursor is in between the braces? I am trying to get \enquote{} to work like \textit{} from the toolbar so that one could select text and have it italicized. I want to do the same with \enquote{}. Simply defining it as a user tag and adding does not seem to plant the cursor between the braces. What am I missing? Thanks. – chandra Nov 01 '11 at 17:19
  • 1
    @chandra: %C: this is where the cursor will be placed after the insertion of a user-defined tag. – Marco Daniel Nov 01 '11 at 17:36
  • Thank you, Marco. I have done that and now get a blinking cursor between the braces. That is OK when I want to insert text after invoking \enquote. But I am still unable to replicate the behaviour of \textit{} which grabs the selected text and puts it between the braces when \textit{} is invoked after the text has been typed. With user tags, does it have to do with Add versus Insert? I tried both but cannot find any difference. – chandra Nov 01 '11 at 18:05
  • @chandra: Now I understand you problem. I have to test it. – Marco Daniel Nov 01 '11 at 18:12
  • Oops! I have just seen your link to the docs. I have amended my entry to \enquote{%M%C} and it now works as desired! Thank you very much. – chandra Nov 01 '11 at 18:17
  • And here is a generic shortcut for any simple macro with one argument: \%C{%M}. My purpose is that I can write the text without formatting, then I read it again, select words/parts, then apply the schortcut and write down the exact macro to apply to it. (In inline linguistic examples with textglos, there's at least \xv{} \xo{} \xt{} \xm{} \gl{} and I defined quite a few others... that I really use a lot and all at the same time. It would be too much shortcuts to set and remember.) – benjamin May 27 '18 at 12:15