home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / text / tex / 14493 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  2.6 KB

  1. Path: sparky!uunet!think.com!ames!network.ucsd.edu!mvb.saic.com!info-tex
  2. From: dlv@bwalk.dm.com (Dimitri Vulis)
  3. Newsgroups: comp.text.tex
  4. Subject: Typesetting a play in verse
  5. Message-ID: <oJV7VB1w165w@bwalk.dm.com>
  6. Date: Tue, 22 Dec 92 10:00:35 EST
  7. Organization: Brighton Beach Boardwalk BBS, Forest Hills, N.Y.
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 89
  10.  
  11. Folks,
  12.  
  13. Recently I was asked to help typeset in TeX a play in verse. I've seen
  14. queries about plays occasionally here and on comp.text.tex and haven't
  15. yet seen any replies (maybe I missed them, sorry :), so I figured I'd
  16. post the macros I wrote, hoping they'll be useful to someone.
  17.  
  18. The conventions for this play are that
  19. 1. A line is usually indented by a+bn, where n is the number of stressed
  20.    syllables in it (or it + its continuations)
  21. 2. A line is sometimes indented by the length of some (not immediately)
  22.    preceding line (including appropriate horizontal space)
  23. (Apologies for not using the correct English major jargon)
  24.  
  25. So I wrote a macro \G, whose first argument is n (or * is this is continuation)
  26. and whose second argument is the text. Example:
  27.  
  28. \G{5}{What time is it?}
  29.  
  30. \Gremark{Liza}
  31.  
  32. \G{*}{All is astir --- broad day, Miss.}
  33.  
  34. \Gremark{Sofya {\em (from her room)}}
  35.  
  36. \G{5}{What time is it?}
  37.  
  38. \Gremark{Liza}
  39.  
  40. \G{*}{Six, seven, eight, for sure.}
  41.  
  42. \Gremark{Sofya {\em (from her room)}}
  43.  
  44. \G{4}{Don't lie.}
  45.  
  46. \Gremark{Liza {\em (away from the door)}}
  47.  
  48. \G{*}{Dear me, that cursed amour!}
  49.  
  50. (\Gnote and \Gremark just center their arguments in \em or \bf).
  51. The output looks roughly like this:
  52.  
  53.    What time is it?
  54.                      Liza
  55.                     All is astir --- broad day, Miss.
  56.               Sofya (from her room)
  57.    What time is it?
  58.                      Liza
  59.                     Six, seven, eight, for sure.
  60.               Sofya (from her room)
  61.       Don't lie.
  62.            Liza (away from the door)
  63.                  Dear me, that cursed amour!
  64.  
  65. The macro follows. (One possible improvement would be to compute the offset
  66. from n, rather than enumerate them; but, I figured I might end up for non-
  67. linear spacing).
  68.  
  69. \newbox\Gore
  70. \newdimen\Goff \Goff0pt
  71.  
  72. \def\G#1#2{%
  73. \ifx#11%
  74. \Goff=30ex
  75. \else\ifx#12%
  76. \Goff=25ex
  77. \else\ifx#13%
  78. \Goff=20ex
  79. \else\ifx#14%
  80. \Goff=15ex
  81. \else\ifx#15%
  82. \Goff=10ex
  83. \else\ifx#16%
  84. \Goff=5ex
  85. \else\ifx#1*% keep old \Goff
  86. \else\message{I don't understand #1!}
  87. \fi\fi\fi\fi\fi\fi\fi%
  88. \setbox\Gore\hbox{\hskip\Goff#2 }%
  89. \Goff=\wd\Gore%
  90. \box\Gore}
  91.  
  92. While this is not terribly long, it took me a while to cook this up.
  93. So, I hope this helps someone.
  94.  
  95. Happy whatever,
  96.  
  97. ---
  98. dlv@bwalk.dm.com (Dimitri Vulis)
  99. Brighton Beach Boardwalk BBS, Forest Hills, N.Y.: +1-718-261-2013, 14.4Kbps
  100.