13

Is there a way to allow TeXShop complete common functions to avoid typing the same word multiple times ?

For example, when you type \sub , TeXShop would automatically provide options to complete the word for you. So that you type \sub - [ Press TAB ] - \subsection ..

I find it tedious to type down common functions repeatedly.

4
  • 3
    Hit the escape key :)
    – jub0bs
    Commented Apr 10, 2013 at 18:49
  • @Jubobs can you please add that as answer to mark it as correct ?
    – Razor
    Commented Apr 10, 2013 at 18:57
  • I think you should accept Mario's far more complete answer instead.
    – jub0bs
    Commented Apr 10, 2013 at 19:03
  • I'm sorry, it took me a little while to write the answer. I was trying to get the hyperlink right. Thank you @Jubobs for the recommendation Commented Apr 10, 2013 at 19:19

2 Answers 2

17

According to About TeXShop (available here)

"Auto completion is user configurable. To configure, open the file ˜/Library/TeXShop/Keyboard/autocompletion.plist with TeXShop. Read the comments at the top, edit appropriately to redefine Landweber’s choices or add your own, and save. Be sure to edit and save in UTF-8 format if you use Unicode characters".

The source editor supports command completion. Type the first few letters of a word and hit the escape key. The remaining letters will be entered. Hitting escape again will cycle through all possible completions.

2
  • 1
    Also, if you don't like using ESC to trigger completion, you can set it to TAB in the TeXShop preferences.
    – Alan Munn
    Commented Apr 10, 2013 at 22:31
  • 1
    But don't overlook the separate "command completion" feature of TeXShop that allows you, e.g., to type \mt ESC in order to obtain, in the source edit window, the skeleton environment \begin{theorem}\label{thm:•} • \end{theorem} • split up among 3 lines, with the cursor positioned at the first placeholder.
    – murray
    Commented Jun 8, 2017 at 20:22
2

This is another way, originally commented by murray, but deserves more attention, so I'm posting this after testing:

Suppose, you want a command completion for \textcolor{red}{coloured text}, which can be used to output coloured text in colour red (to be used with \usepackage[]{xcolor} in the preamble.

  1. The GUI way (with less control of course): type and select \textcolor{}{} in the command window, then press command+shift+W (shortcut for: TexShop menu > Source > Command Compeltion > Add Word). You're now ready to use it on the fly, without restarting your work/ TexShop.

  2. The command completion editor way (If you want more advance functionalities like: the cursor jumps to the first {} while autocompletions is triggered) Go to TexShop menu > Source > Command Compeltion > Add Word. Add this: \textcolor{#INS#•#INS#}{•} at the bottom of the file, press command+s & you're good to go.

I believe, if someone takes a look at the entries present already in the editor, he/she can automate all the autocompletion needs by adding simple entries. is very versatile & powerful editor, with nearly all features built-in, IMO.

Cheers!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .