🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #9570

Typesetting a play in verse

#9570
From: Dimitri Vulis
Date: Tue, 22 Dec 1992 15:00
89 lines
2774 bytes
Folks,

Recently I was asked to help typeset in TeX a play in verse. I've seen
queries about plays occasionally here and on comp.text.tex and haven't
yet seen any replies (maybe I missed them, sorry :), so I figured I'd
post the macros I wrote, hoping they'll be useful to someone.

The conventions for this play are that
1. A line is usually indented by a+bn, where n is the number of stressed
   syllables in it (or it + its continuations)
2. A line is sometimes indented by the length of some (not immediately)
   preceding line (including appropriate horizontal space)
(Apologies for not using the correct English major jargon)

So I wrote a macro \G, whose first argument is n (or * is this is continuation)
and whose second argument is the text. Example:

\G{5}{What time is it?}

\Gremark{Liza}

\G{*}{All is astir --- broad day, Miss.}

\Gremark{Sofya {\em (from her room)}}

\G{5}{What time is it?}

\Gremark{Liza}

\G{*}{Six, seven, eight, for sure.}

\Gremark{Sofya {\em (from her room)}}

\G{4}{Don't lie.}

\Gremark{Liza {\em (away from the door)}}

\G{*}{Dear me, that cursed amour!}

(\Gnote and \Gremark just center their arguments in \em or \bf).
The output looks roughly like this:

   What time is it?
                     Liza
                    All is astir --- broad day, Miss.
              Sofya (from her room)
   What time is it?
                     Liza
                    Six, seven, eight, for sure.
              Sofya (from her room)
      Don't lie.
           Liza (away from the door)
                 Dear me, that cursed amour!

The macro follows. (One possible improvement would be to compute the offset
from n, rather than enumerate them; but, I figured I might end up for non-
linear spacing).

\newbox\Gore
\newdimen\Goff \Goff0pt

\def\G#1#2{%
\ifx#11%
\Goff=30ex
\else\ifx#12%
\Goff=25ex
\else\ifx#13%
\Goff=20ex
\else\ifx#14%
\Goff=15ex
\else\ifx#15%
\Goff=10ex
\else\ifx#16%
\Goff=5ex
\else\ifx#1*% keep old \Goff
\else\message{I don't understand #1!}
\fi\fi\fi\fi\fi\fi\fi%
\setbox\Gore\hbox{\hskip\Goff#2 }%
\Goff=\wd\Gore%
\box\Gore}

While this is not terribly long, it took me a while to cook this up.
So, I hope this helps someone.

Happy whatever,

---
dlv@bwalk.dm.com (Dimitri Vulis)
Brighton Beach Boardwalk BBS, Forest Hills, N.Y.: +1-718-261-2013, 14.4Kbps
Technical Details
Message-ID: <oJV7VB1w165w@bwalk.dm.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!network.ucsd.edu!mvb.saic.com!info-tex

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!network.ucsd.edu!mvb.saic.com!info-tex
From: dlv@bwalk.dm.com (Dimitri Vulis)
Newsgroups: comp.text.tex
Subject: Typesetting a play in verse
Message-ID: <oJV7VB1w165w@bwalk.dm.com>
Date: Tue, 22 Dec 92 10:00:35 EST
Organization: Brighton Beach Boardwalk BBS, Forest Hills, N.Y.
X-Gateway-Source-Info: Mailing List
Lines: 89