[Top][All Lists]

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

Re: [Groff] howto pass args to macro

From: Tadziu Hoffmann
Subject: Re: [Groff] howto pass args to macro
Date: Tue, 6 Apr 2010 21:24:08 +0200
User-agent: Mutt/1.5.17 (2007-11-01)

> I want to pass multiple arguments to a macro and each argument may be 
> composed of multiple words/characters
> I figured out this works but is there a way without defining individual 
> strings
> [snip]

Put the arguments in double quotes, like this:

  .de P
    1 = \\$1
    2 = \\$2
    3 = \\$3
  .P "a b c" "d e f" "x y z t"

The quotes are stripped (i.e., they are not part of the
arguments), but the arguments retain the embedded spaces.

By the way, take a look at the Troff User's Manual,

This document gives a comprehensive overview of troff,
but it is comparatively short for a piece of software of
this complexity, so you can read it in a single sitting,
and even if you don't understand everything at first you will
at least know what's in there and can go back later when you
understand more of troff's capabilities (and limitations).

(And then you can read groff(7) to find out how groff
differs from the original troff.)

reply via email to

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