3

In a work, I have to write a lot of dialogue.

This is my MWE:

\documentclass{article}

\newenvironment{dialogue}{%
\noindent%
\newcommand\one[1]{\textit{##1}\newline}%
\newcommand\two[1]{\textbf{##1}\newline}%
\newcommand\NormalText[1]{##1\newline}%
}{}

\begin{document}

\begin{dialogue}%
\one{bla-bla}
\two{bla-bla}
\one{bla-bla}
\one{bla-bla}
\NormalText{Normal text}
\two{bla-bla}
\end{dialogue}

\end{document}

This code does exactly what I want... but I ask if it is possible to mimic the enumerate environment like this :

\begin{dialogue}%
\one bla-bla
\two bla-bla
\one bla-bla
\one bla-bla
\NormalText Normal text
\two bla-bla
\end{dialogue}
3

Sure it is!

\documentclass{article}

\newenvironment{dialogue}{%
  \par\setlength{\parindent}{0pt}%
  \newcommand\one{\par\normalfont\itshape}%
  \newcommand\two{\par\normalfont\bfseries}%
  \newcommand\NormalText{\par\normalfont}%
}{\par}

\begin{document}

\begin{dialogue}
\one bla-bla
\two bla-bla
\one bla-bla
\one bla-bla
\NormalText Normal text
\two bla-bla
\end{dialogue}

\end{document}

enter image description here

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.