|
|
# Groff examples repository |
|
|
|
Last-Updated: 2024-09-05 |
|
|
|
|
|
|
|
This is a compilation of groff examples shared on the mailing list |
|
|
|
or detailed in the different man pages. This is aimed to be a |
|
|
|
collection of hacks and full documents edited with Groff. |
|
|
|
|
|
|
|
If you want to learn to use groff, see the following book (from the |
|
|
|
UTP revival project) or the official documentation linked lower |
|
|
|
down the page. |
|
|
|
|
|
|
 |
Unix Text Processing (http://chuzzlewit.co.uk) |
application/pdf |
|
 |
UTP revival project (https://github.com) |
|
|
|
|
|
|
|
## Examples |
|
|
|
|
|
|
|
### Page modifications |
|
|
|
|
|
|
 |
Drawing crop marks |
text/gemini |
|
 |
Page borders for mom macros |
text/gemini |
|
 |
Presentations with Groff and AcroRead |
text/gemini |
|
 |
Typesetting two languages on facing pages |
text/gemini |
|
 |
Dynamic paper length |
text/gemini |
|
|
|
|
|
|
### Text operations |
|
|
|
|
|
|
 |
Text in the colour of your choosing |
text/gemini |
|
 |
Showing hyphenation points |
text/gemini |
|
 |
Finding the position of a character in a string |
text/gemini |
|
 |
Reflowing the text for optimum configuration |
text/gemini |
|
 |
Upside down or mirrored text |
text/gemini |
|
 |
Wrapping multiples lines in a table of contents |
text/gemini |
|
 |
Typesetting arbitrary fractions |
text/gemini |
|
 |
Getting current time inside groff |
text/gemini |
|
 |
Underlining for everyone |
text/gemini |
|
|
|
|
|
|
### Drawing diagrams, graphics, etc. |
|
|
|
|
|
|
 |
A program for typesetting data formats |
text/gemini |
|
 |
A one page dungeon layout |
text/gemini |
|
 |
Business graphs with busgrap |
text/gemini |
|
 |
Extending pic with PostScript |
text/gemini |
|
 |
Making a Venn diagram with pic and PostScript |
text/gemini |
|
|
|
|
|
|
### Table operations |
|
|
|
|
|
|
 |
Gray background on alternate rows |
text/gemini |
|
|
|
|
|
|
### Bibliography tools |
|
|
|
|
|
|
 |
Getting APA-style references with refer |
text/gemini |
|
 |
Searching a bibliography database |
text/gemini |
|
|
|
|
|
|
### Advanced operations |
|
|
|
|
|
|
 |
Executing PostScript code in a groff document |
text/gemini |
|
 |
Macro sets to typeset whole documents |
text/gemini |
|
 |
Recursion and iteration |
text/gemini |
|
 |
Translating V7 troff output to PostScript |
text/gemini |
|
 |
A version of fmt for troff files |
text/gemini |
|
 |
MORE.STUFF a list of programs developed by third parties |
text/gemini |
|
|
|
|
|
|
## Documents edited with groff |
|
|
|
|
|
|
 |
Presentation at EuroBSDCon 2018 by Ingo Schwarze |
text/gemini |
|
 |
The Moyal-Dirac controversy revisited |
text/gemini |
|
 |
Presentation at DECON 2019 by Robert Marks |
text/gemini |
|
|
|
|
|
|
## Official documentation |
|
|
|
|
|
|
|
You can find the official documentation in the Groff Info manual |
|
|
|
with `info groff` or at the following link: |
|
|
|
|
|
|
 |
Groff Info manual (https://www.gnu.org) |
text/html |
|
|
|
|
|
|
If you prefer man pages, the main ones − 52 of them − have been |
|
|
|
compiled in the following document, courtesy of Deri James. |
|
|
|
|
|
|
 |
Groff − The man pages book |
text/plain |
|
|
|
|
|
|
The following subset are especially interesting to any new user of |
|
|
|
groff: |
|
|
|
|
|
|
|
* groff(1) - front-end for the groff document formatting system |
|
|
|
* refer(1) - preprocess bibliographic references for groff |
|
|
|
* pic(1) - compile pictures for troff or TeX |
|
|
|
* groff(7) - a short reference for the GNU roff language |
|
|
|
* groff_tmac(5) - macro files in the roff typesetting system |
|
|
|
* groff_char(7) - groff glyph names |
|
|
|
* groff_man(7) - GNU roff macro package for formatting man pages |
|
|
|
* groff_mdoc(7) - reference for groff's mdoc implementation |
|
|
|
* groff_me(7) - "me" macro package for formatting documents with GNU roff |
|
|
|
* groff_mm(7) - memorandum macros for GNU roff |
|
|
|
* groff_mom(7) - groff "mom" macros; "mom" is a "roff" language, part of "groff" |
|
|
|
* groff_ms(7) - GNU roff manuscript macro package for formatting documents |
|
|
|
* groff_www(7) - groff macros for authoring web pages |
|
|
|
|
|
|
|
For advanced topics, if you use a UNIX-like operating system, chanc |
|
|
|
are your groff install came with documentation in one of the follow |
|
|
|
directories: |
|
|
|
|
|
|
|
* /usr/local/share/doc/groff/ or |
|
|
|
* /usr/share/doc/groff/ or |
|
|
|
* /usr/share/doc/groff-base/. |
|
|
|
|
|
|
|
## Official project pages |
|
|
|
|
|
|
|
Linked below, you can find the project page of groff, of mandoc and |
|
|
|
of mdoc. |
|
|
|
|
|
|
 |
GNU troff (groff) — a GNU project (https://www.gnu.org) |
|
|
 |
mandoc tools used for BSD manual pages (https://mandoc.bsd.lv) |
|
|
 |
Documentation for the mdoc language (http://mandoc.bsd.lv) |
|
|
|
|
|
|
|
## Contact |
|
|
|
|
|
|
|
If you think a macro should be in this list, if you found a mistake |
|
|
|
or care to give some feedback, send me an email: thomas AT dupond |
|
|
|
DOT eu. |
|
|
|
|
|
|
 |
Go back |
|
|
|
___________________________________________________________________ |
|
|
|
Gophered by Gophernicus/3.1.1 on OpenBSD/amd64 7.6 |
|