4

I'm new to LaTeX, I've found all I needed on the internet, but I've stumbled upon a very specific problem that will require better understanding of templating. I've got a dialogue :

\begin{dialogue}
    \speak{Marie} A pizza !
    \speak{Marine} With what ?
\end{dialogue}

The result would be:

Marie: A pizza !

Marine: With what ?

That would be perfect in English but I'm writing in French and I would need a space between the name and the colon. Like this :

Marie : A pizza !

Marine : With what ?

How can I achieve that ? I realize there's some templating to do but I don't find anything clear to get started.

2 Answers 2

8

The package has a command for the label:

\documentclass{article}

\usepackage{dialogue}


\renewcommand*\DialogueLabel[1]{%
  \scshape\lowercase{#1} :\hfil
}

\begin{document}
%
\begin{dialogue}
    \speak{Marie} A pizza !
    \speak{Marine} With what ?
\end{dialogue}
\end{document}
0
2

Define \DialogueLabel to use the “active” version of the colon.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

\usepackage{dialogue}

\renewcommand*\DialogueLabel[1]{%
  \scshape\MakeLowercase{#1}\DialogueSep\hfil
}

\begingroup\lccode`~=`:
\lowercase{\endgroup\def\DialogueSep{~}}

\begin{document}

\begin{dialogue}
\speak{Marie} Une pizza !
\speak{Marine} Avec quoi ?
\speak{Marie} Oignons!
\end{dialogue}

\end{document}

Note that I also used \MakeLowercase because of the fact that otherwise accented characters could be misinterpreted by \MakeLowercase.

Note also that the space before !, : or ? is optional.

enter image description here

2
  • That works too, thanks ! I'm happy you used my question to show how much you love oignon ;) I need to read more abour LaTeX, because I have no idea how you managed to know there's a DialogueLabel command that you can modify, and all the parameters you can change. Merci en tout cas :)
    – hinsano
    Jun 5, 2015 at 18:55
  • @adigau I must admit having read David's answer before giving (as usual) a better solution.
    – egreg
    Jun 5, 2015 at 19:41

You must log in to answer this question.

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