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.
85 questions
2
votes
1
answer
48
views
Cannot insert the mapsto character ↦ in groff
I am trying to learn how to insert the mapsto (↦, U+21A6) character in groff.
I am trying to use this code to insert the character
\[u21A6]
But I get the following error message and nothing is ...
0
votes
2
answers
57
views
gtksourceview: syntax highlight for language groff in gedit
Sciancisco and I developed a syntax highlighter for the Groff markup language to be used with Gedit, Pluma, Xed etc. I installed it in /usr/share/gtksourceview-4/language-specs/groff.lang and it ...
6
votes
1
answer
338
views
Is groff ignoring `.nh` command?
For a man page written in POD (perlpod) I had the effect that the SYNOPSIS was left-adjusted on the text terminal, but the PostScript output (read: troff) adjusted the text to both borders.
So I tried ...
1
vote
1
answer
35
views
How do I append an option argument to the flag without spaces?
I am writing a program manual in mdoc(7). One example of my programs has this synopsis:
parsrc.sh [-lf<s>] [CSV_file]
Taken from ShellShoccar-jpn/Parsrs/parsrc.sh
For example if you run parsrc....
3
votes
1
answer
254
views
Word split between two lines is not found in man pages search
I'm on Linux Mint 21 (Ubuntu based). Just noted man pages internal search (/) does not find a word if split between two lines (the word is whole in the source of the page, displayed with a hyphen and ...
0
votes
1
answer
56
views
Change header/footer font with groff mm
I am currently testing the mm and mom macro packages and noticed that the default font family is not used for headers/footers with mm (unlike mom, which uses the selected font for all text). My test ...
4
votes
1
answer
61
views
Input encoding in groff macro files
The -K option allows me to specify my troff file's encoding, but this does not seem to extend to macro files. If a custom macro file contains non-ASCII characters in a string, the output looks like ...
0
votes
1
answer
58
views
Slight indentation with non-regular (bold/italic) font in groff
I am new to groff and noticed a slight indentation if the first word of a paragraph (or new line) is set in a non-regular font. In the following example, this happens only in the second and third ...
1
vote
1
answer
282
views
GREP error: warning: cannot select font 'i'
I am in the process of learning the usage of iscsiadm and somehow I noticed a strange behavior of grep.
Attempting to run the following grep command man iscsiadm | grep "aia" results in ...
0
votes
2
answers
85
views
Groff -ms .R macro not working; Can't format heading
groff version: 1.22.4
My style guide insists on formatting headings following way:
Level 1 UPPERCASE BOLD 12pt
Level 2 Bold italic letters 10pt
Level 3 Italic letters 10pt
According to reference for ...
0
votes
2
answers
105
views
groff -mandoc creating "ESC[1m" versus overstriking with backspace for bold text
I found that groff uses different ways to indicate bold text for the utf8 output format.
On FreeBSD 14, groff emits escape codes for a terminal (ESC, [1m):
$ printf ".Dd today\n.Sh NAME\n" | ...
1
vote
1
answer
56
views
Converting non-English manual pages to PDF/PostScript
I'm trying to convert manual pages containing either Japanese or Russian characters to the PDF/PostScript formats. I'm doing it with the following commands.
man -Tpdf /usr/share/man/ja/man1/vim.1.gz &...
1
vote
2
answers
250
views
Two Columns For Text And One For Footnotes In Groff
I'm new to groff, so excuse me if it's a silly question. I can't find an appropriate solution for have two-columned content with one-columned footnotes. I've messed with .1C and .2C macros to get the ...
0
votes
2
answers
193
views
Console doesn't render according to man manual
So why is my console on Ubuntu doesn't render according to the man manual? If I type in man man in the console I get a manual for man. And for example, it points out that italic text replace ...
1
vote
2
answers
66
views
groff: check file exists, or suppress error message from .so
In groff, is there a way to ".so" a file if but only if the file exists? I either want to do ".so file" and have it proceed without error message if the file doesn't exist, or ...
0
votes
3
answers
308
views
Linux 9 commands send ANSI/color sequences to monochrome terminal
I'm using a Wyse50 Terminal emulation on Rocky Linux 9. Man pages, help screens, etc., are unusable because the system outputs attribute and color codes that the terminal emulator doesn't understand;...
1
vote
1
answer
119
views
{\LaTeX} symbol in groff
Is there a way to print the {\LaTeX} original symbol in groff?
I would like to use the typography every time the word LaTeX appears in a document made with groff.
0
votes
3
answers
199
views
How can I prevent a line break between option and parameter using `.RB` and `.IR`?
When writing a manual page of a command, the SYNOPSIS contains:
.RB [ \-v
.IR version ]
Unfortunately when formatting the SYNOPSIS there is a line break between "[-v" and "version]&...
2
votes
1
answer
421
views
Debian 11 (Bullseye): man stopped working after upgrade?
After a recent upgrade, man has stopped working, and I can't figure out why. This is my system:
# cat /etc/*release*
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux&...
3
votes
1
answer
331
views
groff ms indentfirst and frenchspacing
I am typesetting drafts of my papers with the ms macro package, but in my language (Spanish) the custom is to indent all paragraphs and keep space regular after a period, contrary to US custom to ...
2
votes
1
answer
229
views
Why do groff -Tdvi | dvipdf and groff -Tpdf produce very different results?
Let's consider the following simple groff code
.EQ
s = sqrt { { sum from i=1 to N ( x sub i - x bar ) sup 2 } over { N - 1 } }
.EN
When I use the groff -e -Tpdf command I get the following (ugly) ...
3
votes
1
answer
72
views
pic(1): graphic cut off at right border
I created a graphic in the pic language as follows (v-modell.pic):
.PS
AF: box wid 1.6 ht 0.25 "Anforderungen"
SA: box same "Systemarchitektur" at AF.se + (0.1, -0.5)
KA: box same &...
0
votes
1
answer
166
views
Can I call a mdoc macro inline?
Despite the many conveniences of mdoc, I find syntax of troff is still a bit too newline-rich or "spaghetti" compared to the other languages. Consider this example:
.Sh DESCRIPTION
The
.Nm
...
1
vote
1
answer
112
views
How do I output an individual eqn described equation to a .ps or .eps?
I would like to reuse the output from eqn to get PS or EPS files which contains just the equation and not a complete A4 with the equation.
If I try:
$ cat test.eqn
.EQ
For ~ y=1 ~ -> ~ L( y hat , y)...
0
votes
2
answers
192
views
How do I scale a whole figure in pic?
Given a pic figure:
.PS
circle "Foo"
arrow
box "Bar"
arrow
box dashed "Foo" "Dashed"
.PE
Is it possible to scale the whole diagram element's widths and heights?...
2
votes
1
answer
901
views
How can I include a pic figure as external file in groff?
While using groff and pic it is possible to do:
$ cat test.ms
.TL
Test
.NH 1
Test Header
.PS
circle
arrow
box
.PE
$ cat test.ms | groff -ms -p > test.ps
Which generates a valid test.ps file ...
9
votes
3
answers
1k
views
Are ∈ and ℝ symbols available in eqn/roff?
A set of commonly used symbols to represent that a variable belongs to a given real coordinate space are ∈ ("ELEMENT OF", Unicode U+2208) and ℝ ("DOUBLE-STRUCK CAPITAL R", Unicode ...
2
votes
1
answer
152
views
Groff renders brackets and square roots incorrectly
The groff source
.EQ
left ( sqrt {1 over 2} right )
.EN
produces this
when a PDF is made, and viewed with some PDF readers. (Here, Atril.)
The error occurs with large round brackets and/or square ...
1
vote
1
answer
100
views
Prevent groff form setting bigger whitespace after sentence
Is there a way to prevent that groff is setting more whitespace after each sentence? (Not on a per sentence basis, but in general.)
1
vote
2
answers
550
views
Inserting the date in groff
How can I insert today's date in groff?
I know I can type today's date directly, but I would like the date to dynamically be produced, so that a document could be recompiled with a new date without ...
3
votes
1
answer
314
views
How do you put an image at the start of a paragraph in groff mom?
I'm trying to place a small image, about the height of two lines, at the beginning of a paragraph...kind of like how a drop-cap is placed. I've tried .PSPIC and .PDFIMAGE with different combinations ...
1
vote
1
answer
116
views
groff: How can I place punctuation after a link generated with the PDF_WWW_LINK mom macro?
I am trying to include a link to an online web resource using the groff mom macros. Below is a minimal reproducible example of my problem:
Here is some text with a
.PDF_WWW_LINK https://unix....
1
vote
1
answer
1k
views
How to add a hyperlink to a URL in groff with mom macros?
How can I create a hyperlink to a URL in groff, using the mom macros?
I know it is possible to create links to other sections within the same document, but I want to know how to create a clickable ...
0
votes
1
answer
534
views
Using Palatino font with groff mom macros
I am trying to use the Palatino font with my groff mom document.
The documentation says
FAMILY takes one argument: the name of the family you want. Groff comes with a small set of basic families, ...
1
vote
3
answers
374
views
How can I have a multi-row cell with the Unix tbl utility?
I am trying to work with groff to generate a table where one cell spans multiple rows.
I tried
.TS BOXED LABEL "Table 1: Use Case 1"
allbox, tab(@);
l l
l ld
l ^ .
Use Case Identifier@UC1
...
2
votes
1
answer
361
views
groff: How can I correctly render paragraphs between embedded images?
I have the following groff source using the mom macros:
.PRINTSTYLE TYPESET
.CAPTION_AFTER_LABEL IMG
.START
.PDF_IMAGE img/uc1.pdf 657p 152p SCALE 70 CAPTION "Figure 1: Activity diagram for UC1&...
2
votes
2
answers
189
views
Is there some way (command, request,...) in Groff to measure the height of a string or character?
I'm working on a preprocessor to draw the square root for the equation (attempt to improve aesthetic of the EQN equation) which involves finding the size (width and height) of the string.
I've found ...
0
votes
1
answer
189
views
How can you customise headings in the ms package for groff?
I noticed there's a similar answered question here, but that one's pertaining to the me package. I'd like to know if and how, if so, is it possible to that using ms instead.
2
votes
2
answers
327
views
Writing Vietnamese in Groff
Using ms macro, is there some way to support more Vietnamese accented characters in Groff? I looked through the page but there doesn't seem to have enough accented characters.
https://www.gnu.org/...
1
vote
2
answers
367
views
Make Numbered Equation in Groff
Using the ms macros and eqn, is there some way to number an equation in Groff automatically similar to LaTeX?
1
vote
2
answers
145
views
Formatting Proof in Groff
Is there a way to append a tombstone symbol (usually a square) to the right at the end of line of a proof similar to LaTeX proof?
1
vote
2
answers
485
views
How do I format man page for printing on custom page size?
I know that I can specify the custom page size to groff by passing -P-p... option.
When I run the following command:
gunzip -dc /usr/share/man/man1/fswebcam.1.gz | groff -mandoc -P-p612p,396p >...
0
votes
1
answer
389
views
Difference between "groff" and "gtroff"
From the groff documentation:
GNU 'troff' (or 'groff') is a system for typesetting documents.
Again:
In this document, we consequently say 'gtroff' when talking about the
GNU 'troff' program.
One ...
3
votes
2
answers
848
views
Render troff file on terminal like the man outputs on terminal
I was trying to render the troff file https://github.com/bit-team/backintime/blob/master/common/man/C/backintime-config.1 in terminal.
How can I make the output (using cat or some other utility) look ...
7
votes
2
answers
408
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
1
answer
391
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 ...
4
votes
2
answers
326
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
1
answer
159
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 ...
5
votes
1
answer
3k
views
How do I 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 -T pdf > outputfile.pdf
But, when I try it, I get the ...
4
votes
1
answer
2k
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. ...