2

Good morning. I'd like to align the characters on the red line and the dialogue on the blue line. On the blue line also the subject of scene command. Is that possible? Thank you.

\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[italian]{babel}
\usepackage[noheadfoot, margin=2cm, nomarginpar]{geometry}
\usepackage{textcase}
\usepackage[explicit]{titlesec}

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

\newlength{\postspeciskip}
\postspeciskip = 1.5\baselineskip

\newcommand\sce[1]{\newpage{\LARGE\raggedright #1\par\vskip 24pt}}

\newcommand\character[1]{\par\everypar{\hangindent=0.253\linewidth\hangafter=1}\parskip=0.8\baselineskip plus 1pt\makebox[0.253\linewidth][r]{\MakeTextUppercase{#1}\hskip0.1\linewidth}}

\setlength\parindent {0pt}%

\interlinepenalty = 1000\parskip0pt plus \baselineskip

\begin{document}

\raggedright

\def\mark{\character{Mark}}
\def\karm{\character{Karm}}

\sce{Scene 1 Number one}

\mark Lorem ipsum dolor sit amet, consectetueradipiscing elit. Ut purus elit, vestibulum ut,placerat ac, adipiscing vitae, felis. Curabiturdictum gravida mauris.

\karm Lorem ipsum dolor sit amet, consectetueradipiscing elit. Ut purus elit, vestibulum ut,placerat ac, adipiscing vitae, felis. Curabiturdictum gravida mauris.

\end{document} 

enter image description here

1

The \sce command needs two arguments, if you want two parts of it. I'd simply state a fixed \leftskip, rather than using \hangindent: it's easier to set something in the margin than almost everything far from it.

\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[italian]{babel}
\usepackage[noheadfoot, margin=2cm, nomarginpar]{geometry}
\usepackage{textcase}
%\usepackage[explicit]{titlesec}

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

\newlength{\postspeciskip}
\newlength{\standardindent}
\AtBeginDocument{%
  \setlength{\postspeciskip}{1.5\baselineskip}%
  \setlength{\standardindent}{0.253\textwidth}%
  \setlength{\leftskip}{\standardindent}%
}

\newcommand\sce[2]{%
  %\clearpage % commented just for the example
  \setlength{\parskip}{0pt plus \baselineskip}
  {\LARGE\toleft{Scene #1}#2\par}
  \nopagebreak
  \addvspace{24pt}%
}
\newcommand{\toleft}[1]{\makebox[0pt][r]{\makebox[\standardindent][l]{#1}}}

\newcommand\character[1]{%
  \par
  \setlength{\parskip}{0.8\baselineskip plus 1pt}%
  \toleft{\MakeTextUppercase{#1}}%
}

\setlength\parindent{0pt}

\interlinepenalty = 1000
\setlength{\parskip}{0pt plus \baselineskip}
\raggedright

\begin{document}


\newcommand{\Mark}{\character{Mark}}
\newcommand{\Karm}{\character{Karm}}

\sce{1}{Number one}

\Mark Lorem ipsum dolor sit amet, consectetueradipiscing elit. Ut purus elit, 
      vestibulum ut,placerat ac, adipiscing vitae, felis. Curabiturdictum 
      gravida mauris.

      Lorem ipsum dolor sit amet, consectetueradipiscing elit. Ut purus elit, 
      vestibulum ut,placerat ac, adipiscing vitae, felis. Curabiturdictum 
      gravida mauris.

\Karm Lorem ipsum dolor sit amet, consectetueradipiscing elit. Ut purus elit, 
      vestibulum ut,placerat ac, adipiscing vitae, felis. Curabiturdictum 
      gravida mauris.

\sce{1}{Number two}

\Mark Lorem ipsum dolor sit amet, consectetueradipiscing elit. Ut purus elit, 
      vestibulum ut,placerat ac, adipiscing vitae, felis. Curabiturdictum 
      gravida mauris.

\Karm Lorem ipsum dolor sit amet, consectetueradipiscing elit. Ut purus elit, 
      vestibulum ut,placerat ac, adipiscing vitae, felis. Curabiturdictum 
      gravida mauris.

\end{document} 

For the picture I commented out the \clearpage so to see two scenes in the same page.

Avoid \def: with \def\mark you're redefining an important primitive of TeX and if you try using page headers, you'd get very weird errors.

enter image description here

1
  • That's great! Wonderful! Thank you! – maxxfur Jun 29 '20 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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