image

Preface

1      From Typewriters to Word Processors

A Workspace

Tools for Editing

Document Formatting

Printing

Other UNIX Text-Processing Tools

2      UNIX Fundamentals

The UNIX Shell

Output Redirection

Special Characters

Environment Variables

Pipes and Filters

Shell Scripts

3      Learning vi

Session 1: Basic Commands

Opening a File

Moving the Cursor

Simple Edits

Session 2: Moving around in a Hurry

Movement by Screens

Movement by Text Blocks

Movement by Searches

Movement by Line Numbers

Session 3: Beyond the Basics

Command-Line Options

Customizing vi

Edits and Movement

More Ways to Insert Text

Using Buffers

Marking Your Place

Other Advanced Edits

4      nroff and troff

What the Formatter Does

Using nroff

Using troff

The Markup Language

Turning Filling On and Off

Controlling Justification

Hyphenation

Page Layout

Page Transitions

Changing Fonts

A First Look at Macros

5      The ms Macros

Formatting a Text File with ms

Page Layout

Paragraphs

Changing Font and Point Size

Displays

Headings

Cover Sheet Macros

Miscellaneous Features

Page Headers and Footers

Problems on the First Page

Extensions to ms

6      The mm Macros

Formatting a Text File

Page Layout

Justification

Word Hyphenation

Displays

Changing Font and Point Size

More About Displays

Forcing a Page Break

Formatting Lists

Headings

Table of Contents

Footnotes and References

Extensions to mm

7      Advanced Editing

The ex Editor

Using ex Commands in vi

Write Locally, Edit Globally

Pattern Matching

Writing and Quitting Files

Reading In a File

Executing UNIX Commands

Editing Multiple Files

Word Abbreviation

Saving Commands with map

8      Formatting with tbl

Using tbl

Specifying Tables

A Simple Table Example

Laying Out a Table

Describing Column Formats

Changing the Format within a Table

Putting Text Blocks in a Column

Breaking Up Long Tables

Putting Titles on Tables

A tbl Checklist

Some Complex Tables

9      Typesetting Equations with eqn

A Simple eqn Example

Using eqn

Specifying Equations

Spaces in Equations

Using Braces for Grouping

Special Character Names

Special Symbols

Other Positional Notation

Diacritical Marks

Defining Terms

Quoted Text

Fine-Tuning the Document

Keywords and Precedence

Problem Checklist

10    Drawing Pictures

The pic Preprocessor

From Describing to Programming Drawings

pic Enhancements

11    A Miscellany of UNIX Commands

Managing Your Files

Viewing the Contents of a File

Searching for Information in a File

Proofing Documents

Comparing Versions of the Same Document

Manipulating Data

Cleaning Up and Backing Up

Compressing Files

Communications

Scripts of UNIX Sessions

12    Let the Computer Do the Dirty Work

Shell Programming

ex Scripts

Stream Editing (sed)

A Proofreading Tool You Can Build

13    The awk Programming Language

Invoking awk

Records and Fields

Testing Fields

Passing Parameters from a Shell Script

Changing the Field Separator

System Variables

Looping

awk Applications

Testing Programs

14    Writing nroff and troff Macros

Comments

Defining Macros

Macro Names

Macro Arguments

Nested Macro Definitions

Conditional Execution

Interrupted Lines

Number Registers

Defining Strings

Diversions

Environment Switching

Redefining Control and Escape Characters

Debugging Your Macros

Error Handling

Macro Style

15    Figures and Special Effects

Formatter Escape Sequences

Local Vertical Motions

Local Horizontal Motions

Absolute Motions

Line Drawing

Talking Directly to the Printer

Marking a Vertical Position

Overstriking Words or Characters

Tabs, Leaders, and Fields

Constant Spacing

Pseudo-Fonts

Character Output Translations

Output Line Numbering

Change Bars

Form Letters

Reading in Other Files or Program Output

16    What’s in a Macro Package?

Just What Is a Macro Package, Revisited

Building a Consistent Framework

Page Transitions

Page Transitions in ms

Some Extensions to the Basic Package

Other Exercises in Page Transition

17    An Extended ms Macro Package

Creating a Custom Macro Package

Structured Technical Documents

Figure and Table Headings

Lists, Lists, and More Lists

Source Code and Other Examples

Notes, Cautions, and Warnings

Table of Contents, Index. and Other End Lists

18    Putting It All Together

Saving an External Table of Contents

Index Processing

Let make Remember the Details

Where to Go from Here

A     Editor Command Summary

B     Formatter Command Summary

C     Shell Command Summary

D     Format of troff Width Tables

E     Comparing mm and ms

F     The format Macros

G     Selected Readings

Index

Get UNIX° TEXT PROCESSING now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.