Bugs in troff?

Toni Roth toni at erix.UUCP
Fri Jul 19 05:02:10 AEST 1985


I recently started to use troff in order to write a macro package.
As troff is new to me, I'm not sure it's really bugs that I've found,
or if I use troff incorrect.

However, I tried to write a macro that would print a header on each
new page. The problem is : If it's the first page, I want to write something 
on a certain line on a certain distance from the edge. After that I 
always want to write something else further to the right, on the same
line. So I had to split the in-line-commands in smaller parts, which 
made one piece each. I tried several variations, but none seemed to work.
When I tried to find out why, I discovered that troff does not ignore
comments and handles \c, \\c and \ at end of lines strangely.
After a lot of trial-and error, this worked correctly:


.de hd
   .
   .
   .

\v'|1c'\
\h'|11.4c'\
\\*(ko
\h'|18c.7c'\\n%
.br

or

\v'|1c'\c
\h'|11.4c'\
\\*(ko
\h'|18c.7c'\\n%
.br

The things that didn't work was:

\v'|1c'\
\h'|11.4c'\c
\\*(ty\
\h'|18c.7c'\\n%
.br


\v'|1c'\
\h'|11.4c'\\c
\\*(ty\
\h'|18c.7c'\\n%
.br

\v'|1c'\c\"comment
\h'|11.4c'\
\\*(ty\
\h'|18c.7c'\\n%
.br

Which made breaks before the string ty was printed.

There were many other strange things, but I can't list them all.
My questions are: How do I split the in-line-commands (what do I 
put on the end of the macro lines) if I want to continue on the 
same line? How do I use \, \c and \\c ? How do I put comments on
the end of in-line-command - lines?



More information about the Comp.unix mailing list