Oracc ATF Text Template Generator

This form creates ATF templates to take some of the drudgery out of typing texts. The results are not intended to be perfect; the idea is just to give a useful start to text-typing.

Documentation is at the end of this file.

To use it, just type or paste template specifications into the text field below; more documentation is given after the text field. The output is sent back as a text document to the same window as you are using; just select all, copy it and paste it into your text editor. You can either give fragments to get templates--without even an &-line--or you can make templates for an entire volume of texts and expand them all to include their P-numbers, designations, block structure and line numbers at one fell swoop.

(If your list of templates is more than a few hundred lines you may need to split it into several chunks to process it all successfully.)

Project for texts:
Default language for texts:
Default protocol for texts:


The input is a series of lines: lines that start with '&' are ATF &-lines; if the line has an ID starting with P or Q, the designation is looked up and added; if it has an ID starting with X, or if it has no ID the template generator tries to find the P-number for the text based on the rest of the line (if there is an X-ID, the rest of the line following the '=' sign is used). If it can't find a P-ID it just outputs the &-line unchanged. If multiple P-IDs appear to match the keys in the &-line, all the matches are output.

If a line starts with '#' it is a comment; the line is passed through unchanged.

Otherwise, the line is parsed as a list of block and line-number specifications. Each specification token is separated by spaces. The rules for the tokens are simple:

o = obverse         r = reverse

le = leftedge       re = rightedge     te = topedge       be = bottomedge

c<N> = column N

N = line number     N1-N2 = range of line numbers

The normal prime, exclamation and question-mark flags are allowed at the end of any token; in addition, three special flags are understood which create $-lines instead of block tags and line numbers:

] = broken   # = traces    _ = blank

A special distinction is made in $-specifiers between cN] and Nc]: the former generates $ column N broken; the latter generates $ N columns broken.

The special codes c-] and c+] generate $ start of column broken and $ rest of column broken respectively; the other special flags behave similarly.

Similarly, o-], o+], r-], r+], and all the other surface designators, produce $ start of obverse broken, etc.

It's easiest to learn to use this utility by playing with it, but here is an example:

#a comment
1-2 3] 1'-3' r c1 1-3 c2#


&P100001 = AAS 013
#atf: lang sux
#a comment
$ 3 lines broken
@column 1
$ column 2 traces