PPTools/Ppgen/Tutorial/Paragraph Formatting
The ppgen generator uses a presentational markup. It is designed to let the post-processor decide what things should look like. Contrast to a different approach, semantic markup, that tells what something “is” and leaves how it is displayed to the coding of the generator.
The presentational markup of ppgen allows the post-processor to match the style of the book more closely. One place where there is a lot of variety is in the way paragraphs are formatted. Indented? Blocks? Space bettwen paragraphs, or not? Drop cap letters? Illustrated drop caps? Combinations? The post-processor can ignore all the options and just use the defaults. That will produce block-style paragraphs with a 1 em space between paragraphs. That choice results in this presentation:
Source Code
.sp 4 .h2 id=ch17 <s>CHAPTER XVII</s>||FRIENDS IN DESOLATION .sp 2 She turned her face that way and stood for a moment with the faint breeze blowing her hair. Then she came running up the beach to the caves. In the men's cave she stood glancing rapidly about her like a person in a burning house seeking what he may save. She picked up the tinder box and the box of matches and put them in her pocket. Then she began to remove everything from the cave. Making a sack of one of the blankets, she filled it with as much as she could drag along and brought it to the break in the cliffs where she dumped the contents. It took her three journeys. Then, having collected everything in a big pile, she sat down for a moment to rest. The things would be safe here till she could fetch them to her new home, and the weather would not hurt them, except, maybe, the biscuits. The thought of the biscuits troubled her, and the picture of them lying exposed in one of the torrential rains. Then she caught sight of a cleft in the basalt. It was dry and big enough to contain the bags and she placed them there having taken out some of their contents.
The spacing between block paragraphs can be altered. The default is 1em between paragraphs. This is equivalent to the dot command: ".nr psb 1.0em"
This can be changed by the user. Use ".nr psb .5em" to change to a 0.5em vertical gap between paragraphs:
Source Code
.nr psb .5em .sp 4 .h2 id=ch17 <s>CHAPTER XVII</s>||FRIENDS IN DESOLATION .sp 2 She turned her face that way and stood for a moment with the faint breeze blowing her hair. Then she came running up the beach to the caves. In the men's cave she stood glancing rapidly about her like a person in a burning house seeking what he may save. She picked up the tinder box and the box of matches and put them in her pocket. Then she began to remove everything from the cave. Making a sack of one of the blankets, she filled it with as much as she could drag along and brought it to the break in the cliffs where she dumped the contents. It took her three journeys. Then, having collected everything in a big pile, she sat down for a moment to rest. The things would be safe here till she could fetch them to her new home, and the weather would not hurt them, except, maybe, the biscuits. The thought of the biscuits troubled her, and the picture of them lying exposed in one of the torrential rains. Then she caught sight of a cleft in the basalt. It was dry and big enough to contain the bags and she placed them there having taken out some of their contents.
Some post-processors prefer indented paragraphs with less space (or no space at all) between paragraphs. Enable this behavior with the .pi dot command. Here is the start of the chapter with the .pi paragraph indent command in effect:
Note: This example shows the default indentation of 1em. Starting with ppgen 3.47c you can specify a different amount of indentation by using the .nr command to change the "pti" (Paragraph Text Indentation) register. Example:
The default is equivalent to saying: .nr pti 1em To get a 2em indentation you would use: .nr pti 2em
Source Code
.pi .sp 4 .h2 id=ch17 <s>CHAPTER XVII</s>||FRIENDS IN DESOLATION .sp 2 She turned her face that way and stood for a moment with the faint breeze blowing her hair. Then she came running up the beach to the caves. In the men's cave she stood glancing rapidly about her like a person in a burning house seeking what he may save. She picked up the tinder box and the box of matches and put them in her pocket. Then she began to remove everything from the cave. Making a sack of one of the blankets, she filled it with as much as she could drag along and brought it to the break in the cliffs where she dumped the contents. It took her three journeys. Then, having collected everything in a big pile, she sat down for a moment to rest. The things would be safe here till she could fetch them to her new home, and the weather would not hurt them, except, maybe, the biscuits. The thought of the biscuits troubled her, and the picture of them lying exposed in one of the torrential rains. Then she caught sight of a cleft in the basalt. It was dry and big enough to contain the bags and she placed them there having taken out some of their contents.
Since ppgen is a presentational markup, it allows a post-processor to control the spacing even if paragraphs are indented. To add .5em vertical space between indented paragraphs, specify it by setting the psi register to .5em to get this result:
Source Code
.pi .nr psi .5em .sp 4 .h2 id=ch17 <s>CHAPTER XVII</s>||FRIENDS IN DESOLATION .sp 2 She turned her face that way and stood for a moment with the faint breeze blowing her hair. Then she came running up the beach to the caves. In the men's cave she stood glancing rapidly about her like a person in a burning house seeking what he may save. She picked up the tinder box and the box of matches and put them in her pocket. Then she began to remove everything from the cave. Making a sack of one of the blankets, she filled it with as much as she could drag along and brought it to the break in the cliffs where she dumped the contents. It took her three journeys. Then, having collected everything in a big pile, she sat down for a moment to rest. The things would be safe here till she could fetch them to her new home, and the weather would not hurt them, except, maybe, the biscuits. The thought of the biscuits troubled her, and the picture of them lying exposed in one of the torrential rains. Then she caught sight of a cleft in the basalt. It was dry and big enough to contain the bags and she placed them there having taken out some of their contents.
In some books, the first line of a paragraph after a heading is not indented. To achieve this effect, use a ".ti 0" at the start of any paragraph that you don't want indented. This is the result:
Source Code
.pi .sp 4 .h2 id=ch17 <s>CHAPTER XVII</s>||FRIENDS IN DESOLATION .sp 2 .ti 0 She turned her face that way and stood for a moment with the faint breeze blowing her hair. Then she came running up the beach to the caves. In the men's cave she stood glancing rapidly about her like a person in a burning house seeking what he may save. She picked up the tinder box and the box of matches and put them in her pocket. Then she began to remove everything from the cave. Making a sack of one of the blankets, she filled it with as much as she could drag along and brought it to the break in the cliffs where she dumped the contents. It took her three journeys. Then, having collected everything in a big pile, she sat down for a moment to rest. The things would be safe here till she could fetch them to her new home, and the weather would not hurt them, except, maybe, the biscuits. The thought of the biscuits troubled her, and the picture of them lying exposed in one of the torrential rains. Then she caught sight of a cleft in the basalt. It was dry and big enough to contain the bags and she placed them there having taken out some of their contents.
Still other books use small caps at the start of the first paragraph after a heading. Simply mark the paragraph's first word (or words, as appropriate) with the usual inline markup. The result looks like this:
Source Code
.pi .sp 4 .h2 id=ch17 <s>CHAPTER XVII</s>||FRIENDS IN DESOLATION .sp 2 <sc>She</sc> turned her face that way and stood for a moment with the faint breeze blowing her hair. Then she came running up the beach to the caves. In the men's cave she stood glancing rapidly about her like a person in a burning house seeking what he may save. She picked up the tinder box and the box of matches and put them in her pocket. Then she began to remove everything from the cave. Making a sack of one of the blankets, she filled it with as much as she could drag along and brought it to the break in the cliffs where she dumped the contents. It took her three journeys. Then, having collected everything in a big pile, she sat down for a moment to rest. The things would be safe here till she could fetch them to her new home, and the weather would not hurt them, except, maybe, the biscuits. The thought of the biscuits troubled her, and the picture of them lying exposed in one of the torrential rains. Then she caught sight of a cleft in the basalt. It was dry and big enough to contain the bags and she placed them there having taken out some of their contents.
Since ppgen is a presentational markup, the PPer has still more choices. If a large drop cap starts the paragraph, put a ".dc" directive before the first line of the paragraph. See the ppgen manual for details. The result looks like this:
Source Code
.pi .sp 4 .h2 id=ch17 <s>CHAPTER XVII</s>||FRIENDS IN DESOLATION .sp 2 .dc 0.4 She turned her face that way and stood for a moment with the faint breeze blowing her hair. Then she came running up the beach to the caves. In the men's cave she stood glancing rapidly about her like a person in a burning house seeking what he may save. She picked up the tinder box and the box of matches and put them in her pocket. Then she began to remove everything from the cave. Making a sack of one of the blankets, she filled it with as much as she could drag along and brought it to the break in the cliffs where she dumped the contents. It took her three journeys. Then, having collected everything in a big pile, she sat down for a moment to rest. The things would be safe here till she could fetch them to her new home, and the weather would not hurt them, except, maybe, the biscuits. The thought of the biscuits troubled her, and the picture of them lying exposed in one of the torrential rains. Then she caught sight of a cleft in the basalt. It was dry and big enough to contain the bags and she placed them there having taken out some of their contents.
Finally, illustrated drop caps are sometimes used. With only a sightly more complex markup on the line before the first line of the paragraph, the results are like this:
Source Code
.pi .sp 4 .h2 id=ch17 <s>CHAPTER XVII</s>||FRIENDS IN DESOLATION .sp 2 .di drop_s.jpg 59 70 1.1 She turned her face that way and stood for a moment with the faint breeze blowing her hair. Then she came running up the beach to the caves. In the men's cave she stood glancing rapidly about her like a person in a burning house seeking what he may save. She picked up the tinder box and the box of matches and put them in her pocket. Then she began to remove everything from the cave. Making a sack of one of the blankets, she filled it with as much as she could drag along and brought it to the break in the cliffs where she dumped the contents. It took her three journeys. Then, having collected everything in a big pile, she sat down for a moment to rest. The things would be safe here till she could fetch them to her new home, and the weather would not hurt them, except, maybe, the biscuits. The thought of the biscuits troubled her, and the picture of them lying exposed in one of the torrential rains. Then she caught sight of a cleft in the basalt. It was dry and big enough to contain the bags and she placed them there having taken out some of their contents.