16 September 2026
Converting AT&T Troff Documents to Markdown: Classical Unix Typesetting
Converting AT&T Troff Documents to Markdown: Classical Unix Typesetting
In 1973, Joe Ossanna at AT&T Bell Laboratories created troff ("typesetter roff") to drive a Graphic Systems CAT phototypesetter connected to a PDP-11 Unix computer. Later enhanced by Brian Kernighan into device-independent troff (ditroff) in 1979, the system became the bedrock of computer science documentation.
From classical Bell Labs Technical Memoranda to the original manuscripts of Brian Kernighan and Dennis Ritchie's The C Programming Language, troff documents (.tr, .troff, .t) contain decades of foundational computing research.
1. Classical Troff Requests vs Modern Markdown
Troff processes text using a stream of imperative dot requests and inline escapes:
- Three-Part Titles (
.tl): Formats left, center, and right header/footer content:.tl 'Draft'The C Language'1978'. - Vertical and Horizontal Spacing (
.sp,.br,.bp): Controls baseline advances, paragraph breaks, and page boundaries. - Centering and Indents (
.ce,.in,.ti): Sets running margin indents and centered display blocks. - Preformatted Verbatim (
.nf/.fi): Disables line filling to preserve source code listings and ASCII diagrams. - String Registers (
.ds/\*(name): Defines reusable textual macros and variable expansions. - Classical Macro Packages (
ms,me,mm): Provides high-level abstractions like.TL(title),.AU(author),.NH(numbered heading),.PP(paragraph), and.QP(quoted block).
2. Transforming Troff Primitives into Clean GFM
convrtr parses troff requests and string registers directly in the browser:
- Heading Synthesis: Maps
.TLto# Document Title,.NH 1to## Primary Section, and.NH 2to### Subsection. - Typography Escapes: Resolves inline character escapes (
\fBbold,\fIitalic,\f(CWmonospace,\(emem-dash) into clean GitHub Flavored Markdown. - Blockquotes and Code Blocks: Maps
.QPto Markdown blockquotes (>) and.nf/.fiblocks to fenced code blocks. - Macro Stripping: Cleanly ignores raw typesetting driver requests while preserving content flow.
3. Fast, Private In-Browser Document Processing
Technical reports, internal research papers, and archived Unix manuscripts should remain private. convrtr processes AT&T troff files 100% client-side in your browser with zero network requests.
Related reading
Converting Emacs Org Mode to Markdown: Outlines, Tables, and Checklists
Explore the syntax and semantics of Emacs Org Mode (.org). Learn how asterisk headings, TODO states, priority tags, Org Calc tables, and code blocks translate to GitHub Flavored Markdown.
Converting Evernote ENEX Notebooks to Markdown: Free Your Notes from Proprietary XML
Learn how Evernote XML Export (.enex) files structure notes, timestamps, tags, and ENML layout markup, and how to convert them into clean GitHub Flavored Markdown with YAML frontmatter.
Converting OPML Outlines and Subscriptions to Markdown: Tables and Hierarchies
Dissect the Outline Processor Markup Language (.opml) architecture. Learn how RSS subscription directories, podcast feeds, and hierarchical task outlines are converted into clean GitHub Flavored Markdown.
Converting FictionBook 2.0 (FB2) E-Books to Markdown: XML Structure and Semantics
Explore the FictionBook 2.0 (.fb2) architecture. Learn how semantic XML e-book structures, epigraphs, poems, footnotes, and metadata are converted into clean GitHub Flavored Markdown.
Converting Wolfram Mathematica Notebooks (.nb) to Markdown: Hierarchical Expression Tree Extraction
Learn how Wolfram Mathematica (.nb) computational notebooks store hierarchical expression trees and 2D box formulas, and how convrtr translates them to clean GitHub Flavored Markdown.
Converting LyX Documents to Markdown: Preserving Academic Math and Outlines
Learn how LyX WYSIWYM documents are structured. Explore how layout trees, mathematical formula insets, and tabular matrices convert into GitHub Flavored Markdown.
Converting GNU Texinfo to Markdown: Modernizing Free Software Manuals
Discover GNU Texinfo, the documentation language behind GCC and Emacs. Learn how single-source @-directives convert cleanly into GitHub Flavored Markdown.
Converting Unix Man Pages to Markdown: Modernizing Terminal Documentation
Transform vintage and modern Unix roff and BSD mdoc manual pages into clean GitHub Flavored Markdown. Learn how macro packages convert to web-ready documentation.