]> ;********************************************** ; command line triggers (define FM #f) ;flag indicating generation of front matter (define fm #f) (define *fm* (or FM fm)) ;********************************************** ; manifests and other initial and default conditions (define *titleFontFamily* "Times New Roman") (define *titleFontSize* 18pt) (define *frontMatterIndent* .25in) (define *personaGroupIndent* .5in) (define *personaSpaceBefore* (/ *textFontSize* 2)) (define *sectFontFamily* "Times New Roman") (define *sectFontSize* 14pt) (define *sceneIndent* .5in) (define *textFontFamily* "Times New Roman") (define *textFontSize* 12pt) (define *speakerWidth* 1.25in) (declare-initial-value font-family-name *textFontFamily*) (declare-initial-value font-size *textFontSize*) (declare-initial-value line-spacing *textFontSize*) (root ;establish page parameters (make simple-page-sequence left-margin: 1in right-margin: 1in top-margin: 1in bottom-margin: 1in footer-margin: .5in center-footer: (page-number-sosofo) (process-children))) ; no default behaviour allowed to ensure nothing is missed ; (the following requires all elements to have explicit construction rules) (default (error (string-append "No construction rule for element: '" (gi (current-node)) "'"))) ;********************************************** ; Title and other front matter except personae (element PLAY ;the entire work (process-children)) (element (PLAY TITLE) ;the play's title (make paragraph quadding: 'center font-family-name: *titleFontFamily* font-size: *titleFontSize* line-spacing: *titleFontSize* font-weight: 'bold keep-with-next?: #t (process-children-trim))) (element FM ;front matter (if *fm* ;parameterized display (make box ;requested to display display?: #t start-indent: *frontMatterIndent* end-indent: *frontMatterIndent* space-before: *titleFontSize* (process-children)) (empty-sosofo))) ;requested to not display (element (FM P) ;paragraphs in front matter (make paragraph space-before: *textFontSize* (process-children))) (element PLAYSUBT ;the play's subtitle (make paragraph quadding: 'center font-family-name: *sectFontFamily* font-size: *sectFontSize* line-spacing: *sectFontSize* font-weight: 'bold space-before: *sectFontSize* keep-with-next?: #t (process-children-trim))) ;********************************************** ; Personae Information (element PERSONAE ;list of dramatis personae (process-children)) (element PERSONA ;a person (make paragraph space-before: *personaSpaceBefore* (process-children-trim))) (element PGROUP ;a group of people with similar roles (process-children)) (element (PGROUP PERSONA) ;a person in a group (make paragraph space-before: (if (= (child-number) 1) *personaSpaceBefore* 0pt) keep-with-next?: #t (process-children-trim))) (element GRPDESCR ;the role shared by the group (make paragraph start-indent: *personaGroupIndent* space-before: 0pt (process-children-trim))) ;********************************************** ; Scene Information (define *sceneStyle* ;style for all scene descriptions (style quadding: 'center font-family-name: *textFontFamily* font-size: *textFontSize* line-spacing: *textFontSize* font-weight: #f font-posture: 'italic start-indent: *sceneIndent* end-indent: *sceneIndent*)) (element SCNDESCR ;scene setting as background for entire play (make paragraph use: *sceneStyle* space-before: *textFontSize* (process-children-trim))) (element SCENE ;each scene (process-children)) (element (SCENE TITLE) ;title within a scene (make paragraph use: *sceneStyle* space-before: *textFontSize* (process-children-trim))) ;********************************************** ; Section Information (element INDUCT ;before the prologue (process-children)) (element PROLOGUE ;at the start of the play (process-children)) (element ACT ;within the play (process-children)) (element EPILOGUE ;at the end of the play (process-children)) (element TITLE ;assume other titles are titles of sections (make paragraph quadding: 'center font-family-name: *sectFontFamily* font-size: *sectFontSize* line-spacing: *sectFontSize* font-weight: 'bold space-before: *sectFontSize* keep-with-next?: #t (process-children-trim))) (element SUBTITLE ;assume other titles are titles of sections (make paragraph quadding: 'center font-family-name: *sectFontFamily* font-size: *sectFontSize* line-spacing: *sectFontSize* font-weight: #f space-before: 0pt keep-with-next?: #t (process-children-trim))) ;********************************************** ; Body Information (element STAGEDIR ;stage direction (make paragraph font-posture: 'italic space-before: (if (or (equal? (gi (parent)) "LINE") (equal? (gi (parent)) "SPEECH")) 0pt *textFontSize*) (literal "[") ;surround so not spoken accidentally (process-children-trim) (literal "]"))) (element SUBHEAD ;labelling of a following sequence (make paragraph font-posture: 'italic keep-with-next?: #t (literal "(") ;surround so not spoken accidentally (process-children-trim) (literal ")"))) (element SPEECH ;a set of lines by one or more speakers (make table ;use a table to accommodate multiple speakers space-before: (/ *textFontSize* 2) keep: 'page may-violate-keep-after?: #t (make table-column ;ensure speaker column is narrow column-number: 1 width: *speakerWidth*) (make table-cell ;collect all speakers (make paragraph (with-mode *speechSpeaker* (process-matching-children "SPEAKER")))) (make table-cell ;collect all lines and instructions (process-children)))) (mode *speechSpeaker* ;collect all speakers into single column (element SPEAKER ;separate with ampersands to indicate multiple (if (= (child-number) 1) (make sequence font-posture: 'italic (process-children-trim)) (make sequence font-posture: 'italic (literal " & ") (process-children-trim)))) (default ;fail-safe - this should not trigger (empty-sosofo))) (element SPEAKER ;this should not trigger - only in mode (empty-sosofo)) (element LINE ;all of the lines for a given set of speakers (make paragraph (process-children-trim))) ; end of file