2

Good morning everyone! Still for my theater script template, I created the \move command for captions, but I can't set the carriage return (see figure). However, the text must keep in line with the rest. Is this possible? Thank you very much.

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}

\newcommand\move{\par\vskip0mm \noindent\makebox[35mm][l]{}\hangindent=35mm\textsl}

\def\declname#1#2{%
\def#1{\vskip5mm \noindent\hbox to35mm{#2\hss}\hangindent=35mm \ignorespaces}}
\declname \JAMES {JAMES}

\begin{document}

\JAMES
Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor.
\move{(Duis autem vel eum iriure dolor in hendrerit.)}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
\move{(Ut wisi enim ad minim veniam, quis nostrud exercitation ullamcorper)}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor.

\end{document}

enter image description here

6
  • 3
    presumably you want \par at the end of your \move definition, but why is this all defined using primitves such as \vskip, \hangindent, rather than a latex list? Commented Nov 24, 2022 at 14:40
  • Besides doing it on your own: Did you have a look at the drama topic at ctan ctan.org/topic/drama-script ?
    – MS-SPO
    Commented Nov 24, 2022 at 14:44
  • 1
    Using your current approach, you can extend move command to: \newcommand\move[1]{\par\vskip0mm\noindent\makebox[35mm][l]{}\hangindent=35mm\textsl{#1}\par\noindent\makebox[35mm][l]{}\hangindent=35mm}.
    – dexteritas
    Commented Nov 24, 2022 at 14:46
  • 3
    This is one of the very few situations where using a double backslash \\ to end a line is appropriate. Redefining the carriage return can be dangerous, and is not a good idea. Commented Nov 24, 2022 at 15:44
  • @barbarabeeton only if \move[aaa} is always followed by more text, just using \par (without a following \noindent as in the previous comment)is preferable. Commented Nov 24, 2022 at 18:29

2 Answers 2

1

I'd add structure to the thing. For instance, the various lengths should be parameters, so you can easily change them for experiments in a centralized fashion.

Another suggestion is to make the theater script part an environment, so you can add parts typeset in a different style.

I also propose a simpler way to declare names: without an optional argument, the name is taken to be also the command name, but you can decide for a different command name by adding the optional argument (see the example).

Sorry for changing \textsl into \textit, but I find slanted type really awful. Also, the outer parentheses should be part of the command definition and upright (but that's my taste).

\documentclass[a4paper,12pt]{article}

\newenvironment{script}
 {%
  \par
  \setlength{\parindent}{0pt}
  \setlength{\leftskip}{\scriptleftmargin}
 }
 {\par}

\newcommand{\namebox}[1]{%
  \makebox[0pt][r]{%
    \makebox[\scriptleftmargin][l]{#1}%
  }%
}

\NewDocumentCommand{\declname}{O{#2}m}{%
  \ExpandArgs{c}\newcommand{#1}{%
    \par\addvspace{\nameskip}%
    \namebox{#2}%
  }%
}

\newcommand\move[1]{\par(\textit{#1})\par}

\newlength{\scriptleftmargin}
\newlength{\nameskip}

\setlength{\scriptleftmargin}{35mm}
\setlength{\nameskip}{5mm}

\declname{JAMES}
\declname[OOC]{ÖÖÇ}

\begin{document}

\begin{script}

\JAMES
Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor.
\move{Duis autem vel eum iriure dolor in hendrerit.}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy 
nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
\move{Ut wisi enim ad minim veniam, quis nostrud exercitation ullamcorper}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor.

\OOC
Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor.

\end{script}

\end{document}

enter image description here

Why not \hangindent? Because it's reset at every paragraph. It would be possible to set it again, but it's simpler to use \leftskip.

1
1

I think you just want a slanted paragraph, with suitable margin.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}

\setlength\parindent{0pt}
\setlength\leftskip{35mm}% really should be a list

\newcommand\move[1]{%
\par\textsl{#1}\par}

\newcommand\declname[2]{%
\def#1{%
\par\vspace{5mm}%
\noindent\hspace{-35mm}\makebox[35mm][l]{#2}}}

\declname \JAMES {JAMES}

\begin{document}

\JAMES
Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor.
\move{(Duis autem vel eum iriure dolor in hendrerit.)}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
\move{(Ut wisi enim ad minim veniam, quis nostrud exercitation ullamcorper)}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor.

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .