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
0answers
10 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
3answers
31 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 ...
1
vote
1answer
25 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
1answer
31 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
1answer
12 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.
1
vote
1answer
65 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/...
0
votes
1answer
59 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
1answer
69 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
2answers
43 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
1answer
31 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 ...
0
votes
1answer
62 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 ...
3
votes
1answer
65 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
71 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
29 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
40 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
1answer
47 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 ...
1
vote
1answer
683 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
1answer
655 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. ...
3
votes
2answers
119 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
70 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 ...
3
votes
1answer
260 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.
1
vote
2answers
277 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 ...
4
votes
2answers
144 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
417 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
215 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
59 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
79 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
54 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
157 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
320 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 ...
2
votes
1answer
264 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
201 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
641 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 ...
1
vote
2answers
574 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
170 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
254 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 ...
3
votes
1answer
938 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
79 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 ...
4
votes
2answers
167 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
99 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
160 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
87 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
112 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 ...
4
votes
2answers
2k 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 ...
7
votes
1answer
875 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
304 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
232 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
2k 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
251 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 ...