[OS X TeX] Command completion troubles
Herbert Schulz
herbs at wideopenwest.com
Mon Aug 25 22:35:29 CEST 2014
On Aug 25, 2014, at 2:27 PM, Don Green Dragon <fergdc at shaw.ca> wrote:
> Hello All,
>
> This is essentially directed to Herb and is related to his reply to Alain Schremmer concerning ``List of feature requests on this list’’ but I thought that a new subject was in order.
>
> Some time ago command completion used to work, although I used it sparingly, but at some point in the past I’ve somehow ``turned it off’’ through ignorance, not intent.
>
> I think it was caused by my effeor to eliminate the automatic appearance of {} upon entering
>
> \_ i.e., backslash followed by underscore
>
> In other words, I prefer to enter {} manually when needed. I cannot recall how I did that. Anyway I’ve been trying to re-establish command completion without success. I’m using
>
> TeXShop 3.39 and the OS is Mavericks 10.9.4
>
> and fairly recently (two weeks ago??) installed MacTeX 2014 and even ran the TeXLive utility thing thereafter. As usual TeXShop is beautiful, but it would be nice to regain that command completion stuff.
>
> I tried to follow Herb’s document:
>
> Using Command Completion with TeXShop 2012/05/14 (the .pdf file)
>
> and did the following:
>
> -1- Changed the name of the directory
>
> ~/Library/TeXShop/CommandCompletion/
> to
> ~/Library/TeXShop/CommandCompletionOLD/
>
> -2- Quit TeXShop and then re-opened it.
>
> -3- Checked that a `new' directory ~/Library/TeXShop/CommandCompletion/ had been created, and it had and seemed to have all the stuff that the OLD guy had contained.
>
> -4- Opened an existing small .tex file and attempted to invoke the various examples in Herb’s PDF. None of them worked!
>
> The \_{} response still does not appear, as desired. I looked in Herb’s ``Tips & Tricks’’ again and am now convinced that I used the "Macros -> Open Macros Editor" guy for TeXShop and changed something.
>
> Any suggestions?
>
>
> don green dragon
> fergdc at shaw.ca
Howdy,
There are three features of TeXShop which often get mixed up with each other: Key Bindings (at one time confusingly called Auto-Completion), Macros and Command Completion. Although they share similar features it is possible to tell the difference between them. Key Binding assign a set of keystrokes to the application of a single key; e.g. typing _ produces _{|} (where | is the insertion point --- the place where text will be inserted) or typing ≤ (Opt-, with the English Keyboard) produces \leq. Macros can also can also insert simple text and be given a keyboard shortcut (that always uses the Cmd key plus other keys but are most useful when attached to Applescript programs so they can do special processing of Source text, etc. Command Completion (NOT to be confused with Auto-Completion) allows one to type a partial command or short abbreviation and, when a trigger key is pressed (Esc by default but it can be set to Tab) have that partial command or abbreviation get expanded into a full command or even environment structure. I'll talk about each separately.
Key Bindings:
As stated in `TeXShop Tips & Tricks' you turn Key Bindings on by checking TeXShop->Preferences->Source->Editor->Key Bindings. Of course you turn it off by un-checking that preference. You can turn it On/Off for a given document by using the Source->Key Bindings->Toggle On/Off menu item (a Check Mark means it's On). You can see the list of Key Bindings and add more, edit the ones that are already there or delete ones you don't ever want to use by starting up the Key Bindings Editor using the Source->Key Bindings->Eddit Key Bindings File… menu item.
Macros:
The Macros Menu contains a fairly large number of pre-defined macros. Some of them simply insert text but I find the best ones do much more and are embedded Applescript programs. Keyboard shortcuts can be assigned to these macros; they must all contain the Cmd key.
Command Completion:
For Command Completion you enter a partial command name or a short abbreviation, press a trigger key (Esc or, as mentioned above, Tab if so set in TeXShop->Preferences->Source->Command Completion Triggered By:) and it gets expanded. E.g., enter
\sec
on a new line and press the trigger (Esc) and you get
\section{|•|}
(where |•| is a selected bullet [called a Mark in Command Completion parlance] so typing will delete that selected Mark andinsert whatever you type. If you press the trigger again you get the
\section*{|•|}
and another press of the trigger gives
\section[|•|]{•}
for separate section titles in the TOC and the document. For the last case note that there is a second Mark (•) for the second argument. After entering the TOC section title to jump to the next argument (shown by the Mark) by using Source->Command Completion->Marks->Next Mark (Ctl-Cmd-F) which will also select that Mark and then type the section title for the document.
Better yet are abbreviations. E.g., type
\benu
and press the trigger to get
\begin{enumerate}
\item
|•|
\end{enumerate}•
ready to enter the first item. To get a new \item simply type
\it
on a new line and the trigger to add
\item
|•|
finally to get to the very end of the enumerate environment use (Ctl-Cmd-F) and jump to and select the Mark at the end where simply typing a Return will remove that Mark and take you to the next line.
I hope this straightens things out a bit.
Finally, you say ``-4- Opened an existing small .tex file and attempted to invoke the various examples in Herb’s PDF. None of them worked!'' so I'd like to know exactly what you did and what your trigger is set to be. Also, it's bad practice to (re)move anything from ~/Library/TeXShop while TeXShop is active (that's true for any application); first shut TeXShop down and then (re)move the folder/etc.
Good Luck,
Herb Schulz
(herbs at wideopenwest dot com)
More information about the macostex-archives
mailing list