Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've been writing scripts using the dramatist package and followed the guide on these forums to make the justification of the names and dialogue nice.

Justification when using the dramatist package

My problem is that when using the solution the stage directions within the drama environment are aligned with respect to the dialogue column of text and not the page. Stage directions outside of the drama environment are aligned to the page as expected.

 \documentclass[a4paper,12pt]{article}                  

 \usepackage{dramatist}
 \usepackage{etoolbox,enumitem}

 \makeatletter
 \renewenvironment{drama}
   {\if@lnpa
   \PackageWarning{dramatist}{\lnpwarning{a}}
   \fi
   \if@lnps
   \PackageWarning{dramatist}{\lnpwarning{s}}
   \fi
   \begin{itemize}[labelwidth=\speakswidth,leftmargin=!]} 
  {\end{itemize}}
 \patchcmd{\speaker}{\item[#1\speaksdel]}{\item[\speaksfont#1]}{}{}
 \patchcmd{\@character}{\item[#1\speaksdel]}{\item[\speaksfont#1]}{}{}
 \makeatother

 \begin{document}
 \Character[The milkman]{Milkman}{milk}
 \settowidth{\speakswidth}{\speaksfont{Milkman}\speaksdel\hspace{\speechskip}}
 \Scene{Milkman Arrives}
 \StageDir{\begin{center}Some stage directions.\end{center}}
 \begin{drama}
 \milkspeaks{Some text. Some text. Some text. Some text. Some text. Some text. Some text.}
 \StageDir{\begin{center}Some more stage directions.\end{center}}
 \end{drama}
 \end{document}

enter image description here

Is there a way to fix this?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

This is actually a "feature" of the dramatist package. The usual definition of \StageDir is equivalent to

\newcommand{\StageDir}[1]{\begin{quote}\em #1\end{quote}}

so it inherits the left margin produced by the drama environment (which is implemented as a list environment), so its horizontal placement will always be slightly to the right of the dialogue line start. With center the centering will be with respect to the dialogue lines.

A way to solve the problem might be to set the stage directions flush right:

\renewcommand{\StageDir[1]{\begin{flushright}\em #1\end{flushright}}

(but an initial \StageDir must go before \begin{drama}). Centering can be obtained with this trick:

\renewcommand\StageDir[1]{%
  \par\addvspace{\topsep}
  \centerline{\em #1}
  \addvspace{\topsep}}

If you want centered multiline stage directions, then

\renewcommand\StageDir[1]{%
  \par\addvspace{\topsep}
  \centerline{%
    \begin{minipage}{\dimexpr\textwidth-2\leftmargini\relax}
    \centering\em\strut#1\strut\end{minipage}}
  \addvspace{\topsep}}

should do.

share|improve this answer
    
The trick is working really well except the margins are no longer defined like the quote environment (it just uses the page margins). How can I reintroduce the wider margins for the stage directions? –  Darling Feb 21 '12 at 22:37
    
Are you meaning that you want multiline stage directions? –  egreg Feb 21 '12 at 22:48
    
Yes, the quote environment increased the margins so when a stage direction went over more than one line it looked tidy. –  Darling Feb 21 '12 at 22:55
    
Thanks for your help. It is looking great now. :) –  Darling Feb 21 '12 at 23:54

I modified egreg's answer slightly to get my stage directions flush with the character names using this:

\renewcommand\StageDir[1]{%
  \par\addvspace{\topsep}
  \centerline{%
    \begin{minipage}{\dimexpr\textwidth\leftmargini\relax}
    \em\strut#1\strut\end{minipage}}
  \addvspace{\topsep}}
\begin{document}
share|improve this answer
    
Welcome to TeX.sx! –  Kurt Oct 19 '12 at 21:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.