groff
[Top][All Lists]
Advanced

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

Re: [groff] A few newb questions about Troff typesetting


From: Ted Harding
Subject: Re: [groff] A few newb questions about Troff typesetting
Date: Tue, 28 Nov 2017 21:05:28 +0000

And I'll aff my biut to this (see below).

On Tue, 2017-11-28 at 14:57 +0000, Ralph Corderoy wrote:
> Hi,
> 
> I'll take an easy one.
> 
> > > 1) How do I use colours inside documents?  For example, I want to
> > >    colour a word blue.  Also, are there ways to colour graphic
> > >    primitives as well?  How about invert all colours?  Basically,
> > >    how is colour-trickery done?
> 
> See `info groff Colors | less'.

I have a personal macro package, tmac.ted, which is in the command line
after "-ms" (s0 that I use the 'ms' macros, as in
  troff ....  -ms -mted -Tps | grops ....

which defines all sorts of things, one of which is colours.
This presumes that the output will be finally formulated as a PS file.
The basic section on colours is as follows:

.\"=================================================================
.\" COLOURS
.ds RED "\X'ps: exec 1 0 0 setrgbcolor'
.ds GREEN "\X'ps: exec 0 1 0 setrgbcolor'
.ds BLUE "\X'ps: exec 0 0 1 setrgbcolor'
.ds YELLOW "\X'ps: exec 1 1 0 setrgbcolor'
.ds MAGENTA "\X'ps: exec 1 0 1 setrgbcolor'
.ds CYAN "\X'ps: exec 0 1 1 setrgbcolor'
.ds BLACK "\X'ps: exec 0 0 0 setrgbcolor'
.ds WHITE "\X'ps: exec 1 1 1 setrgbcolor'
.als GRE GREEN
.als BLU BLUE
.als YEL YELLOW
.als MAG MAGENTA
.als CYA CYAN
.als BLA BLACK
.als WHI WHITE
.de colour
.\"usage, e.g.: .colour RED
\\*[\\$1]
..
.\"
=======================================================================

but you can add to these definitions to make other colours available.
An alternative could be to express the definitions in CMYK colours.

Then you can input the likes of:

This word is in
.BLU
blue
.BLA
and this word is in
.GRE
green
.BLA

and so on.

Hoping this helps!
Ted.




reply via email to

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