groff
[Top][All Lists]
Advanced

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

Re: Register for text width to be used with \l'..'?


From: Oliver Corff
Subject: Re: Register for text width to be used with \l'..'?
Date: Fri, 8 Nov 2024 17:20:05 +0100
User-agent: Mozilla Thunderbird

Hi Branden,

for table environments, that works, thank you!

Again the problem of search terms... OF COURSE line length -> LL is what
I searched for, alas! I thought in terms of TeX terminology: \textwidth
which would lead nowhere.

\n[LL] produces 468000. I tried \l'\n[LL]/10000' but get an "error:
numeric overflow" message.

Taking advantage that a register ll is undefined in ms I tried then:

.nr ll \n[LL]/10000
\l'\n[ll]'

That basically does the trick but unfortunately 468000/10000 yields 46,
not 46.8 in groff (due to groff performing truncating division as
mentioned in the documentation).

How can I tweak the arithmetic operation to set the correct value of
46.8? Or can I bypass the whole truncating division issue by a smart
selection of scaling units?

Thank you for your insight,

Oliver.


On 08/11/2024 16:58, G. Branden Robinson wrote:
Hi Oliver,

At 2024-11-08T16:26:28+0100, Oliver Corff wrote:
if I want to draw a line spanning my whole text block using \l'nn', I
usually do it the quick and dirty way and use a number which produces
a visual fit, e.g. for an A4 page with default margin settings in ms I
say \l'46' (which is visibly a tiny bit too short but ok for my
current purpose).

Is there a way to feed the text width to \l directly? I studied the
list of predefined registers but there does not seem to be one.
Something like this?

$ nroff -t -ms ATTIC/hrule-in-text-block.ms|cat -s

This is an ms document.

This      is
a table   ...with  a  text block
           in it.  Let’s  see  if
           we can draw a horizon‐
           tal  rule  inside  the
           text block.
           ______________________
           Did that work?

If so, just use the `.l` register.

groff(7):

Registers
...
    Read‐only registers
      Predefined registers whose identifiers start with a dot are read‐
      only.  Many are Boolean‐valued.  Some are string‐valued, meaning
      that they interpolate text.  A register name (without the dot) is
      often associated with a request of the same name; exceptions are
      noted.
...
      \n[.l]         Line length; see .ll.

$ cat ATTIC/hrule-in-text-block.ms
.LP
This is an
.I ms
document.
.LP
.TS
tab(@);
L L.
This@is
a table@T{
\&.\|.\|.\|with a text block in it.
Let's see if we can draw a horizontal rule
inside the text block.
.br
\l'\n[.l]u'
.br
Did that work?
T}
.TE

Regards,
Branden

--
Dr. Oliver Corff
mailto:oliver.corff@email.de




reply via email to

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