groff
[Top][All Lists]
Advanced

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

Re: [Groff] [OOPS!] Subscripts


From: Ted Harding
Subject: Re: [Groff] [OOPS!] Subscripts
Date: Tue, 31 Jul 2012 00:36:06 +0100 (BST)

OOPS! [see at end]

On 30-Jul-2012 23:03:47 Ted Harding wrote:
> On 30-Jul-2012 22:06:18 Timothy Groves wrote:
>> I need to embed subscripts in my document.  In particular, I want 
>> something that in eqn would be expressed as 'V sub 0' and 'V sub 1'.  
>> There appears to be no glyphs suitable to this job available in groff, 
>> and I cannot use eqn in the context that I need this expression, because 
>> inline eqn produces results inconsistent with the surrounding text.
>> 
>> I am using groff 1.21 and ms.  Any suggestions?
> 
> If you want subscripts in a similar style to eqn subscripts (i.e. at
> reduced point size), then you can use \*<X\*> to make X into a
> subscript, and also \*{Y\*} to make Y into a superscript.
> 
> So, for instance, your "V sub 0" and "V sub 1" would be done as
> 
>   V\*<0\*>   V\*<1\*>
> 
> Note that this makes no reference to what precedes it, unlike eqn
> where 'sub' situates the subscript beside the "bottom right-hand
> corner" of what precedes it; \*<X\*> simply moves down a bit from
> the current position, reduces the point size, outputs whatever X
> may be, and then resets the point size and moves back up. So
> 
>   V\*<This is a subscript\*>
> 
> is perfectly possible.
> 
> You can refine the style of this by defining your own version of
> \*< and \*> as strings, using
> .ds < [...]
> .ds > [...]
> to, for instance, move down a different amount, or not change the
> point size by so much, etc.
> 
> Hoping this helps,
> Ted.

OOPS!
In putting my suggestion above, I had forgotten (it is decades since
I did it) that I had pinched the \*<...\*> and \*{...\*} from the
'me' macros, incorporating them (with modifications) in my personal
macro set! They are not part of troff intrinsically, nor do they occur
in the 'ms' macros.

My definitions are:

.\" Superscripts (ex tmac.e) (current versions without extra line space)
.\" (reinstate commented versions to restore extra line space)
.\" .ds { \v'-0.3m'\x'-0.2m'\\s[\\n[.s]*8u/10u]
.ds { \v'-0.3m'\\s[\\n[.s]*9u/12u]
.ds } \s0\v'0.3m'
.\" Subscripts
.\" .ds < \v'0.3m'\x'0.2m'\s[\\n[.s]*8u/10u]
.ds < \v'0.3m'\s[\\n[.s]*9u/12u]
.ds > \s0\v'-0.3m'
.\" Up and Down (like sup/sub but no size change)
.ds UP \v'-0.3m'\x'-0.3m'
.ds DOWN \v'0.3m'\x'0.3m'

Sorry for the confusion!
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 31-Jul-2012  Time: 00:35:58
This message was sent by XFMail
-------------------------------------------------


reply via email to

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