groff
[Top][All Lists]
Advanced

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

Re: [groff] Changing A Defined String


From: Steffen Nurpmeso
Subject: Re: [groff] Changing A Defined String
Date: Thu, 25 Jan 2018 15:10:56 +0100
User-agent: s-nail v14.9.6-40-gdd750017

Robert Thorsby <address@hidden> wrote:
 |Temperatures here in AU have been in the range 35-45 for the past week  
 |and are forecast to be the same for the next week.  So with no  
 |inclination towards serious work I have turned my attention to  
 |rewriting my letterhead shell script, as one does.

And you have all those poisoning animals down there, too!
Luckily the great reef is already almost dead...

 |My letters carry the date in full -- Thursday, 25 January 2018 -- which  
 |is placed into the preamble of the groff file via my shell script:
 |
 |date --date="..." "+.ds DATE*FULL %A, %-d %B %Y" >> draftletter.gr
 |
 |But occasionally I also want to use the date in a ``shorter'' version  
 |that depends on the ``full'' version.  I appreciate that I can simply  
 |create two definitions, but once defined they would be independent of  
 |each other.
 ...
 |Can anyone assist with proper groff request(s) to replace the bashism  
 |so that any amendment to DATE*FULL is carried through automagically to  
 |DATE*SHORT?  I don't use any macro package.

I would use the fantastic possibility the wonderful Werner Lemberg
added to groff, strings with arguments:

  .ds template Thursday 25 January 2018
  .ds full \\$*
  .ds short \\$1 \\$3
  .ds DATE*FULL \\*[full \*[template]]
  .ds DATE*SHORT \*[short \*[template]]
  full \*[DATE*FULL] short \*[DATE*SHORT]

Hope this helps,
Ciao from Germany under west stream (mild)

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



reply via email to

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