I am using this answer to produce a transcript. I would like to increment each time I present a speaker, ie Speaker01_01, Speaker02_01, Speaker01_02, Speaker02_02 and so on. Presumably I would use some kind of counter, but cannot see how to adapt the code. The MWE is from the previous answer, rather than my own workings.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{xparse}
\usepackage{enumitem}
\setlist[description]{
font={\sffamily\bfseries},
labelsep=0pt,
labelwidth=\transcriptlen,
leftmargin=\transcriptlen,
}
\newlength{\transcriptlen}
\NewDocumentCommand {\setspeaker} { mo } {%
\IfNoValueTF{#2}
{\expandafter\newcommand\csname#1\endcsname{\item[#1:]}}%
{\expandafter\newcommand\csname#1\endcsname{\item[#2:]}}%
\IfNoValueTF{#2}
{\settowidth{\transcriptlen}{#1}}%
{\settowidth{\transcriptlen}{#2}}%
}
% Easiest to put the longest name last...
\setspeaker{Bob}
\setspeaker{Billy}[Billy Bob]
\setspeaker{xxx}[Xavier Xanadu III]
% How much of a gap between speakers and text?
\addtolength{\transcriptlen}{1em}%
\begin{document}
\begin{description}
\Bob I'm looking for a package to help with the layout of an
interview transcript are there any good packages to do such a
task. If possible could you provide a minimum working example?
\Billy I'm looking for a package to help with the layout of an
interview transcript are there any good packages to do such a
task. If possible could you provide a minimum working example?
\xxx Perhaps something that aligns the names to the text, and uses a
columnar layout for the people vs what they said.
\end{description}
\end{document}
This is what I'm trying to achieve:
Speaker01_01: Blah Blah Blah
Speaker02_01: Blah Blah Blah
Speaker01_02: Blah Blah Blah
Speaker02_02: Blah Blah Blah
So: {speakername}{appendnumber}: {words spoken}
Using the answer, I'm getting an extraneous space at 10.



\setspeaker{Joey}and then\Joeyshould expand toSpeaker01:? – Skillmon May 15 '19 at 07:44