It's worth noting that Unix was built for troff.
Typesetting patents
if I recall correctly.
This is a stretch. Unix was really built because Ken and Dennis
had a good idea. The purchase of a PDP-11 for it was in part
justified by the goal of making a word-processing system. The
first in-house "sale" of Unix was indeed to the patent department
for typing patents--the selling point was that roff could be
made (by an overnight modification) to print line numbers as
USPTO required, whereas that was not a feature of a commercial
competitor. The timeline is really roff--Unix--patent--nroff--troff.
Though roff antedated Unix, it did not motivate Unix.
Is this The UNIX Time-Sharing System, or related to
it? The same
claim appears in the first paragraph:
https://www.bell-labs.com/usr/dmr/www/cacm.html
This draft clearly dates from 1971. Pieces of it were worked
into subsequent versions of the manual as well as published
descriptions of Unix, including the SIGOPS/CACM paper.
Doug