Docs / Opening repertoires
Opening repertoires - line names, order and numbers
A repertoire is a tree of moves. A line is a complete path from the first move to a position where the repertoire has no further move. When you publish a repertoire, LilyChess computes its lines, names them, sorts them and numbers them. The Lines tab of the editor shows exactly the same result before you publish, so there is no surprise afterwards.
Naming a line
Select a move in the editor. Next to the comments you will find two fields:
- Line title: a short text (80 characters at most), for example
Italian Game. - Frequency: how common this move is compared with the other moves played from the same position. A higher number comes first.
The title of a line is built from the titles of its moves, in order, joined with -. Moves without a title are skipped. A line with no titled move has no title and is shown by its moves.
| Moves with a title | Resulting line title |
|---|---|
1.e4 Open Game, 3.Bc4 Italian, 3…Bc5 Giuoco Piano | Open Game - Italian - Giuoco Piano |
1.e4 Open Game, 3.Bb5 Spanish | Open Game - Spanish |
A title belongs to the move itself. If the same move is reached by transposition in several lines, all of them carry the title. A title on a move that only ends a shorter line is still part of the longer lines that go through it.
Sort order and numbers
Lines are sorted with these rules, which never change between two publications of the same tree:
- Lines with a title come first, then lines without a title.
- Titles are compared in a natural way: case and accents are ignored and numbers count as numbers, so
Line 2comes beforeLine 10. - When two lines have the same title, or no title, the first move where they differ decides. The move with the higher frequency comes first; if both have the same frequency, moves are sorted alphabetically by their standard algebraic notation.
- The lines are then numbered 1, 2, 3 and so on.
Two lines may share a title. The editor warns you about duplicate titles but never blocks the publication.
Where the frequency comes from
When you add a move from the games database (the explorer), the frequency is set to the number of games found at that moment. It is then frozen: it does not change if the database grows later, so your order stays stable.
You can edit the frequency of any move at any time to reorder your lines. A number you type always wins over the stored value and is never overwritten. The Restore button removes your number and brings back the database value. The Up and Down buttons move a move among its siblings by adjusting the frequencies for you, and the preview shows the new order immediately.
A move that was not added from the database has frequency 0 until you give it one.
Preview and publishing
The Lines tab lists every line with its number, its title (or its moves), its opening code, and a summary: number of lines, lines without a title, duplicate titles. Changes to titles, frequencies or moves update the list at once. Titles and frequencies take effect for students when you publish; the repertoire is marked as a draft until then.
Publishing keeps the identity of each line that has not changed, so renaming or reordering lines does not reset anyone’s training progress.
PGN
Titles and frequencies travel in the comment of the move, with two commands in the same family as the arrows and squares commands:
1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 {[%title "Giuoco Piano"] [%freq 120]} Written inside the comment of the move, [%title "Giuoco Piano"] sets the title and [%freq 120] sets the frequency. The export writes them and the import reads them, removes them from the comment text and never erases an existing title or frequency when the file has none. Other chess software ignores these commands. The one game per line export also adds LineNumber and LineTitle tags.
See also How PGN is used in LilyChess and PGN - supported syntax and limits.