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
0 votes
2 answers
61 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" | ...
Jens's user avatar
  • 1,758
1 vote
1 answer
43 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 &...
Shamaoke's user avatar
  • 191
1 vote
2 answers
125 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 ...
Monsieur Pierre Doune's user avatar
0 votes
2 answers
123 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 ...
Juandev's user avatar
1 vote
2 answers
41 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 ...
cind's user avatar
  • 41
0 votes
3 answers
199 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;...
Darrel Barton's user avatar
1 vote
1 answer
89 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.
ranemirusG's user avatar
0 votes
3 answers
152 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]&...
U. Windl's user avatar
  • 1,269
2 votes
1 answer
363 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&...
j4nd3r53n's user avatar
  • 591
3 votes
1 answer
234 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 ...
jarnosz's user avatar
  • 196
2 votes
1 answer
184 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) ...
user avatar
3 votes
1 answer
67 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 &...
Patrick Bucher's user avatar
0 votes
1 answer
126 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 ...
Mingye Wang's user avatar
  • 1,181
1 vote
1 answer
95 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)...
M.E.'s user avatar
  • 589
0 votes
2 answers
152 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?...
M.E.'s user avatar
  • 589
2 votes
1 answer
714 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 ...
M.E.'s user avatar
  • 589
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 ...
M.E.'s user avatar
  • 589
2 votes
1 answer
126 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 ...
kleinbottle4's user avatar
0 votes
1 answer
82 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.)
Philipp L.'s user avatar
1 vote
2 answers
424 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 ...
Shane Bishop's user avatar
3 votes
1 answer
181 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 ...
Jamie Ramone's user avatar
1 vote
1 answer
90 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....
Shane Bishop's user avatar
1 vote
1 answer
747 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 ...
Shane Bishop's user avatar
0 votes
1 answer
448 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, ...
Shane Bishop's user avatar
1 vote
3 answers
273 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 ...
Shane Bishop's user avatar
2 votes
1 answer
312 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&...
Shane Bishop's user avatar
2 votes
2 answers
123 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 ...
Good Bye's user avatar
0 votes
1 answer
126 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.
Jamie Ramone's user avatar
2 votes
2 answers
277 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/...
Good Bye's user avatar
1 vote
2 answers
295 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?
Good Bye's user avatar
1 vote
2 answers
135 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?
Good Bye's user avatar
1 vote
2 answers
355 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 >...
user143266's user avatar
0 votes
1 answer
300 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 ...
anon's user avatar
  • 35
2 votes
2 answers
511 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 ...
Porcupine's user avatar
  • 1,802
7 votes
2 answers
319 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 ...
Eric Cousineau's user avatar
2 votes
1 answer
331 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 ...
M.E.'s user avatar
  • 589
3 votes
2 answers
244 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 ...
user avatar
0 votes
1 answer
142 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 ...
Soulthym's user avatar
  • 177
4 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 ...
Daniel Bandeira's user avatar
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. ...
zoomer's user avatar
  • 43
3 votes
2 answers
604 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 ...
Soulthym's user avatar
  • 177
0 votes
0 answers
206 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 ...
xfnw's user avatar
  • 21
4 votes
1 answer
597 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.
GeriatricJacob's user avatar
1 vote
2 answers
1k 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 ...
Ljm Dullaart's user avatar
  • 4,397
3 votes
2 answers
275 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 ...
Soulthym's user avatar
  • 177
1 vote
1 answer
1k 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 ...
Soulthym's user avatar
  • 177
1 vote
1 answer
864 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 ...
user avatar
2 votes
1 answer
133 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 ...
Maniyar's user avatar
  • 19
1 vote
1 answer
127 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 . ...
user avatar
0 votes
0 answers
117 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.
Thomas D's user avatar