Online Troff/ms Macro Previewer | Live Document Editor

Home » Online Troff/ms Macro Previewer | Live Document Editor

Online Troff/ms Macro Previewer

Troff Input

Welcome, Unix Vinter! (A Simple Guide to Troff)

Long before the age of WYSIWYG editors and modern word processors, there was **`troff`**. Born in the early days of the Unix operating system, `troff` (short for "typesetter runoff") was a powerful document processing system. Instead of clicking buttons to format your text, you would embed simple commands, or "macros," directly into your document. When you ran the file through the `troff` program, it would interpret these macros to produce a beautifully formatted document, ready for a high-quality printer. The most famous and widely used set of these commands was the **`ms` macro package** (short for "manuscript macros"), which made it easy to format academic papers, letters, and technical documents.

This tool is a tribute to that powerful and elegant system. It's a modern, browser-based previewer that understands the most common `ms` macros. As you type your `troff` code into the editor on the left, this tool instantly translates it into a formatted, easy-to-read preview on the right that mimics the classic, typeset look. You don't need a vintage Unix machine or any special software—just your web browser. It's the perfect way for historians to view old documents, for students to learn about the history of computing, or for anyone to experience the simple, text-driven elegance of old-school document preparation.

How to Use This Previewer

Formatting your document is a simple, two-step process:

  1. Write Your Document with Macros: In the "Troff Input" editor on the left, write your text and add `ms` macros on their own lines. For example, to create a title, you would type `.TL` on one line, and the title text on the next.
  2. See the Live Preview: As you type, the panel on the right will instantly update to show you a formatted preview of your document. There's no "render" button—it all happens in real-time!

A Quick Macro Reference

  • `.TL` - Title:** Use this for the main title of your document.
  • `.AU` - Author:** Placed after the title to specify the author.
  • `.AI` - Author's Institution:** Placed after the author for their affiliation (like a university or company).
  • `.SH` - Section Heading:** Creates a standard, unnumbered heading for a new section.
  • `.NH` - Numbered Heading:** Creates a numbered heading that automatically increments.
  • `.PP` - Paragraph:** Starts a new, standard paragraph with a first-line indent.
  • `.IP` - Indented Paragraph:** Creates a paragraph that is indented on both the left and the first line.
  • `\fBtext\fP` - Bold:** To make text bold, wrap it with `\fB` (begin bold) and `\fP` (return to previous font). *Example:* This is `\fBbold\fP` text.
  • `\fItext\fP` - Italic:** To make text italic, wrap it with `\fI` (begin italic) and `\fP`. *Example:* This is `\fIitalic\fP` text.

 

Read Also: