groff
[Top][All Lists]
Advanced

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

Re: [Groff] Horizontal positioning, .nr vs \R


From: Larry Kollar
Subject: Re: [Groff] Horizontal positioning, .nr vs \R
Date: Wed, 31 Mar 2010 12:54:10 -0400


On Mar 24, 2010, at 1:57 AM, Werner LEMBERG wrote:

This line *does* work:

 .   nop \\$*\h'0'\R'toc:horiz \\n[.k]'

In other words, forcing a zero horizontal motion flushes the single
word out and sets the .k register properly.  Is this expected
behavior, and if so, is \h'0' the correct way to flush a partial
line?

I can't repeat that.  Put the following into a file `R':

  .de xxx
  .  nop \\$*\h'0'\R':a \\n[.k]'
  .  tm :a == \\n[:a]
  ..
  .
  .xxx aaa
  .
  .br
  .
  .de yyy
  aaa\h'0'\R':b \\n[.k]'
  .  tm :b == \\n[:b]
  ..
  .
  .yyy
  .
  .br
  .
  aaa\R':c \n[.k]'
  .tm :c == \n[:c]
  .
  .br

Saying `troff R > /dev/null' gives

  :a == 13320
  :b == 13320
  :c == 13320

In other words, I get the same results either using or not using a
macro, and with or without \h'0'.

You have to provide a small stand-alone test case so that we can find
out what's really going on.

Werner,
Your example isn't long enough. Everything works fine until the entry takes up more than one line. In your example, replace the argument to .xxx with something that will break to the next line.

        Larry




reply via email to

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