1 .5 C .5 M .5 Y .5 K C G Y R M B K 1

1.00 1.00

0.95 0.95

0.75 0.75

The PracTEX Journal 0.50 0.50 TPJ 2005 No 02, 2005–04–15 Rev. 2005–04–17 0.25 0.25 \starttext 0.05 0.05 ConTEXt Text Editors

C Steve Peter R

1.00 1.00 1 Introduction 0.95 0.95

Last time we saw a bit about the capabilities ConTEXt has, while writing a short source 0.75 file and running texexec from the command line. This time, we’ll look at some text 0.75 editors and TEX editing environments to make your life a bit easier. Many editors have

0.50 some sort of TEX support built in, and with a bit of coaxing, they can be made to play 0.50 nicely with ConTEXt. This column is a (partial) answer to frequent questions on the ConTEXt mailing list on how to make various LATEX-oriented text editors usable for 0.25 0.25 ConTEXt. For those of us who make a living from writing and typesetting, the choice of a text 0.05 editor is a deeply personal matter, and people frequently adopt almost religious fervor 0.05 in defending their choice. My advice is to try as many editors as you can and pick the one you feel best meets your needs. What’s right for me may not be right for you, and M G only you can decide that. In fact, I use several different editors, depending on what platform I’m on, what my mood is, whether I’ve had my 6 cups of coffee yet, and so on. All of the editors feature things you absolutely must have to do TEXnical work, like 1.00 , bracket matching, etc. 1.00 In the rest of this column, I’ll simply take up each major and take

0.95 a look at a few text editors. In fact, I only look at free products, because I’ve generally 0.95 been happy with the free alternatives, and I’ve not felt a need to spend any money on a commercial product. I will, however, point out a couple of popular commercial 0.75 0.75 offerings in the appropriate place.

0.50 0.50

0.25 0.25

0.05 1 0.05

Y B

1 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 1 2 .5 C .5 M .5 Y .5 K C G Y R M B K 2

1.00 1.00

0.95 0.95

0.75 0.75

0.50 2 Windows 0.50

0.25 Windows has no shortage of fine editors. Not all of them, however, are ConTEXt-friendly. 0.25 With a little bit of tweaking, though, most of them will run it just fine. Let us start with

0.05 an editor that does play well with ConTEXt. 0.05

C R 2.1 SciTE

1.00 The Scintilla , or SciTE, is a general-purpose configurable text editor for 1.00 Windows and X. It has support for TEX, and Hans Hagen has added lots of very nice support for ConT Xt, complete with a manual to orient you. One very nice feature is 0.95 E 0.95 command completion, whereby when you type the first couple of letters of a command, a completion box pops up; just hit tab to complete the command. 0.75 0.75 Basically, you’ll want to move the various .properties files included in the ConTEXt distribution to the SciTE folder, and simply add the line 0.50 import 0.50

to one of the Options files (accessible via the Options menu). You should probably add 0.25 0.25 it to the User Options file, although I have had much better luck adding it to my Global Options file. 0.05 Once you’ve done that, and assuming you have ruby1 installed and configured, you 0.05 can type in your source code and hit F7 to transform it into PDF. Hit F5 and your PDF

M viewer opens up and loads the file you just ran. If you don’t like the defaults, it is fairly G straightforward to edit the context.properties file to configure everything just as you like it.

1.00 1.00

0.95 2.2 TeXnicCenter 0.95

0.75 TeXnicCenter is a widely-used free TEX integrated development environment (IDE), 0.75 whose interface closely resembles the Microsoft development tools. As with SciTE,

0.50 0.50 1 An interpreted scripting language similar to perl or python. See the web site for more information.

0.25 0.25

0.05 2 0.05

Y B

2 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 2 3 .5 C .5 M .5 Y .5 K C G Y R M B K 3

1.00 1.00

0.95 0.95

0.75 0.75

within the single environment, you can edit your text, hit a button to compile the source, 0.50 0.50 and hit another button to launch your DVI or PDF viewer and load your document. TeXnicCenter also has various palettes and wizards to fill in parts of TEX syntax. Out of 0.25 the box, it is strongly oriented towards LATEX, but you can add ConTEXt support. Let’s 0.25 do that now.

0.05 0.05 Go to the BUILD menu and select DEFINE OUTPUT PROFILES • On the left, click the Add button, and give the new profile a name, such as “ConTeXt • C => PDF” R Check the box that says “Run (La)TeX in this profile”, and give the path, not to • LATEX, but to texexec or texmfstart. (This will depend on your distribution. For 1.00 MikTEX, look in C:\texmf\\bin\.) 1.00 For the command-line arguments, you can add any switches you use for texexec • or texmfstart, such as --. Use the arrow button to the right of the text box to 0.95 0.95 select a placeholder for the file (for example %pm will pass the entire path of the file, along with the extension). 0.75 0.75

0.50 0.50

0.25 0.25

0.05 0.05

M G Figure 1 TeXnicCenter doing ConTEXt!

Now, you can select your new profile from the popup menu to the left of the build 1.00 1.00 button. Click the button (or hit Ctrl+F7) and away you go!

0.95 0.95

0.75 2.3 LaTeX Editor 0.75

LaTeX Editor, as its name implies, is mainly an editor for LATEX, but it can be changed 0.50 0.50 into a ConTEXt Editor. The editor itself has borrowed ideas and code from both the

0.25 0.25

0.05 3 0.05

Y B

3 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 3 4 .5 C .5 M .5 Y .5 K C G Y R M B K 4

1.00 1.00

0.95 0.95

0.75 0.75

Scintilla project (and thus SciTE) and TeXnicCenter, but the editor still has its own feel. 0.50 0.50 Unlike TeXnicCenter, there are no build profiles so the editor has loyalty to one format only. Let’s make it our partisan. 0.25 0.25 Go to OPTIONS . CONFIGURE TOOLS • In the “(La)TeX”box, change the current entry to "C:\texmf\MikTeX\bin\texexec.exe" 0.05 • 0.05 --pdf "$(FileTitle)." (or any variants thereof you might wish)

C R Now, your ConTEXt files will be happy!

1.00 1.00 2.4 Others

0.95 0.95 WinEdt is a very popular commercial Windows TEX editor which has built-in support for ConTEXt. TUG and Dante members get a discount on the registration fee. WinShell 0.75 0.75 is another editor that is geared toward LATEX, but can be modified in the same was as above to work with ConTEXt. 0.50 And of course the Unix workhorses and Vi(m) have been ported to Windows 0.50 as well. See below in the Unix/Linux section for further discussion.

0.25 0.25

0.05 3 Macintosh 0.05

M Since the advent of Mac OS X, TEX has made huge strides in the Mac community. Gone G is Textures of OS 9 days, but OzTEX has made the transition, and Gerben Wierda’s i-Installer has raised the bar for TEX installers on any platform. However, all of these OS X offerings require an outside editor. Fortunately, we have several excellent choices. 1.00 1.00

0.95 0.95 3.1 TeXShop

0.75 0.75 Without a doubt, my favorite integrated development environment (IDE) for TEX on the Mac is TeXShop by Richard Koch and others. The built-in editor, which may be 0.50 replaced by an external editor if you wish, features many of the things that make editing 0.50

0.25 0.25

0.05 4 0.05

Y B

4 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 4 5 .5 C .5 M .5 Y .5 K C G Y R M B K 5

1.00 1.00

0.95 0.95

0.75 0.75

0.50 0.50

0.25 0.25

0.05 0.05

C R

1.00 1.00

0.95 0.95

0.75 0.75

Figure 2 ConTEXt in TeXShop 0.50 0.50 text more pleasant that we’ve talked about elsewhere in this column. Auto completion will set up common snippets for you. So if you type _ for a sub- 0.25 0.25 script, TeXShop will automatically add braces _{} and put your cursor in the middle. Command completion allows you to type in the first couple of letters of a command 0.05 and hit the Escape key to complete the command. If there are multiple matches, hit the 0.05 Escape key again to show other completions. So, typing \be and hitting Escape will

M produce \beta; hit Escape again to get \begin. G The Find panel features searching based on regular expressions. While regular ex- pressions are not trivial to deal with, they offer superior search and replace capabilities. TeXShop is almost endlessly configurable, and its developer is very responsive and open 1.00 1.00 to feature requests. To make ConTEXt the default TEX format in TeXShop, go to the TEXSHOP . PREFER- 0.95 ENCES menu. Go to the “Typesetting” tab and click “ConTeXt” as the Default Command. 0.95 Now, when you open a file or project and hit Cmd-T, TeXShop will automatically call

0.75 texexec. 0.75

0.50 0.50

0.25 0.25

0.05 5 0.05

Y B

5 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 5 6 .5 C .5 M .5 Y .5 K C G Y R M B K 6

1.00 1.00

0.95 0.95

0.75 0.75

0.50 3.2 iTeXMac 0.50

0.25 iTeXMac was originally Jérôme Laurens’ fork of the TeXShop project that has developed 0.25 in its own direction. To enable ConTEXt support, go to the TeX menu and select ACTIVATE ROJECT ON E T 0.05 P . C T X . If you need to customize the parameters, the selection is nearly the 0.05 same, but choose SHOW PROJECT instead of ACTIVATE PROJECT.

C R

1.00 1.00

0.95 0.95

0.75 0.75

0.50 0.50

0.25 0.25

0.05 0.05

M Figure 3 iTeXMac in action G

Like TeXShop, iTeXMac is more than just a text editor. It is a complete TEX IDE, and as such, you can choose a different editor if you so desire. 1.00 1.00

0.95 0.95 3.3 Others

0.75 0.75 Adam Lindsay has done a port of SciTE (see above) for the Mac X11 environment. For users coming from Windows who enjoy SciTE, this is a good choice. 0.50 0.50 Another popular editor for TEX on Mac is Alpha, which is the default editor for

0.25 0.25

0.05 6 0.05

Y B

6 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 6 7 .5 C .5 M .5 Y .5 K C G Y R M B K 7

1.00 1.00

0.95 0.95

0.75 0.75

OzTEX. It has good support for Plain TEX and LATEX, but I think you would have to roll 0.50 0.50 your own ConTEXt support. In the commercial realm, a perennial favorite is BBEdit by Bare Bones Software. 0.25 Recently, they made a lite version, called TextWrangler, freely-available on their website. 0.25 Finally, providing a good segue into the Unix/Linux section, Emacs and Vi(m) both

0.05 come with the Mac OS, and windowed versions are also available. See below for further 0.05 discussion.

C R

4 Unix/Linux 1.00 1.00 Unix is the birthplace of TEX, and the editors here are powerful, mature, and cultish. Emacs vs. Vi(m) is easily as volatile as red state vs. blue state. 0.95 0.95

0.75 0.75 4.1 Emacs 0.50 0.50 Emacs is an editor, an ersatz GUI, and a way of life. It is my editor of choice on Unix. Together with AucT X, it provides to my mind the complete editing experience. The 0.25 E 0.25 learning curve is a bit challenging, but once you form “finger habits”, you can move around source files, edit, TEX, check spelling, incrementally search for words, check 0.05 into CVS, etc., all at lightning speed. If only my brain composed sentences as quickly! 0.05 As of AucTEX v. 11.50, ConTEXt support is built in. M G

4.2 Vi(m) 1.00 1.00

I use Vi(m), but to edit various system files. There are, however, people who swear by it 0.95 to do all of their text editing. Vi(m) has LATEX support, but ConTEXt support is limited, 0.95 and at this point, basically hand-rolled.

0.75 0.75

0.50 0.50

0.25 0.25

0.05 7 0.05

Y B

7 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 7 8 .5 C .5 M .5 Y .5 K C G Y R M B K 8

1.00 1.00

0.95 0.95

0.75 0.75

0.50 4.3 Others 0.50

0.25 There is no shortage of text editors for Unix/Linux, and it seems as if new projects 0.25 spring up daily. Aside from SciTE (described in the Windows section above), most are

0.05 geared toward editing programming source code, although some (like ) do offer 0.05 LATEX support and can probably be coaxed into doing ConTEXt as well.

C Steve Peter is president and typographer at Beech Stave Press, where he has the joy and frustration of R making multilingual text look good. Send him compliments at [email protected].

1.00 1.00

0.95 0.95

0.75 0.75

0.50 0.50

0.25 0.25

0.05 0.05

M G

1.00 1.00

0.95 0.95

0.75 0.75

0.50 0.50

0.25 0.25

0.05 8 0.05

Y B

8 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 8