groff
[Top][All Lists]
Advanced

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

Re: Explanations with an EQN User Guide


From: Tadziu Hoffmann
Subject: Re: Explanations with an EQN User Guide
Date: Tue, 23 May 2023 13:20:43 +0200
User-agent: Mutt/1.11.4 (2019-03-13)

> The tab is passed to groff as \t\, man 7 groff says \t is
> "uninterpreted", yet the tab skips to a tab stop set by .ta.
> This leaves me totally confused, because groff apparently
> ignores \t when it doesn't come from eqn. If, as i believe,
> eqn doesn't know about .ta and groff doesn't know about eqn
> and normally ignores \t, what causes the skip to happen?

Eqn makes troff assemble a string named "10", and at the end
of its output this string is interpolated:

  \*(10

During the definition of the string, the escape sequence \t
is interpreted as a tab (see section 7.2. "Copy mode input
interpretation" of the Troff User's Guide).  You can therefore
even embed \t in your equation to achieve the same effect as
a literal tab.  (But why would you want to do that?)

Accordingly, troff only ignores \t when it is encountered in
the running text, and if this text is not subject to copying:

  a\tb          <-- does nothing

  .ds X a\tb
  \*X           <-- tab!

  .de Y
  a\tb
  ..
  .Y            <-- tab!

Also, tabs in eqn material are a bad idea if your macro package
internally uses tabs to place the equation number.  This is
roughly what my own macros do:

  .nr E# 0
  .de EQ
  .nr E# +1
  .di XX \" Just to throw away the default output.
  ..
  .de EN
  .br
  .di
  .ta \n(.lu/2uC \n(.luR
  \t\\*(10\t(\\n(E#)
  .br
  ..





reply via email to

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