groff
[Top][All Lists]
Advanced

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

Re: [Groff] macros for inserting code


From: Ralph Corderoy
Subject: Re: [Groff] macros for inserting code
Date: Sun, 26 Aug 2001 11:19:53 +0100

Hi Paul,

> Presently, I just use \fC and .br commands to add code to my
> documentation.  Is there any groff equivalents to <code></code>?

If the macro set you're using doesn't provide what you like, try
writing your own.

    .de code
    .sp
    .ft C
    .nf
    .in 0.5i
    ..
    .de /code
    .sp
    .ft
    .fi
    .in
    ..
    Only two of my personalities are schizophrenic, but one of them is
    paranoid and the other one is out to get him.
    .code
    void common_output::solid_arc(const position &cent, double rad,
                                  double start_angle, double end_angle,
                                  const line_type &lt)
    {
      line_type slt = lt;
      slt.type = line_type::solid;
      arc(cent + position(cos(start_angle), sin(start_angle))*rad,
          cent,
          cent + position(cos(end_angle), sin(end_angle))*rad,
          slt);
    }
    ./code
    Next to being shot at and missed, nothing is really quite as satisfying
    as an income tax refund.


Ralph.


reply via email to

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