2

Different systems render man pages differently. Some paginated the pages by default, some don't. How can I control the pagination behaviour?

And how can I configure the page height (in lines) when pagination is enabled?

For example, on Solaris 10, when I view man pages in the terminal (e.g. man man) they are paginated like this:

User Commands                                              man(1)
...
SunOS 5.10          Last change: 29 Apr 2010                    1

User Commands                                              man(1)
...
SunOS 5.10          Last change: 29 Apr 2010                    2
...

On Fedora Linux the same call just renders one big page:

MAN(1)                        Manual pager utils                        MAN(1)
...
2.7.6.1                           2016-12-12                            MAN(1)
2
  • 1
    On which system do you want to control this behaviour? – Kusalananda Sep 2 '17 at 12:05
  • @Kusalananda, on Linux and Solaris. – maxschlepzig Sep 2 '17 at 14:57
2

The groff documentation describes several options that can be used to control pagination, including -rCR=0 to disable the default single-page behaviour in nroff mode. This can be set using the MANROFFOPT environment variable.

I haven't found a way to control the page length, short of injecting a .pl request into the nroff input stream, and in the absence of that it seems to be effectively a fixed value. It might be worthwhile for man to gain an option to enable pagination and set the page length based on the terminal size ...

1
  • I found, for tmac.an.old and classic AT&T nroff, one can inject .ch }H and .ch }F after the initial .TH (perhaps with .if \ng==1 so it can be triggered with -rg1 from the command line) to the same effect; it will lose the last trailing footer as well, unlike what mdoc (which already defaults to cR) does. – mirabilos Oct 2 '20 at 2:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.