groff
[Top][All Lists]
Advanced

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

Re: [Groff] Typesetting arbitrary fractions?


From: Jeff Conrad
Subject: Re: [Groff] Typesetting arbitrary fractions?
Date: Sun, 6 Nov 2005 00:44:04 -0800

A somewhat less elegant version that I wrote for use with MM about 20 years
ago (and haven't bothered to update).  The actual code uses real BEL
characters for delimiters, as was the MM style.

.\" ****************************************************************************
.\"  FR: FRaction
.\"  Usage: .FR <numerator> <denominator>
.\"         .FR <numerator> <denominator> <anything>
.\"         .FR <anything> <numerator> <denominator> <anything>
.\" ****************************************************************************
.de FR
.ie \\n(.$>3 \{\
\%\&\\$1\^\
\v'-.3m'\s-4\&\\$2\s0\
\v'+.3m'\h'-.05m'\(f/\c
.if ^G\\$3^G4^G \h'-.05m'\c
\s-5\\$3\s0\^\\$4
.\}
.el \{\
\%\&\v'-.3m'\s-4\&\\$1\s0\
\v'+.3m'\h'-.05m'\(f/\c
.if ^G\\$2^G4^G \h'-.05m'\c
\s-4\\$2\s0\
\^\\$3
.\}
..$

It worked well enough, including the diddle for the digit 4 in the
denominator, with the Times Roman and Helvetica fonts that we had available
at the time.  I used similar macros for superscripts and subscripts.

Jeff Conrad






reply via email to

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