groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Trouble switching to groff, macro gives syntax error...


From: Tadziu Hoffmann
Subject: Re: [Groff] Trouble switching to groff, macro gives syntax error...
Date: Wed, 16 Sep 2015 20:23:41 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

> There is several lines of whitespace and a page number. I want
> the first line of text to be on the first line of output and
> no page numbers.  There are left and right margins. I need
> it to have no margins and a page width of 80 columns when
> generating text output. The PDF version can have margins if
> that is possible. My needs are backwards to most as the text
> version is the one i care most about.  There is ansi codes
> in the output. I need the output to be plain ascii text as
> it is being viewed in a game not a xterminal.


Since you're using mm, you have a number of options:


Command-line flags:

  Use -r<regname><value> (one-character register names only)
  or -r<regname>=<value> (groff extension, arbitrary register
  names, use -d to set strings) to set the margins:

    O  page offset,
    W  text width,
    L  page length,
    TP custom page header, define as empty for no header.

ANSI codes:

  Set environment variable GROFF_NO_SGR to something
  and then filter through "col -b".

Altogether:

  export GROFF_NO_SGR=yes
  nroff -mm -rO0n -rW80n -rL1000v -dTP= file.mm | col -b



Or, alternatively, put this at the top of your file:

  .if n \{\
  .fp 1 R
  .fp 2 R
  .fp 3 R
  .nr O 0n
  .nr W 80n
  .nr L 1000v
  .de TP
  ..
  .\}
  .mso m.tmac

and then simply format with

  nroff file.mm

(no -mm necessary because the macros are loaded by the
document itself).

Or, put that stuff in a separate file, say, text.mm,
and format with

  nroff text.mm file.mm

so that the same settings in text.mm can be used for
a number of different documents.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]