我正在尝试使用dramatist
包。我很难弄清楚如何更改某些设置。我想确保角色所说的文本是对齐的,而不是他们的名字是对齐的。
我希望单词Well
、Start
和I
左对齐,字符名称右对齐。下面是tex
我用来制作此演示的 示例:
\documentclass[a5paper,11pt]{memoir}
\usepackage{dramatist}
\begin{document}
\Character[Wilheim - a person]{Wilheim}{will} % define characters
\Character[Frederico - a person]{Frederico}{fred}
\scene[]
\StageDir{
\begin{center} Darkness
\end{center}
}
\begin{drama}
\willspeaks Well, will we - I\dots
\fredspeaks Start.
\willspeaks I will go on.
\willspeaks Vivamus varius tellus et mi pretium elementum iaculis tellus semper. Donec semper iaculis ante, convallis convallis arcu laoreet vitae. Aliquam id leo ac eros ultrices rhoncus porta sed ipsum.
\end{drama}
\end{document}
我希望我的文档看起来如下所示(我使用该verbatim
包准备的),并且适用于多行句子:
我从 TeX.SE 获得了一些关于开始使用该dramatist
软件包的有用建议这里。
答案1
您需要对 的内部命令进行一些修改dramatist
;最简单的方法是使用etoolbox
和enumitem
:
\documentclass[a5paper,11pt]{memoir}
\usepackage{dramatist,etoolbox,enumitem}
\usepackage[latin]{babel}
\pagestyle{empty}
\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[Wilheim - a person]{Wilheim}{will} % define characters
\Character[Frederico - a person]{Frederico}{fred}
\settowidth{\speakswidth}{\speaksfont{Frederico}\speaksdel\hspace{\speechskip}}
\scene[]
\StageDir{
\begin{center} Darkness
\end{center}
}
\begin{drama}
\willspeaks Vivamus varius tellus et mi pretium elementum iaculis tellus semper. Donec semper iaculis ante,
convallis convallis arcu laoreet vitae. Aliquam id leo ac eros ultrices rhoncus porta sed ipsum.
\fredspeaks Vivamus varius tellus et mi pretium elementum iaculis tellus semper. Donec semper iaculis ante,
convallis convallis arcu laoreet vitae. Aliquam id leo ac eros ultrices rhoncus porta sed ipsum.
\willspeaks Vivamus varius tellus et mi pretium elementum iaculis tellus semper. Donec semper iaculis ante,
convallis convallis arcu laoreet vitae. Aliquam id leo ac eros ultrices rhoncus porta sed ipsum.
\end{drama}
\end{document}
的设置\speakswidth
最好是在介绍完所有角色之后进行,这样才能选择最广泛的角色。
答案2
编辑:我错过了关于右对齐的细节。但除此之外
\speakswidth
并且\speaksindent
是这里的关键部分(剧作家文献第 2.2 节)。
简易版本,添加任意数量的空间以容纳发言人标签:
\setlength{\speakswidth}{1in}
\setlength{\speaksindent}{0.5in}
更复杂的版本使用计算包自动计算所需空间,并保持其他边距和长度一致。在下面的脚本中使用最长的字符名称\setlength
:
\setlength{\speakswidth}{\widthof{\speaksfont Frederico}}
\addtolength{\speakswidth}{\Dlabelsep}
\addtolength{\speaksindent}{\speakswidth}
完整版本:
\documentclass[a5paper,11pt]{memoir}
\usepackage{dramatist}
\usepackage{calc}
\begin{document}
\Character[Wilheim - a person]{Wilheim}{will}
\Character[Frederico - a person]{Frederico}{fred}
\setlength{\speakswidth}{\widthof{\speaksfont Frederico}}
\addtolength{\speakswidth}{\Dlabelsep}
\addtolength{\speaksindent}{\speakswidth}
\scene[]
\StageDir{
\begin{center} Darkness
\end{center}
}
\begin{drama}
\willspeaks Well, will we - I\dots
\fredspeaks Start.
\willspeaks I will go on.
\end{drama}
\end{document}