[texworks] \begin...\end environment completion?

Murray Eisenberg murrayeisenberg at gmail.com
Fri May 6 21:57:03 CEST 2011


Sorry, I was indeed using texworks whereas I had intended to use 
TeXShop: I hadn't noticed that when I double-clicked the source tex file 
it opened in texworks instead of TeXShop. And then I confused the names 
of the front ends. No wonder I couldn't find what I wanted in the Help, 
which was for texworks instead of TeXShop.

What you say works, and I thank you.

On 5/6/2011 3:29 PM, Herbert Schulz wrote:
>
> On May 6, 2011, at 10:12 AM, Murray Eisenberg wrote:
>
>> I'm using current texworks in Mac TeXShop. Is there some way to cause the texworks editor to supply automatically the \end{env} part of a \begin{env}...\end{env} environment delimiters after I type the "\begin{env}" part?
>>
>> This is something I'm accustomed to doing in WinEdt under Windows (with any TeX engine). There, for example, if I type
>>
>>   \begin{enumerate}
>>
>> and press Alt-Enter, the editor automatically inserts a blank line after what I typed, automatically types \end{enumerate}, and positions the cursor back at the start of the blank line, so what I have is:
>>
>>   \begin{enumerate}
>>   *
>>   \end{enumerate}
>>...
>
> Howdy,
>
> Ummmm... Are you using TeXworks or TeXShop?
>
> If you are using TeXShop there are several ways of getting that completion with the latest version:
>
> (1)If you have
>
> \begin{myenvironment}
>
> with the cursor just after the closing brace simply press Esc and the corresponding
>
> \end{myenvironment}
>
> will be placed on the next line and the cursor will remain where it started.
>
> (2)If you are using TeXShop 2.41 you can complete an environment (i.e., balance \begin...\end) by using the Source->Close Current Environment (Ctl-Cmd-C) which will give you the \end{myenvironment} with the cursor at the end of the statement.
>
> (3)If you are using any of the usual environments you can use Command Completion (TeXworks has a similar feature as TeXShop in this instance). E.g., to get a skeleton for an enumerate environment simply write
>
> \benu
>
> at the start of a line and press Esc (with TeXworks you press Tab --- TeXShop lets you make the ``trigger'' key Tab too in TeXshop->Preferences->Source->Command Completion Triggered By:) and you'll get (a little bit different in TeXworks)
>
> \begin{enumerate}
> \item
> |•|
> \end{enumerate}•
>
> where |•| is a selected • (called a Mark for Command Completion). You can move from Mark to Mark, etc. For TeXShop take a look at ~/Library/TeXShop/CommandCompletion/Quick Start Guide... or the full documentation for a list of all completions/abbreviations supplied by default with TeXShop (~/Library/ is the Library folder in your HOME folder).

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305




More information about the texworks mailing list