Inform 7 Home Page / Documentation
§5.8. Line breaks and paragraph breaks
Inform controls the flow of text being said so that it will read, to the player, in a natural way. There are two principles:
(a) pieces of text ending with full stop, exclamation or question marks will be followed by line breaks (or "new lines", as some computer programming languages would call them); and
(b) pieces of text produced by different rules in Inform will be separated by paragraph breaks.
The effect is that authors can forget about paragraph spacing most of the time, but the mechanism is not impossible to fool, so text substitutions are provided to override the usual principles. First, to manipulate line breaks:
say "[line break]"
This text substitution produces a line break. Example:
"There is an endless sense of[line break]falling and[line break]falling."
Line breaks are not paragraph breaks, so the result is:
with no extra vertical spacing between these lines.
say "[no line break]"
This text substitution produces no text. It's used only for a side-effect: it prevents a line break where Inform might otherwise assume one. Example:
"The chorus sing [one of]Jerusalem[or]Rule, Britannia![no line break][at random]."
Here the "[no line break]" stops Inform from thinking that the exclamation mark means a sentence ending - it's part of the name of the song "Rule, Britannia!". So we get
with no line break between the "!" and ".".
And similarly for paragraph breaks. Because Inform can be pretty trigger-happy with these, the first need is for a way to stop them:
say "[run paragraph on]"
This text substitution produces no text. It's used only for a side-effect: it prevents a paragraph break occurring after the present text is printed, in case Inform might be tempted to place one there. Example:
Before taking something, say "Very well. [run paragraph on]".
This allows the reply to, say, TAKE ENVELOPE to be
rather than
which is how texts produced by different rules would normally be shown. (It's a traditional printer's term. See Oldfield's Manual of Typography, 1892, under "When two paragraphs are required to be made into one, or, in technical language, 'to run on'.")
But sometimes we actually want paragraph breaks in unexpected places. One way is to force them outright:
say "[paragraph break]"
This text substitution produces a paragraph break. Example:
"This is not right.[paragraph break]No, something is terribly wrong."
Paragraph breaks have a little vertical spacing in them, unlike mere line breaks, so the result is:
More subtly, we can give Inform the option:
say "[conditional paragraph break]"
This text substitution either produces a paragraph break, or no text at all. It marks a place where Inform can put a paragraph break if necessary; in effect it simulates what Inform does every time a "before" or similar rule finishes. If there i text already printed, and text then follows on, a paragraph break is made. But if not, nothing is done. This is sometimes useful when producing a large amount of text which changes with the circumstances so that it is hard to predict in advance whether a paragraph break is needed or not.
Really finicky authors might possibly want to know this:
if a paragraph break is pending:
This condition is true if text has recently been said in such a way that Inform expects to add a paragraph break at the next opportunity (for instance when the present rule ends and another one says something, or when a "[conditio al paragraph break]" is made).
Finally, there are two special sorts of paragraph break for special circumstances. They are mainly used by the Standard Rules, and imitate the textual layout styles of traditional IF.
say "[command clarification break]"
This text substitution produces a line break, and then also a paragraph break if the text immediately following is a room description brought about by having gone to to a different room and looking around, in which case a line break should be dded. In traditional IF, this is used when clarifying what Inform thinks the player intended by a given command. Example:
say "(first opening [the noun])[command clarification break]";
might result in
(first opening the valise)
You rummage through the valise for tickets, but find nothing.
say "[run paragraph on with special look spacing]"
This text substitution produces no text. It's used only for a side-effect: it indicates that the current printing position does not follow a skipped line, and that further material is expected which will run on from the previous paragraph, but that if no furt er material turns up then a skipped line would be needed before the next command prompt. (It's very likely that only the Standard Rules will ever need this.)
Start of Chapter 5: Text | |
Back to §5.7. Text with random alternatives | |
Onward to §5.9. Text with type styles |