My article for Vector

Stephen Taylor (editor@vector.org.uk)

Vector used to ask authors to submit articles as Microsoft Word documents. While we continue to accept contributions in this form, we prefer plain text files, or plain text files marked up in simple XHTML. This article explains how to prepare and submit an article to Vector.

Fast start for the impatient

You don’t need to read this article. You can simply send us your article as a text file. Or, with a little more trouble, mark it up in XHTML.

For the very impatient: text files

  1. Install the APL385 Unicode font on your machine. In Windows open Notepad; on a Mac, install and launch TextWrangler. Set the display font to APL385 Unicode.
  2. Write your article in English in plain text, omitting any APL.
  3. Save your article, ensuring you specify the UTF-8 encoding.
  4. Paste or type in any APL program listings. Paste or type in any APL expressions needed in the body of the article.
  5. If you want to include illustrations, just mark where in the article they should appear, eg:
    can be seen that both monadic implementations
    outperform ⍋⍋, as shown in Figure 1.
    
    [fig01.gif]
    
    On the other hand, two dyadic implementations of ⌈ have been
    widely observed to run
    
  6. Save the file.

For the slightly less impatient: XHTML

  1. Write your article as a text file, as described above.
  2. Download the source of this article and open it in another window of your text editor.
  3. Replace the content of this article with the content of your article. Save the result as eg myarticle.htm without changing the UTF-8 encoding.
  4. Open myarticle.htm in a web browser to inspect it.

When you are happy with your article, attach it and any image files to an email message to the editor.

The remainder of this article expands on the above.

Background

Previously we had conflicting schemes for representing APL characters. Now we have a single scheme: Unicode. While it is not without problems, it is much better than what preceded it.

Moreover, Unicode allows us to work in common text editors, mixing Latin and APL characters in the same document – and Cyrillic, Korean or Chinese should we need them. And the same scheme works (with some cautions) in web browsers, so we can write Web pages that can be read by non-APLers.

Authors naturally want to see how their articles will look when published. Microsoft Word provides different ways to get similar visual effects, and authors have used whatever methods they knew to emulate the journal’s visual style.

Unfortunately, this formatting seldom related to how the journal is actually prepared for press, and the editors’ first task with an article used to be to remove all the author’s formatting!

We have revised our production process. The change allows authors to submit articles with no formatting at all; alternatively, to use formatting that does not have to be replaced before printing.

Encoding

Using the right encoding for text and XHTML files is the single most important factor in our new process.

We use the UTF-8 encoding scheme, without a byte-ordering mark (BOM).

You might not be used to paying attention to how your text editor encodes files. Please ensure you send Vector only files encoded as UTF-8.

Encoding is generally specified as an option when saving the document. (Or one can select it as the default encoding, editing and saving all documents in UTF-8.)

Modern operating systems handle UTF-8 files smoothly: Windows XP and Vista, and MacOS X. Windows NT machines might not.

Text editors

Many text editors handle UTF-8 files. We have had good results with the following text editors.

Windows
Notepad – the text editor included with Windows
Notepad2 from Flo’s Freeware
Notepad++ (freeware)
UltraEdit from IDM Computer Solutions Inc.
Macintosh
TextWrangler free from Bare Bones Software, Inc.

(Watch out: TextEdit, the native MacOS text editor, doesn’t seem to handle UTF-8 files well in its ‘plain text’ mode.)

Fonts

Machines with operating systems that handle Unicode often have fonts that can represent APL characters, and the OS will find them when it needs to display APL characters. For example, Microsoft Office ships with Arial MS Unicode. However, the APL glyphs (symbols) in these fonts have been provided for completeness rather than frequent use. APL code displayed using these fonts is usually readable, but likely to look awkward and unfamiliar.

We therefore strongly recommend downloading and installing the APL385 Unicode TrueType font. This works well on both Windows and MacOS machines. It will allow your browser to show Vector web pages at their best.

Select it as the display font in your text editor.

Pasting and typing APL characters

Your Unicode text editor will let you read, copy and paste APL characters. Several APL interpreters support copying and pasting using Unicode; for example, APL2, APLX and Dyalog.

With the right input method editor (IME) you can type non-Latin characters, for example Chinese, Cyrillic, Greek – or APL. Both APLX and Dyalog now install with IMEs that allow you to type APL characters in applications that handle text.

Without an IME you can still type APL in your APL session and copy the result into a text editor.

Marking up

If you haven’t marked up plain text as a web document before, you might be surprised how little there is to do.

From the View menu of your browser, pick Source or Page Source. You can see the content of this article marked up with tags to show what is a paragraph, what is a heading, and so on.

There is also a header section, which you can simply copy without paying any attention to it.

The markup we use

XHTML offers many tags for marking up your article. We use only a few of them.

You can learn the use of these tags from one of the many textbooks available, or (even better) from the formal specification. But you can probably learn all you need to know just by using (the source of) this article as a model.

For that purpose, you’ll find helpful comments embedded in the article source.

Here’s a list of all the tags we use for marking up an article.

Block elements
blockquote dl h1 h2 h3 ol p pre ul
caption table tbody td th thead
Inline elements
a abbr acronym br cite code em img strong

Notice i and b are not listed: they are deprecated by the W3 Consortium and we do not use them.

Marking up in XHTML

If you have marked up before, using HTML, you will find XHTML much the same, just a little stricter:

We can sort these issues out ourselves, of course, but many contributors wish to spare us the trouble. The W3 Consortium validator will validate your markup and complain bitterly about any errors.

APL listings and expressions

Some APL expressions can simply be shown ‘in line’, that is, embedded in the body text. You would usually do that with {(+/⍵)÷⍴⍵} and other short expressions. Multi-line listings need the pre block element:

[0]   Z←D RULERA L;I;N;T;IO;PW
[1]  ⍝L: Length of the ruler
[2]  ⍝D: Distance between ticks
[3]  ⍝Z: a ruler of length L with ticks every D places
[4]  ⍝   modelled after S Taylor's problem in Vector
[5]   ⎕PW←L+⎕IO←1
[6]   Z←L⍴((D-1),1)/'¯∧'
[7]   I←(Z='∧')/⍳L
[8]   N←⍉⍕,['']I
[9]   T←((↑⍴N),L)⍴' '
[10]  T←[;I]←N
[11]  Z←T,[1]Z
    ∇ 2008-09-18 19.03.04 (GMT-4)

Illustrations

A helpful diagram
A helpful diagram

It is easy to mark up your article to include illustrations.

Practices to avoid

If you have marked up using HTML before you might have learned some techniques we avoid.

Presentation

HTML lets you control the presentation of text using elements such as FONT and attributes such as color and size. Vector presentation is controlled by the site style sheets.

Use only semantic markup. In particular, avoid using width and align attributes when marking up tables.

Follow the markup for this article as a model.

We make some use of predefined style classes from the common stylesheet, but style markup is best left to the editors.