1

Possible Duplicate:
How to create new shortcuts on kile?

I am using Kile in Ubuntu 11.04. I have a script that is used frequently when I compile my TeX files. I wish that I could add a short cut, e.g., Ctrl+d, that could activate that script. Does anyone know whether this is possible or not? I have tried to add new command in Configure Kile -> Tools -> Build. But I failed to get what I want.

Anand
  • 3,696

1 Answers1

4

In relation to the comments I want to show how a shell script can be insert in Kile:

For the explanation we take a simple shell script

#!/bin/bash
pdflatex $@

In our example we call it shellexample. Now the shell script must be executable with chmod:

chmod a+x shellexample

To use the shell script we must copy the script to /usr/local/bin

sudo cp shellexample /usr/local/bin

Now we can run our script from every point.

Now we start Kile. In the toolbar we go to Setting -> Configure Kile. In the new window we choose in the left sidebar under Tools -> Build.

Now we can add a new tool. We push the button New... and follow the coming introduction:

  1. Toolname (in our example: shellscriptinkile)
  2. Class (in our case we need no class)

The new tool is finished. In the selected tool we add the name of our shell script in the command field : shellexample. Now we can close the Window because Kile now know our script.

At this point Kile has no shortcut for our script. To define a shortcut:

  1. go to: Settings -> Configure Shortcuts
  2. In the new open window we search in the Search-field our defined toolname: shellscriptinkile
  3. set the shortcut :D

To get some inspiration how to define a new tool you can look at the tools pdflatex, makeindex and so on.

Marco Daniel
  • 95,681
  • You reference your script as shellexample at the beginning. Should this have been shellscriptinkile as you use this later? – Werner Sep 11 '11 at 18:13
  • @Werner: shellscriptinkile is only the name of the tool in Kile. The script itself is called shellexample. – Marco Daniel Sep 11 '11 at 21:06
  • Thanks Marco Daniel, it works well. by the way, you can pass parameters like '%S' (the file name) to the script.:-) – Anand Oct 27 '11 at 12:34