# [texworks] auto completion

Herbert Schulz herbs at wideopenwest.com
Sun Apr 3 13:42:54 CEST 2011

On Apr 3, 2011, at 3:07 AM, Stefan Löffler wrote:

> Hi,
>
> On 2011-04-03 09:51, Andreas Hirsch wrote:
>> quoting Suresh Kumar, [03.04.2011 07:32 +0100]:
>>> Hi
>>> Much to my surprise I found that it is possible to do auto completion like
>>> in eclipse by configuring texworks. I found some scripts installed already
>>> in my linux machine which contains the line:
>>>
>>> bali:=\begin{align}#RET##INS##RET#\end{align}•
>>>
>>> What is this last big size bullet?
>> It is intended to reach the next editing point via <ctrl><tab>
>
> The easiest way of inputting it will probably be copy/paste.
>
>> I have a related question:
>>
>> Where ist a predifined completition for
>>
>> bite:=\begin{itemize}#RET#\item#RET##INS##RET#\end{itemize}•
>>
>> which expands to
>>
>> \begin{itemize}
>> \item
>>
>> \end{itemize}•
>>
>> I would like to have it modified to
>>
>> \begin{itemize}
>> \item
>> \end{itemize}
>> •
>>
>> and tried therefore bit:=\begin{itemize}#RET#\item
>> #INS#\end{abstract}#RET# •
>>
>> which expands to the same as the original - or is it due to the fact
>> that I could not override the predefined fils?
>
> Yes, overriding it should be possible. The file where this is defined is
> <resources>/completion/tw-latex.txt [1]. Note that there are two
> entries, though: one for "bite", and one for "\bite". Maybe this causes
> some confusion.
> BTW: your alternative definition seems flawed (\end{abstract}, for one
> thing), but I assume that's for testing only.
>
> HTH
> Stefan
>
> [1] The location of the resources folder is system-dependent. See

Howdy,

On thing to note: There are lots of environments pre-defined in the completion file but certainly not any custom environments you may use. You can always add more to the completion file.

However, in TeXShop (Mac only, and the basic design of Command Completion is based on the version there that) there is one other more general completion, for occasional use, to complete an arbitrary environment \begin{myenv} with an \end{myenv}. You first type the \begin{myenv} and press Esc (that would be Tab, the Command Completion trigger, in TeXworks) and the \end{myenv} gets put on the next line. It might be worthwhile to add that to TeXworks.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)