Skip to Content
UNIX° TEXT PROCESSING
book

UNIX° TEXT PROCESSING

by Dale Dougherty, Tim O'Reilly
May 1987
Intermediate to advanced
680 pages
17h 3m
English
O'Reilly Media, Inc.
Content preview from UNIX° TEXT PROCESSING

image

Writing nroff and troff Macros

The nroff and troff formatters include a powerful macro definition and substitution capability. As we suggested when macros were first discussed in Chapter 4, they are a good way to combine frequently used sequences of formatting requests into a single instruction. But after working with the ms and mm macro packages, you must know that macros are more than that.

Macros are an essential part of nroff and troff—you cannot escape them if you want to make serious use of the formatter. Precisely because macros are so essential, many users never learn to fully use them. The most obviously useful macros are already included in the existing macro packages, whose complex internal control structures make them difficult to understand and modify.

The purpose of this chapter is to introduce the fundamental nroff and troff requests that are used for creating macros. You’ll learn the basics in this chapter. Then, in later chapters we can examine how to write macros for specific purposes, without having to make continual asides to introduce a new request.

Chapter 15 describes additional requests for creating special effects (such as pictures) with your macros, and Chapters 16 through 18 discuss how to go beyond writing individual macros and how to develop or extend an entire macro package.

▪   Comments   ▪

Before we start, we’ll introduce the syntax for inserting ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally
Journey from Natural Numbers to Complex Numbers

Journey from Natural Numbers to Complex Numbers

Nita H. Shah, Vishnuprasad D. Thakkar

Publisher Resources

ISBN: 9780810462915