LaTeX Question

Continuing this week’s trend of computer-related posts, I have a question for any LaTeX users out there:

How do I break a line such that the line that follows it begins at the point where the break occurs rather than beginning at the side of the text margin? I’m thinking here very specifically of character changes in dialogue written in verse. Something along the lines of:

                  Francisco
Give you good night.
                  Marcellus
                    Holla! Bernardo!
                  Bernardo
                                    Say,--

Hamlet I. I

I suppose that that doesn’t exactly fit what I was wanting because of the character names. So let me pose the question a different way: Consider the piece from Hamlet I quoted; how would I format do that with LaTeX?.

This entry was posted in Site and Admin Stuff. Bookmark the permalink.

8 Responses to LaTeX Question

  1. There’s a document class called stage.cls that will do all kinds of screenplay-related formatting. I took a quick look at it, and the macro in it for dialogue is pretty simple. You can put the following in your preamble, and then use it to format dialogue later:

    \usepackage{doublespace,fancyhdr,extramarks}
    \newcommand{\dialog}[2]{%
    	\doublespace%
    	\hskip 2.5in\textsc{#1}\par%
    	\nobreak
    	\extramarks{}{}
    	\nobreak
    	#2
    	\extramarks{\textsc{#1}(Continued)}{}
    }
    

    Then, when you want to format for dialogue, you would do:

    \dialog{Francisco}{Give you good night.}
    \dialog{Marcellus}{Holla! Bernardo!}
    

    That will format to

                FRANCISCO
    Give you good night.
                MARCELLUS
    Holla! Bernardo!
    

    It gets a little bit off-kilter when you break lines with “” to write verse, but I think that can be fixed with a little tinkering. Before descending further into uninhibited nerd-dom, I’ll stop at this point.

  2. Dylan says:

    Another possibility (garnered from a posting to the newsgroup comp.text.tex) is Paul Wilson’s “memoir” class. It’s a quite comprehensive package for formatting booklets, and among other things has commands for the line breaking as you asked for, using the ‘vinphantom’ command. You can get it from CTAN at http://www.ctan.org/getfile/?filename=macros/latex/contrib/memoir/&action=/getfile/

  3. Raznor says:

    I dunno. I profess to love LaTeX, but the way I do stuff like that is buy Leslie Lampaport’s LaTeX guide and look stuff up when I don’t know what to do.

    Possibly, though, you could use the quotation environement. Like do what Alan suggested with a:

    \dialog{Francisco}{Give you a good night.}
    \dialog{Marcellus}{
    \begin{quote}
    Holla! Bernadino!
    \end{quote}}
    \dialog{Francisco}{
    \begin{quote}
    \begin{quote}
    Say,–
    \end{quote}
    \end{quote}}

    That might do it, but don’t forget all those curly brackets.

  4. Noah Snyder says:

    I write poor LaTeX, but the simplest hack to do that quickly is to just use some sort of table environment and put each of those in a different column. Probably sucky in the long run if you need to do this for a whole play, but for one quote it’d work fine.

  5. dch says:

    I think the simplest way of doing this–without installing any new packages–would be to put

    \phantom{Give you good night.}

    at the beginning of Marcellus’s line; this will insert exactly the amount of horizontal space taken up by those words.

  6. acm says:

    I think dch has the best idea. alternately, I think you’d have to measure the distance and insert a horizontal space to indent each new piece of text, as in

    \hspace{2.5in}Holla! Bernardo!
    \hspace{3.5in} Say, —

    but the phantom text method involves less manual measuring, and is robust to changes of overall formatting (say, font size), so that’s your best bet. and you can just copy and paste. :)

  7. dch: Right on! I’ve never seen phantom before. It makes me look awfully verbose. Now that you mention it, I finally understand exactly what PDP was looking for — as a general education question, is that a standard verse presentation style? I looked at a handful of sources, and didn’t see it, so I went all “try stage.cls” on everybody.

  8. Eric says:

    I had no idea you used latex.

Comments are closed.