使用 LaTeX 编写戏剧剧本

使用 LaTeX 编写戏剧剧本

早上好。我从这次讨论中得到了启发。我更改了标题,因为它不再有意义了。

带有文本对齐的新命令

我想完善这个用于创建戏剧剧本的模板。问题:如果我想在命令后插入文本\scene,字体保持不变。是否有可能在每次命令后,字体都会像往常一样重置?谢谢。

\documentclass[a4paper,11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[italian]{babel}
\usepackage{textcase}
\usepackage{ragged2e}
\usepackage{alltt}

\usepackage[top=15mm, bottom=15mm, left=20mm, right=15mm]{geometry}

%spacing-definition
\newlength{\smllskip}\smllskip = 0.1\baselineskip %small
\newlength{\middskip}\middskip = 0.5\baselineskip %mid
\newlength{\biggskip}\biggskip = 1.5\baselineskip %big

%character
\newcommand\character[1]{\par\everypar{\hangindent=0.32\linewidth\hangafter=1}\vskip\middskip\parskip=0.5\baselineskip\fontsize{15pt}{16pt}\selectfont\makebox[0.32\linewidth][r]{\MakeTextUppercase{#1} \hskip0.1\linewidth}}

%description
\newcommand\did[1]{\everypar{\hangindent=0\linewidth\hangafter=0}\vskip\biggskip\parskip=0.5\baselineskip\fontsize{15pt}{16pt}\selectfont\raggedright\textup{#1}\vskip\biggskip}

%actions
\newcommand\azi[1]{\everypar{\hangindent=0.38\linewidth\hangafter=0}\vskip\smllskip\parskip=0.5\baselineskip\fontsize{15pt}{16pt}\selectfont\raggedright\textsl{#1}\vskip\smllskip}

%intro
\newcommand\intro[1]{\fontsize{15pt}{16pt}\selectfont\justify{#1}\vskip\biggskip}

%scene-header
\newcommand\scene[1]{\newpage\everypar{\hangindent=0\linewidth\hangafter=0}\parskip=0.5\baselineskip\fontsize{22pt}{24pt}\selectfont\raggedright{#1}\vskip\middskip}

%author-title-miscellaneus
\newcommand\aut[1]{\fontsize{15pt}{16pt}\selectfont\begin{center}#1\end{center}\vskip\biggskip}
\newcommand\tit[1]{\fontsize{28pt}{30pt}\selectfont\begin{center}#1\end{center}\vskip\biggskip}
\newcommand\sut[1]{\fontsize{15pt}{16pt}\selectfont\begin{center}#1\end{center}\vskip\smllskip}
\newcommand\ctr[1]{\fontsize{15pt}{16pt}\selectfont\begin{center}#1\end{center}}

\setlength\parindent {0pt}
\interlinepenalty=10000 \parskip0pt plus \baselineskip

\begin{document}

\aut{Author}
\tit{Title}
\sut{Sub-Title}
\newpage

\def\one{\character{One}}
\def\two{\character{Two}}

\scene{Story}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
\newpage

\scene{Scene 1 : Title scene.}

\did{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.}

\one
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

\azi{first action}

\two
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

\did{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.}

\ctr{E N D}

\end{document}

答案1

正如我在评论中所建议的那样,如何(重新)定义\scene这种方式

\newcommand\scene[1]{\newpage\everypar{\hangindent=0\linewidth\hangafter=0}%
\parskip=0.5\baselineskip\fontsize{22pt}{24pt}\selectfont\raggedright{#1}\vskip%
\middskip\fontsize{15pt}{16pt}\selectfont}

然后,退出时字体大小将重置为较小的尺寸\scene。后面的文本不需要用\did{}或任何其他技巧括起来,而可以直接输入,并将以较小的尺寸显示。

\documentclass[a4paper,11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[italian]{babel}
\usepackage{textcase}
\usepackage{ragged2e}
\usepackage{alltt}

\usepackage[top=15mm, bottom=15mm, left=20mm, right=15mm]{geometry}

%spacing-definition
\newlength{\smllskip}\smllskip = 0.1\baselineskip %small
\newlength{\middskip}\middskip = 0.5\baselineskip %mid
\newlength{\biggskip}\biggskip = 1.5\baselineskip %big

%character
\newcommand\character[1]{\par\everypar{\hangindent=0.32\linewidth\hangafter=1}\vskip\middskip\parskip=0.5\baselineskip\fontsize{15pt}{16pt}\selectfont\makebox[0.32\linewidth][r]{\MakeTextUppercase{#1} \hskip0.1\linewidth}}

%description
\newcommand\did[1]{\everypar{\hangindent=0\linewidth\hangafter=0}\vskip\biggskip\parskip=0.5\baselineskip\fontsize{15pt}{16pt}\selectfont\raggedright\textup{#1}\vskip\biggskip}

%actions
\newcommand\azi[1]{\everypar{\hangindent=0.38\linewidth\hangafter=0}\vskip\smllskip\parskip=0.5\baselineskip\fontsize{15pt}{16pt}\selectfont\raggedright\textsl{#1}\vskip\smllskip}

%intro
\newcommand\intro[1]{\fontsize{15pt}{16pt}\selectfont\justify{#1}\vskip\biggskip}

\newcommand\scene[1]{\newpage\everypar{\hangindent=0\linewidth\hangafter=0}%
\parskip=0.5\baselineskip\fontsize{22pt}{24pt}\selectfont\raggedright{#1}\vskip%
\middskip\fontsize{15pt}{16pt}\selectfont}

%author-title-miscellaneus
\newcommand\aut[1]{\fontsize{15pt}{16pt}\selectfont\begin{center}#1\end{center}\vskip\biggskip}
\newcommand\tit[1]{\fontsize{28pt}{30pt}\selectfont\begin{center}#1\end{center}\vskip\biggskip}
\newcommand\sut[1]{\fontsize{15pt}{16pt}\selectfont\begin{center}#1\end{center}\vskip\smllskip}
\newcommand\ctr[1]{\fontsize{15pt}{16pt}\selectfont\begin{center}#1\end{center}}

\setlength\parindent {0pt}
\interlinepenalty=10000 \parskip0pt plus \baselineskip

\begin{document}

\aut{Author}
\tit{Title}
\sut{Sub-Title}
\newpage

\def\one{\character{One}}
\def\two{\character{Two}}

\scene{Story}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
\newpage

\scene{Scene 1 : Title scene.}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

\one
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

\azi{first action}

\two
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

\did{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.}

\ctr{E N D}

\end{document}

在此处输入图片描述

答案2

早上好。我恢复了这个旧源文件。我尝试调整我的剧本,但出现了错误。(\hbox 过满)我该如何修复它?谢谢。

\documentclass[a4paper,11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[italian]{babel}
\usepackage{textcase}
\usepackage{ragged2e}
\usepackage{verse}
\usepackage{alltt}
\usepackage{array}

% layout page
\usepackage[top=15mm, bottom=20mm, left=20mm, right=15mm]{geometry}
%\pagestyle{empty}

\usepackage{nimbusmono}
\renewcommand*\familydefault{\ttdefault}

%def spaces
\newlength{\unoskip}\unoskip = 2mm
\newlength{\dueskip}\dueskip = 4mm
\newlength{\treskip}\treskip = 6mm

%characters
\newcommand\character[1]{\par\everypar{\hangindent=0.30\linewidth\hangafter=1}\vskip\dueskip\parskip=0.5\baselineskip\fontsize{13pt}{14pt}\selectfont\makebox[0.30\linewidth][r]{\MakeTextUppercase{#1} \hskip0.1\linewidth}}

%scenes
\newcommand\sce[1]{\newpage\everypar{\hangindent=0\linewidth\hangafter=0}\parskip=0.5\baselineskip\fontsize{16pt}{17pt}\selectfont\raggedright{#1}\vskip\unoskip\fontsize{13pt}{14pt}\selectfont}

\setlength\parindent {0pt}
\interlinepenalty=10000 \parskip0pt plus \baselineskip

\begin{document}


\def\John{\character{JOHN}}
\John
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

\def\Kelly{\character{KELLY}}
\Kelly
Lorem Ipsum is simply dummy text of the printing and typesetting industry.


%script

\sce{1.1 : Number One}

\did{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.}

\Kelly
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

\John
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

\Kelly
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

\end{document} 

相关内容