TROFF(1plan9)

πŸ’– TROFF β€” bestie edition πŸ’–

okay so you found the Plan 9 manual, section 1, and the star of the show is troff πŸŽ€ (with its little sibling nroff tagging along). sit down, grab a boba, we're learning typesetting.


✨ NAME ✨

troff, nroff β€” text formatting and typesetting πŸ¦‹


✨ SYNOPSIS ✨

troff [ option ...  ] [ file ...  ]

nroff [ option ...  ] [ file ...  ]

✨ DESCRIPTION ✨

So troff formats text in the named files for printing on a typesetter. nroff does literally the same thing, except its output is suitable for typewriter-like devices. Same energy, different fit πŸ’…

If you don't hand it any file argument at all? It reads standard input. And if you pass an argument that's just a single minus (-), that counts as a file name meaning standard input too. Noted πŸ“

The options are:

  • -olist β€” print pages in the comma-separated list of numbers and ranges. A range N-M means N through M; an initial -M means up to M; a final N- means from N to the end. ranges slay ✨
  • -nN β€” number the first generated page N.
  • -mname β€” process the macro file /usr/share/9base/troff/tmac/tmac.name before the input files.
  • -raN β€” set register a (a one character name, bestie) to N.
  • -i β€” read standard input after the input files are exhausted.
  • -q β€” invoke the simultaneous input-output mode of the rd request.
  • -N β€” produce output suitable for typewriter-like devices.

πŸ–¨οΈ Typesetter devices (not -N) only

these ones are ONLY for typesetter devices, meaning not when you used -N. read the room 🫢

  • -a β€” send a printable textual approximation of the results to the standard output.
  • -Tdest β€” prepare output for typesetter dest:
    • -Tutf β€” (the default.) PostScript printers with preprocessing to handle Unicode characters encoded in UTF 🌈
    • -Tpost β€” regular PostScript printers
    • -T202 β€” Mergenthaler Linotron 202
  • -Fdir β€” take font information from directory dir.

⌨️ Typewriter (-N) output only

and these ones are the opposite β€” only for typewriter (-N) output. the duality 😭

  • -sN β€” halt prior to every N pages (default N=1) to allow paper loading or changing. very much giving "brb gotta feed the printer" 🧚
  • -Tname β€” prepare output for specified terminal. Known names include utf for the normal Plan 9 UTF encoding of the Unicode Standard character set (default), 37 for the Teletype model 37, lp (line-printer) for any terminal without half-line capability, 450 for the DASI-450 (Diablo Hyterm), and think (HP ThinkJet). a whole roster πŸ‘‘
  • -e β€” produce equally-spaced words in adjusted lines, using full terminal resolution.
  • -h β€” use output tabs during horizontal spacing to speed output and reduce output character count. Tab settings are assumed to be every 8 nominal character widths.

🌸 FILES 🌸

  • /tmp/trtmp* β€” temporary file
  • /tmac/tmac.* β€” standard macro files
  • /troff/term/* β€” terminal driving tables for nroff
  • /troff/font/* β€” font width tables for troff

πŸŽ€ SOURCE πŸŽ€

/src/cmd/troff

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ and that's the whole page, bestie. no cap, we got every single flag.

okay so final vibe check: this whole thing lives in the TROFF(1plan9) corner of the Plan 9 manual, section 1, and yeah the page header and footer both just say TROFF(1plan9) at you, twice, like a lil echo πŸ’– go forth and format, you absolute icon β­πŸ“

πŸ“¦ where this page comes from