groff
[Top][All Lists]
Advanced

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

Re: [Groff] Using variables from register within fractions or equations


From: maouinin
Subject: Re: [Groff] Using variables from register within fractions or equations
Date: Sat, 13 Apr 2013 11:44:16 -0700 (PDT)


Ralph Corderoy wrote:
> 
> 
> I didn't notice anything from a quick look.  I think I'd need a small,
> self-contained, complete, example of the fault that I could runoff.
> 
>>   \h'\\n[w]u'\v'1m'\\*[n]\v'-1m'\h'\\n[w]u'\\$2\x'1m'\x'-1m'
> 
> 
> 

Sorry. The thread is over a year old. Here is the entirety of the macro
supplied by Tadziu Hoffmann in the original thread. I have included a sample
cloze passage also. Again, it works brilliantly in mode 1. It works nearly
as well in modes 2 and three, but I lose punctuation marks when blanks occur
at the ends of sentences. 

````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````

.\"
.\" ------------------------------------------------------------------------
.de Z
.sp 2
.nr n 1
.ad l
..
.\" ------------------------------------------------------------------------
.\" mode register m: 1 = easy, 2 = medium, 3 = hard
.\" ------------------------------------------------------------------------
.\" You could also use .X in modes 2 & 3
.de Q
.if \\nm=1 .X \\$@
.if \\nm=2 .Y \\$@
.if \\nm=3 .Y \\$@
..
.\" ------------------------------------------------------------------------
.\" Using blanks of variable length
.de X
.ds n \s'-6'\\nn\s'0'
.ds tm \\nn
.if \\nm=1 .char _ \v'.2m'\h'.1m'\D'l .8m 0'\h'.1m'\v'-.2m'
.if \\nm=2 .char _ \v'.2m'\D'l 1m 0'\v'-.2m'
.if \\nm=3 .char _ \v'.2m'\D'l 1m 0'\v'-.2m'
.tr a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_
.tr A_B_C_D_E_F_G_H_I_J_K_L_M_N_O_P_Q_R_S_T_U_V_W_X_Y_Z_
.nr w (\w'\\$1'-\w'\\*[n]')/2
\Z'\\$1'\c
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
.tr AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ
.ds x \\$1
.substring x 0 0
.if \\nm=1 \Z'\o'_\s'-2'\fI\\*x''\fR\s'0'\c
.if \\nm=2 \Z'\o'_\s'-2'\fI\\*x''\fR\s'0'\c
\h'\\n[w]u'\v'.7m'\fI\\*[n]\fR\v'-.7m'\h'\\n[w]u'\\$2\x'1m'\x'-1m'
\Z''
.nr n +1
..
.\" ------------------------------------------------------------------------
.\" Using blanks of fixed length
.de Y
.ds tm \\nn
.if \\nm=1 .tm Please use .X instead of .Y in "easy" mode
.ds W \v'.2m'\D'l 3.5c 0'\v'-.2m'
.ds n \s'-6'\\nn\s'0'
.nr w (\w'\\*W'-\w'\\*n')/2
.ds x \\$1
.ds l \\$1
.substring l -1
.substring x 0 0
.if \\nm=1 \fI\Z'\\s'-2'\\*x'\s'0'\fR\c
.if \\nm=2 \fI\Z'\\s'-2'\\*x'\s'0'\fR\c
\Z'\\*W'\c
\h'\\nwu'\v'.8m'\fI\\*n\fR\v'-.8m'\h'\\nwu'\\$2
.if '\?\*l\?'\?[\.]\?' \\*l
\Z''
.nr n +1
..
.\" ------------------------------------------------------------------------
.sp 3c
.\" ------------------------------------------------------------------------
.nr m 2
.Z
.ps 14
.vs 22

.nr Pt 1
.br
.P
When you go out to eat with your parents,
do they order special drinks that you are not
.Q allowed
to have? Many children feel frustrated when they can't
.Q share
something special with their parents.
One child who often went to adult gatherings
.Q felt
this frustration a lot. She wanted a special drink, too.
.P
The girl's name was Shirley Temple.
She was a child actress of the 1930s,
and she was famous for her touching song and dance
.Q movies.
These feel-good stories came at a time when the
financially troubled world needed a little
.Q encouragement.
Though she was very young,
Shirley Temple's professionalism and success
.Q earned
her a place among the biggest Hollywood stars of the day.
.P
Shirley Temple often
.Q visited
hotels and restaurants with adults.
During these visits the adults would drink fancy drinks called "cocktails."
.Q Unfortunately
for Miss Temple,
the cocktails contained alcohol. In
.Q response,
one knowledgeable bartender
.Q invented
a new cocktail for the child star and named it after her.
The new cocktail was delicious, fancy, and -- most importantly -- alcohol
.Q free.
.P
A Shirley Temple cocktail is
.Q made
of ginger ale,
orange juice and grenadine
which makes the drink pink and gives it a cherry
.Q flavor.
This
.Q mixture
\Z' 'is poured into a tall glass full of ice.
As decoration, the glass usually contains a slice of orange and a cherry.
.P
The new drink quickly
.Q caught
on with children across the country.
They enjoyed its sweet
.Q taste.
They also liked it because it was named after one of their
.Q favorite
stars. When they drank the new drink,
they felt like they were as famous as Shirley Temple.
.P
Now, you don't have to be
.Q left
out when your parents are ordering fancy drinks.
You can
.Q join
them and order a special cocktail of your own.
Thanks to Shirley Temple, cocktail hour can be enjoyed by
.Q kids,
too.
.P
.ad r
\*[tm] marks





-- 
View this message in context: 
http://old.nabble.com/Using-variables-from-register-within-fractions-or-equations-tp33299025p35290940.html
Sent from the Groff - General mailing list archive at Nabble.com.




reply via email to

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