TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

marked as duplicate by Marco Daniel, Werner, lockstep, Joseph Wright Dec 2 '11 at 8:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

@Marco: Does the linked post pertain to scripts, or merely in-editor replacements? – Werner Sep 10 '11 at 20:01
@Werner: The procedure is the same. Every script which is defined in Kile can get shortcut (see link point 4). – Marco Daniel Sep 10 '11 at 20:04
Thanks Marco. I want to use a shortcut to run a shell script. It seems not exactly the same as your link. Thanks a lot :-) – Anand Sep 11 '11 at 12:32
@Werner: Please see my answer ;-) – Marco Daniel Sep 11 '11 at 18:01
up vote 4 down vote accepted

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

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.

share|improve this answer
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

Not the answer you're looking for? Browse other questions tagged or ask your own question.