I'm working on a LaTex Class for script-writing. I've come into a problem when declaring a Dialog environment.

\ProvidesClass{exampleclass}[2014/08/16 Example LaTeX class]

 % needed for its \numberwithin command


\newenvironment{panel}{%      define a custom environment
    \bigskip\noindent%         create a vertical offset to previous material
    \refstepcounter{panelctr}% increment the environment's counter
    \textsc{Panel \thepanelctr}% or \textbf, \textit, ...
}{\par\bigskip}  %          create a vertical offset to following material



Below this line a boxed environment is used

\begin{boxed}{Title of the Box}
    This is the text formatted by the boxed environment

This text is again outside the environment

\section{First section}

Some text before the first algorithm environment \ldots

    Some thoughts
        Hello, This text is again outside the environment

        test dialog

    More thoughts


Currently the actual dialog doesn't seem to be centered while the characters name is centered. My idea formatting: enter image description here

It was also be great if there is a way to get the Parenthetical's to align either left or right to the center of the dialog

  • (1) Why are you reinventing the wheel? I'm sure the hexagonal design did well when you consulted the focus groups, but are you sure the tried and tested circular shape will not continue to sell better? (2) Never use \\ to break lines outside of special contexts (tabular, array etc.). (3) Please always post minimal, but complete, code we can copy-paste-compile. (4) Please upload your image in the editor rather than relying on an external link.
    – cfr
    Jun 14, 2017 at 0:59
  • I'd guess your code typesets the argument in bold on the right of the page, then typesets the contents of the environment normally, followed by a paragraph break, possibly putting space above and below.
    – cfr
    Jun 14, 2017 at 1:04
  • Thanks for the reply. I'm not sure what you mean by circular shape. What should be used instead of double slashes for break?
    – Dubb
    Jun 14, 2017 at 1:26
  • Didn't realize I was re-inventing the wheel, I'm trying to minimize the commands needed for the actual Tex document.
    – Dubb
    Jun 14, 2017 at 1:32
  • Unrelated to what you are asking, but \documentclass{article} \usepackage{amsmath} inside a class file?!? In case you are requiring the amsmath package just to use the \numberwithin command, forget it and simply say \newcounter{panelctr}[section].
    – GuM
    Jun 14, 2017 at 2:02

1 Answer 1


Just use the screenplay document class. There are more packages and classes for this, see https://www.ctan.org/topic/drama-script


\begin{dialogue}[looking up]{Joe}
  And the position of the character's name?
  ALL CAPS, and tabbed to about 4.0 to 4.2 inches, depending upon the
  look you like. Some writers center al characters' name in
  dialogue. Personally, I don't think it matters too much.


enter image description here

  • Wow, I searched but didn't bother to search "screenplay". Thanks
    – Dubb
    Jun 14, 2017 at 3:51

You must log in to answer this question.

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