Debian Codegraph @

texmf-dist/doc/latex/sharedline/README.md

raw
1 # The sharedline Package
2
3 A LaTeX package for typesetting shared lines in dramatic verse.
4
5 ## The Problem
6
7 Typesetting dramatic verse, such as in the plays of Shakespeare, presents a
8 unique challenge: a single metrical line is often shared between two or more
9 characters, and hence is spread over multiple lines, with subsequent lines indented to
10 create visual continuity, but (potentially) with character prompts
11 at the beginning of the subsequent lines.
12
13 This package provides two simple commands, `\shareline` and `\linefeed`, that
14 work together to solve this problem.
15
16
17 ## Requirements
18
19 * A modern LaTeX distribution (like TeX Live, MiKTeX, or MacTeX).
20 * The `xparse` package (this is part of the standard LaTeX kernel and should require no extra installation).
21
22
23 ## Usage
24
25 The package provides two commands, `\shareline` and `\linefeed`.
26
27 ### Core Concept
28
29 1. `sharedline` works in, but does not depend on, the `verse` environment.
30 2. You start a shared line with `\shareline{...}`.
31 3. You use `\linefeed[...]{...}` for all subsequent parts of that same shared line.
32 4. You are responsible for manually adding line breaks (`\\`) after each segment to move to the next physical line.
33
34 ---
35
36 ### Command Reference
37
38 #### `\shareline{full text}`
39
40 This command **starts** a shared line.
41
42 * **Syntax:** It takes a single mandatory argument containing the *entire* first segment of the line, including any speaker prompt.
43 * **Action:** It typesets the `<full text>` and saves its horizontal width as the baseline for the following segment.
44
45 #### `\linefeed[intro]{verse}`
46
47 This command **continues** a shared line.
48
49 * **Syntax:** It takes an optional argument for introductory text (like a speaker prompt) and a mandatory argument for the verse text.
50 * **Action:** It calculates the correct indentation based on the total width of all previous parts, typesets its own text, and then updates the total width for the next `\linefeed` command.
51
52 ---
53
54 ### Examples
55
56 #### Two-Way Split
57
58 ```latex
59 \begin{verse}
60 \shareline{ANNE: I would I knew thy heart.}\\
61 \linefeed[GLOUCESTER: ]{'Tis figured in my tongue.}\\
62 \end{verse}
63 ```
64
65 #### Three-Way Split
66
67 Note that `\linefeed` is used for both the second and third parts. A manual line break is required after each segment.
68
69 ```latex
70 \begin{verse}
71 \shareline{GUARD 1: Who goes there?}\\
72 \linefeed[GUARD 2: ]{Speak now, or I swear}\\
73 \linefeed[GUARD 1: ]{I'll shoot!}\\
74 \end{verse}
75 ```
76
77 #### Without Speaker Prompts
78
79 The syntax remains clean when no prompts are needed. Simply omit the optional argument for `\linefeed`.
80
81 ```latex
82 \begin{verse}
83 \shareline{A path of dust and dreams beneath the sun,}\\
84 \linefeed{a journey to a star.}\\
85 \end{verse}
86 ```
87
88 #### Speaker Prompts on a Separate Line
89
90 Regular lines can come between a `\shareline` and its continuing `\linefeed`s.
91 Therefore one can do:
92
93 ```latex
94 \begin{verse}
95 HORATIO:
96
97 \shareline{Tush, tush, 'twill not appear.}
98
99 BARNARDO:
100
101 \linefeed{Sit down awhile,}\\
102 And let us once again assail your ears,\\
103 That are so fortified against our story,\\
104 What we have two nights seen.
105 \end{verse}
106 ```
107
108 ## License
109
110 This work is distributed under the [LaTeX Project Public License (LPPL)](http://www.latex-project.org/lppl.txt), version 1.3c or later.
111
112 ## Contributing & Issues
113
114 Found a bug or have a suggestion for improvement? Please open an issue on the GitHub repository.