11

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.

  • 2
    Hit the escape key :) – jub0bs Apr 10 '13 at 18:49
  • @Jubobs can you please add that as answer to mark it as correct ? – Razor Apr 10 '13 at 18:57
  • I think you should accept Mario's far more complete answer instead. – jub0bs Apr 10 '13 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 – Mario S. E. Apr 10 '13 at 19:19
15

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.

  • 1
    Also, if you don't like using ESC to trigger completion, you can set it to TAB in the TeXShop preferences. – Alan Munn Apr 10 '13 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 Jun 8 '17 at 20:22
0

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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