# ConTeXt: an alternative to LaTeX

I’m working on a full release of my tabletop roleplaying game LORE, which I released as a beta in 2009. The game will be extensively updated with clarifications, rebalancing, enhancements, and a far-better “conflict” system that provides a unified rule set for combats, debates, and other interesting situations. There’s one problem with the LORE beta that’s more visible than any of these.

The LORE beta is ugly.

I laid it out in OpenOffice.org, which is a word processor, not a document layout application. There’s a standard solution for the terminally technical author who wants to produce beautiful documents: LaTeX, hereafter referred to as “Latex.” Unfortunately, as great as Latex is at providing low-effort, decent layout for things like academic articles, it’s really awkward and frustrating if you need to do the kind of complex page layouts that a roleplaying sourcebook demands.

My alternative? ConTeXt. Or, for my sanity, “Context.” Context is based on TeX like Latex is, but it’s focused more on general purpose typography and page layout than Latex, which mostly tries to keep those concerns out of the user’s way. Despite its frustratingly limited documentation, Context has proved far better-suited to my project. I’ll explain in more detail below.

### The Problem

To start with, the basics: each book, of which there will be three in the first release, is over fifty pages. These pages are generally divided into two columns, although there are often tables or supplemental text boxes that will span these columns. The text needs to flow automatically around these elements; I can’t spend all my time tweaking where lines break. Additionally, there will often be figures or sidebars that float on a page with text flowing around them. I often want to guarantee that these floats appear on the same page as certain body text, such as a chapter heading or a rules explanation. On top of all of this, I want my compiled PDFs to include bookmarks as well as a linked table of contents and index.

To the right is an example of the kind of page that has given me trouble. Note that the layout is not final and color has been added for clarity. A chapter begins with text in two columns. There are two floating text boxes: one at the bottom of the page that spans the whole page and has two columns of text in it (tinted blue) and one that floats to the left of the page above the first (tinted red). Each of these boxes should set its own size based on the amount of text in it, and the normal body text should flow around them in a simple way. If I change the body text, I shouldn’t have to do anything to reflow the text.

### In Latex

This is furiously hard to do in Latex, but to give you an idea on what is involved I’ve prepared some sample source code. It uses shortcuts that are defined in various modules and style files. The following code gets everything working except the red box:

 \chapter{Conflict} \index{conflict|(} \phantomsection \addcontentsline{toc}{section}{Contests instead of Conflicts}

 A lot of roleplaying systems have a combat system. It gives rules for fighting and killing to resolve problems. LORE extends this concept into a \textbf{conflict} system. ... \begin{figure}[b] \medskip \begin{shadebox}[\textwidth + 1em] \section*{Contests instead of Conflicts} \index{conflict!using contests instead} \label{sec:simplifiedcombat} \begin{multicols}{2} Not all situations need the conflict system. ... \end{multicols} \end{shadebox} \end{figure} \newpage \section{Goals and Consequences}\index{conflict!goals|(indexbold} \index{conflict!consequences|(indexbold} When a conflict begins, the GM describes the situation. The players decide on a \textbf{goal} they want to accomplish: maybe learn everything the witness knows about the killing," convince the captain to spare the stowaway," or stop the creature before it reaches town." ... Other examples of goals and consequences are: \begin{itemize} \item Hack into the target's computer without being traced or else the police will show up ... \end{itemize} 

\clearpage 

### In Context

After struggling with the above situation, where I wanted multiple floats on a certain page that had multiple columns and a chapter heading, I checked out other options. Here’s the same code in Context, including the smaller red float:

 \chapter[Conflict]{Conflict} \startregister[index][conflict]{conflict}

 \startcolumnset[standard] \startcolumnsetspan[wide][default=btlr] \section{Contests instead of Conflicts} \index{conflict+using contests instead} \startsimplecolumns Not all situations need the conflict system. ... \stopsimplecolumns \stopcolumnsetspan A lot of roleplaying systems have a combat system. It gives rules for fighting and killing to resolve problems. LORE extends this concept into a {\bf conflict} system. ... \startcolumnsetspan[narrow][default=lrbt] \subsection{Example Conflict: Share the Signal} ... \stopcolumnsetspan \section{Goals and Consequences}\index[conflict+goals]{conflict+{\bf goals}} \index[conflict+consequences]{conflict+{\bf consequences}} When a conflict begins, the GM describes the situation. The players decide on a {\bf goal} they want to accomplish: maybe \quotation{learn everything the witness knows about the killing,} \quotation{convince the captain to spare the stowaway,} or \quotation{stop the creature before it reaches town.} ... 

Other examples of goals and consequences are: \startitemize[intro] \item Hack into the target's computer without being traced or else the police will show up \item Win the jousting tournament or the dark knight will win the heart of the prince ... \stopitemize

The Context code is a lot cleaner and more readable, and I find that the Context approach to things makes it much easier to separate formatting and content. Additionally, although you can’t see it here, the Latex version requires over 20 external packages, each of which does a little (or a large!) tweak that enables the whole thing. Context? Everything works out-of-the-box. Unfortunately, it’s more difficult to figure out just how to get it out of said box.

### The Problem with Context

Other than the fact that it’s impossible to google, of course.

Context’s documentation is not sufficient. It’s certainly extensive; there’s a wide array of impressive-looking and poorly-organized texts available at their documentation project, and the Context Wiki provides more concrete assistance. However, it’s still a chore figuring out how to do some things.

The main problem is that the documentation can’t decide if it wants to be a manual or a recipe book. It will, at times, print complete documentation for a command. At other times, it will just give fifteen cool examples of how the command can be used but not explain what the various options actually mean. At their worst, the docs will show what the nine different ways to lay out a command look like… but not label which is which.

I want simple API documentation that lists every command and what it does. This is especially frustrating when it comes to two things: columnsetspans, which are described in one section of one auxiliary manual and were apparently promptly forgotten; and the maddening experience of customizing title spacing in a grid-based layout.

Still, I’m not going back to Latex. Context is far better for my purposes. If I were typesetting an essay or a novel, I might use Latex, but my formatting requirements demand something that enables more control.

## 11 thoughts on “ConTeXt: an alternative to LaTeX”

1. Ezra says:

Yay new post!

Now I’m going to consider switching my project from (Xe)LaTeX to ConTeXt. I don’t have heavy layout needs, but ConTeXt’s “modes” feature could help me export to different sizes for print and screen reading.

I think you meant to switch “red” and “blue” above: the two-column box is blue, and the one above it is red.

2. I’ve flirted around with modding LORE in its beta version. I’m kind of grateful that I didn’t get far with it, now.

I’m intent on making modules for this, day one. Ha, it’s probably going to be like a Halo launch for ‘normal’ people. Some things I feel like adding:

A spirit ability, working along side Body, Mind, and Charisma. This would be the basis for adding a ‘second health’ to each character which represents their composure/weariness/sanity.

Balanced support for Matt Rundle’s Anti-Hammerspace Item Tracker. That, and an acronym for it so that I don’t have two spend 12 syllables saying it.

Super-hardcore space combat rules. 30 second rounds to allow for useful boarding combat;ships commanded by multiple individuals, each of which commands a particular function; systems for computing ship functions (like repairs and fire control); optional 3d rulesets (on a 2d board, with tokens to mark elevation); acceleration-based navigation.

Gameworlds/campaigns/Characters.

Extras, extras, extras. Okay, after this, THEN you can say you have enough swords.

Tweaks, suggestions, and requests.

And, of course, forcing my GM upon my friends.

1. The basics of the system are still mostly the same, although the numbers have changed a bit. The health/combat system has changed to a condition/conflict/affliction system, which may satisfy your desire for a mental health stat.

Item tracking would be a cool addition! The fantasy module has a thing where you can carry a certain number of “large” items according to your Body and as many small items as you want, but a more in-depth system would be an awesome option.

More tactical combat for vehicles would be neat, too! I’ve deliberately taken steps away from that in this edition to encourage more unified narrative play, but I also like tactical stuff and would be really interested to see a system written for LORE.

1. I’m going into this with Gundam in mind. Big robots, heroes journey, tempered realism, and space-ballets-of-death, among other things. I don’t intend for this to lead too much into the regular game as much as engender original campaigns. The ship designs, the balance of plasma-bullets-scissors (every space game does it a little different), and possibly other pieces, could be used for a more general-use module.

Anti-hammerspace is just the coolest thing ever. Cool enough, in fact, that I have no qualms mooching. Since I need merely translate 20d to 2d6 (basically), my work boils down to testing it out and telling everyone which version works.

One last thing. I toyed around with the idea of neutral traits in LORE. These are traits that have both positive and negative affects that roughly balance each other out. Each time a character gains an NT, he pays 1 xp. Each time he surrenders a neutral trait, he pays 1 xp. Both positive and negative aspects are innately related; if you remove the bad, so too goes the good.

I understand that NT’s are basically handled by quirks, and this system does risk adding unnecesary extras, but some traits just don’t seem right handled by anything else. A moral code, for instance. Or being short, or being tall. Or selling your soul for power. Or having a symbiotic bug in your spinal cord.

This could add some meat to the meta game, allow for dramatic (and unhealthy) character development in short periods, generally allow PC’s more control.

NT’s definitely do taunt what LORE is about. And yet, I feel compelled to elect them for entry into the ‘real’ book. Then again, it’s probably treaded ground. At least here, I’ll be able to hear your explanations for/against.

1. Quirks have changed slightly: each one can now be used once per session instead of any of them being available but once per scene. This encourages (I hope) expression of all of your character’s interesting properties.

I like the idea of traits not being completely good or bad. Racial traits in LORE Fantasy are Positive, but come with penalties; instead of being +2 to one thing, they’re usually +2 to two things but -1 to another. That’s probably how I’d handle selling your soul or having a symbiote. You get a benefit (maybe one that would normally be superlative!) but at an awful cost.

I don’t like traits being a perfect balance, though. Such a thing smacks of an optimal but boring strategy; something which is an advantage or a disadvantage is always more interesting than something which is a perfect tradeoff.

At the very least, you’re paying 5XP for the benefit of having this awesome aspect to your character.

Of course, I could be convinced otherwise.

1. My main contestion to that is not that NT’s are underpowered (they aren’t), or that NT’s will always be fair (they won’t), but that they’re hard to get and that they’re a cordial invitation for the GM to remind them the strengths of a general-build character, painfully.

Firstly, NT’s are fairly rare. I could probably think of ten of them if I sat down for a day or two. That’s because the positive and negative aspects come form the exact same place. Having DID, for instance, could mean that you have a badass alter ego, but one that takes over in some of the worst situations. If you got rid of the alter ego, you’d lose both the good and the bad.

Thusly, NT’s are very, very particular. You can’t bundle Extra Perceptive with Not so Fit, for instance, because those are two different traits that come from different areas of a character. You might be able to bundle Not so fast with Extra Healthy, on the other hand, but only if a mad doctor takes you to his lab.

Players have to ‘earn’ the right to gain an NT, by having an experience which leads to it. Thusly, an NT will rarely be useful the moment you gain access to it. The rest of the party has to shift in order to accommodate the change, which will likely take a session or two.

And, since NT’s are essentially embodiments of specialization, players will be that much more vulnerable on their own. Though a bit of a cheap trick, it’d be downright RUDE to just let the PC’s win unmolested.

Assuming that the character survives the GM’s assault on his life, he now has the one-time opportunity to pay to get rid of his trait. Then he’s left 2 xp behind the rest of the party (and probably short some health and/or items).

NT’s are guaranteed to be OP large portions of the time. But, they come with enough limitations and flaws that they are better described as a high risk investment.

2. Oh, and my idea of balancing NT’s was originally to have the penalty be about twice the benefit. For instance, the Moral Code (I can’t be bothered to find out what it was ‘actually’ called), offered a +2 to relevant rolls (like risking one’s life) and a -4 to relevant rolls (like lethal combat).

If your concern is primarily that of balance, then it’s all about that ratio.

2. Oh, and, I doubt that my need to reduce the human condition to digits will be slated so easily. I originally thought of it when wondering how to render battalions and regiments fighting. Since large portions of soldiers retreated (and rarely with their officer’s permission), it’d be silly not to have something that showed their mental health.

I want a character’s spirit to be something that is slowly built up, then suddenly, recklessly, sloppily, spent during fights that often leave civilian PC’s in a puddles of piss.

1. I had a bit of an epiphany in my revisions that some may not agree with. Narratively and mechanically speaking, it is exactly the same for a character to be knocked out in a fight or to flee from fear. In either case, they lose their ability to influence the battle (or the interrogation, or the beauty pageant).

In one case, a soldier gets the “War Wound” affliction; in another, the soldier gets “Shell Shocked.” Both have the same mechanical and narrative effect: the character is less effective in the future for a time, and the character can no longer exert his goals on the scene.

This works well with the LORE approach of letting players declare what sort of interesting effects events have on their characters.

3. tenk51 says:

Cool stuff.

Any idea when this might launch? I was planning on running a lore game early next year, but might wait if the release is soon enough.

1. A lot of it depends on what other projects I have going on. RPGs don’t tend to be particularly profitable, so work may be slow since I can’t afford to prioritize this.