Questions tagged [groff]

The GNU enhanced re-implementation of Joe Osanna's 1975 `roff` text formatting mark-up language, macros, and its related programs (also known as `troff` and `nroff`). Used at the command line to format manual pages (`man` pages) on Unix-like operating systems.

Filter by
Sorted by
Tagged with
3
votes
1answer
28 views

`man --html` and `man --gxditview` exit with errors?

Problem On my machine (Ubuntu 18.04), I am able to view man pages normally in the console. However, I cannot seem to get man --html (man -H) or man --gxditview (man -X) to work. Might anyone have any ...
2
votes
1answer
26 views

groff ms column break macro

I have seen here how to perform a page break: groff ms page break macro I have been trying to find the equivalent but for columns in a .2C two columns formatted document. Sometimes the header of a ...
0
votes
0answers
16 views

ANSI characters not displayed properly in terminal(konsole)

While using manual/git/possibly other applications my output is full of garbage characters(which looks like ansi characters). Example output: [1;36mDESCRIPTION[0m [1;36mman[0m is the system'...
2
votes
0answers
32 views

How to search for end-of-line hyphenated words in less(1)

Does less (or any other lightweight pager I could use as $PAGER) has such a feature? For example, if I type man bash and then enter /incorporates it doesn't find the word, despite it being right ...
0
votes
0answers
16 views

Missing 'CREC' font in groff

The following groff -Kutf8 -Tdvi -mec -mom letter.mom > letter.dvi works perfectly when the letter.mom file contains .PRINTSTYLE TYPESET. However, when .PRINTSTYLE TYPEWRITE is used I get troff: ...
0
votes
0answers
24 views

groff registers not defined during macro

Context: Let's say I am trying to write a macro in groff in order to draw a rectangle given some arguments (like width and height for example). For this I need to perform some simple arithmetic, that ...
0
votes
1answer
234 views

How to install gropdf?

I am a new user of groff and want to generate pdf files with it. I know that the basic syntax is as follows: groff -ms inputcode.ms -Tpdf > outputfile.pdf But, when I try it, I get the following ...
4
votes
1answer
270 views

Can't use different font families in groff -ms

I'm using groff with ms macros and outputting it to PostScript. On Linux Void. I want to have a different font and also output Unicode characters. I have converted my font as written in this question. ...
2
votes
2answers
78 views

groff mom doesn't give a pdf output

I am currently trying to learn the mom macro package from groff. The problem is that whenever I compile the file to pdf: groff -mom -Tpdf file.mom > file.pdf The output, in Zathura, is an empty ...
0
votes
0answers
49 views

How can I change the color scheme/theme of groff-mom?

I know how to change individual macro's colors, but is there a way to globally change all the colors to a different color scheme/theme? I am using groff-mom. Example: It currently looks like this I ...
2
votes
1answer
143 views

Displaying orbital node characters in groff ms macros

I'm trying to display the characters for ascending and descending orbital nodes (☊ and ☋) in groff, however when I export the document to postscript they simply don't show.
0
votes
2answers
159 views

Groff - which fonts are loaded by default

Is there a standard set of fonts that is loaded by groff by default? And is that order always the same for all environments? Is it documented somewherr (I could not find it)? I can make an educated ...
3
votes
2answers
99 views

groff arithmetic

Is it possible to perform arithmetic using groff? Say I want to calculate what page is the current one, and I currently am on page 2. I can get the next page's number by using: .PP Next page is ...
2
votes
1answer
256 views

groff ms page break macro

I am new to groff (ms macros) and currently making a table of content parser that builds automatically a table of content by using a double pass through the groff command. However I would actually ...
1
vote
1answer
119 views

Letters using groff_ms

In the description of the manpage of groff_ms, it is written: The ms macros are suitable for reports, letters, books, and technical documentation. However, I don't see any command to right align ...
1
vote
1answer
39 views

Does Groff have an updated formatting algorithm (Knuth-Plass/other)?

In the groff mission statement it says that Groff will be moving to an improved formatting algorithm. Considering that the mission statement was written in 2014; I was wondering where this was at ...
0
votes
1answer
60 views

Theorems in groff

Is there a way in groff -ms to automatically number environments? As an example, here are two theorems I'd like to number 1.1 and 2.1. .TL Lorem ipsum .NH Introduction \# First thm .PP .B Theorem . ...
0
votes
0answers
47 views

How can I get rid of groff / nroff / troff markers?

I can't find useful info how to easily delete all groff (nroff) related formatting markers. unroff doesn't seem to do the job. On Mac OS I can't see it anyway.
3
votes
0answers
113 views

How to write romanian special characters with groff?

I've got myself into experimenting with groff and from the start I found out the romanian special characters I type in vim are all fine (I ran setxkbmap ro), but get messed up in the pdf export. ...
2
votes
1answer
252 views

groff “me” macro, but use sans serif font for headings etc

I'm learning troff for typesetting documents. I found the me macros nice and beautiful out of the box and want to avoid mom. me defaults everything to serif fonts which is ugly for larger text like ...
1
vote
1answer
213 views

Search within man pages of POSIX Programmer's Manual

I would like to search for POSIX functions matching the restrict keyword and my idea (open to other ideas) is to search the SYNOPSIS sections of the POSIX Programmer's Manual for \<restrict\> ...
2
votes
0answers
161 views

Groff long umlaut

I'm Hungarian and I want to use groff to write good-loking pdf files, the problem is even though I used: groff -k -ms test.ms -T pdf > test.pdf eventhough -k took care of the? é,á,ü,ö characters ...
7
votes
2answers
450 views

How to correctly display Polish diacritic symbols in groff?

I'm playing around with groff and I wanted to generate a pdf from the following test.ms .TL Tytuł .AU Imię Nazwisko .NH Wstęp .PP Pierwszy paragraf. Jakieś informacje, żeby były polskie znaki. .PP ...
0
votes
1answer
432 views

Embed ascii diagram in groff?

I have groff file to generate a pdf in the format: .TL Article title .AU Author name .AI Publication title .SH .LP First paragraph .PP More paragraphs I'm then running groff -ms a.ms -T pdf > a....
3
votes
3answers
128 views

How to access man pages as structured content

I'm building a resource that references man pages, and I'm wondering if anyone knows of a way to access man pages as structured data? My current approach is to do a lot if REGEXing, but this is ...
1
vote
1answer
217 views

exporting man pages to postscript

I found that I can save man page into ps format: man -t man > file.ps or to pdf: man -t man | ps2pdf - file.pdf Apart from the man page itself, the export includes man version, page numbers and ...
4
votes
1answer
790 views

What is the difference between the mdoc macro set for troff and the plain man macro set for making new manpages

I am trying to create man pages for a side project and I have never used troff before, and I am trying to figure out what exactly is the difference between the man macro set and the mdoc macro sets ...
0
votes
1answer
77 views

man/troff: Convert ^ to ˆ

This is a follow-up on man -t converts - to − This time the problem is with ^ which troff thinks should be changed into ˆ. Is there a general way of telling man -t not to mess with the input? If ...
5
votes
1answer
2k views

How do I convert a troff manpage with UTF-8 characters (czech to be precise) to PDF

I have a troff document (manpage) with UTF-8 characters and I am trying to convert it to a PDF. However, when using the -Tpdf option, the PDF generated does not show the correct characters. This is ...
3
votes
2answers
132 views

Gnu nroff - output a line with dot at beginning of line

i tried to write a self-replicating program ("quine") in raw (no macros) GNU nroff. Admittedly, this is pointless and eccentric, but it doesn't seem to have been done before. I have failed to do so. ...
1
vote
1answer
95 views

man -t converts - to −

man -t ls converts - to −. Is there a way I can tell man -t to not do that? I prefer having -, as the - is often part of examples where − would be wrong (e.g. options).
2
votes
3answers
156 views

How to add a dot to a raw man file at the end of a line?

I've got a fragment of a manual file which looks like this: .TP .I krb5_key_file Location of the key for this client's principal. Note that the key file must be owned by root and mode 0400. The ...
2
votes
1answer
84 views

Viewing mm files

The ksh source code at https://github.com/att/ast/tree/master/src/cmd/ksh93 contains files ending with the .mm suffix. E.g., https://github.com/att/ast/blob/master/src/cmd/ksh93/PROMO.mm At first ...
1
vote
0answers
109 views

Troff Load User Font

In Heirloom Troff, is it possible to just load an OTF font (or another supported format) via a URI? I’m trying, .fp 10 R /Users/jacob/Restore/Fonts/Roboto/Roboto-Medium.ttf ttf .ft 10 .ft R Test I’m ...
3
votes
2answers
1k views

How do I choose a groff macro package?

I want to try a classic groff macro package for structured technical documents as a replacement for the arguably more complex LaTeX and DocBook. I understand ms was the earliest macro package, and mm ...
6
votes
1answer
779 views

How do I generate manpages using escape codes for bold, etc.?

While inspecting the source code of less, I noticed that the included manpage (less.man) used terminal escape codes for showing bold text: ^[[1mNAME^[[0m less - opposite of more ^[[1mSYNOPSIS^...
1
vote
2answers
259 views

How to control content of header in groff man macros

I'm using the groff man macros to produce general purpose documentation (not actually man pages) because they are easy to learn and use. I'd like control of the postscript page header as free text ...
1
vote
0answers
192 views

Man page to PDF with groff: no space after headings

I have written a 250+ page manual page whose printed appearance I'm trying to polish. It uses the old-style man macros: the page begins with .TH, and uses things like .SH, .SS and .TP for sectioning. ...
2
votes
1answer
1k views

How do I display a manpage with groff in/on msysgit?

I've been unable to correctly set up a MANPATH environment variable in msysgit (1.9.0; 20140217) on Windows 7 (which is not my main concern here). Every time I execute the man command, I recieve the ...
2
votes
1answer
234 views

Properly inserting code samples in man pages

I'm trying to write a man page for a software, and would like to include some code snippets. I'm currently using the .RS and .RE macros as part of a custom-made .SAMPLE macro, but for some reason that ...
15
votes
5answers
9k views

Is troff/groff relevant anymore?

I've heard that troff/groff have largely been replaced by TeX. Is this true? The only thing that I know actually used troff nowadays is manpages. Is this also true? If not, what are some other uses?
3
votes
1answer
1k views

Man displaying groff control characters

Man is displaying groff control characters after I compiled a later version of groff. For example, when I try to view groff's man page: GROFF(1) General Commands Manual ...
7
votes
1answer
2k views

convert man output to ebook format

I can convert man output to PDF. First, man -t grep >grep.ps (grep is just an example; I am not looking for mobile version of grep man page). Then Adobe Distiller converts PostScript to PDF. ...
2
votes
3answers
2k views

Can groff create a ps file with interpreted ANSI escape characters?

This question is inspired by this one on SU. How can I print bold or color using lp and ANSI escape sequences? I know how to display, for example, bold text in the terminal: $ echo -e '\033[01;...