I suspect that there is a better way I could be doing some of these things, so I am looking to you all for some guidance on how I can make this better. Based on the example given here, I created a dialogue environment so that I could mimic parts of a conversation between two individuals and this works okay for the most part. However, I need to both restrain the dialog within the existing page margins (hence the \leftmargin=*) and, ideally, indent the entire part of the response (so not the person) evenly across all of the instances. I suspect that my current implementation is causing some of my problems, but I am not sure how to best convert this to a standard \begin{enumerate} ... \end{enumerate} type of environment.
Here is a MWE:
\documentclass{article}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{lipsum}
\DeclareDocumentCommand\dia{ o m }{%
\begin{enumerate}[%
,label=\IfNoValueTF {#1} {}{#1:}
,labelsep=8mm
,nosep % optional
,font=\color{black}
,leftmargin=*
,listparindent=0pt
%,labelindent=0.5in
]
\item #2
\end{enumerate}%
}
\begin{document}
\dia[Name #1]{\quad\lipsum[1-1]}
\dia{\quad\lipsum[4-4]}
\dia[Much Longer Name #2]{\quad\lipsum[2-2]}
\dia{\quad \lipsum[3-3]}
\end{document}
The output looks like:
I want all of the responses aligned based on the longest line identifier, essentially a two-column sort of format? I am a little lost on where to go with this one and will very much appreciate any help you may be able to offer. This only seems to compile error-free with XeLaTeX (which I am pretty committed to), but I am unsure why that might be.
Edited:
To be more clear about what I want, this is a mockup from Word of what I am trying to accomplish:
Edit #2:
On user suggestion, I attempted to manipulate this into a tabular environment, but many of my paragraphs exceed the length of a standard page and overflow into the footer and beyond. While it is principally possible to manually \parfillskip=0pt and \ to these, I would strongly prefer to maintain the intended quotation format, as these are directly quoted from other text and I would prefer to not introduce false (and often non-sensical) new lines. I am open to continuing with a tabular environment or some other option, but it seems like some modification of enumerate is going to be necessary for these page breaks.
Edit #3: Based on the information provided here, I managed to solve my issue by setting the width of the label to the width of the longest label manually and then everything aligns properly. Enumitem: Right align the label. I think it would still be interesting if there is a way to make a custom environment that finds the widest label (sort of like the eqlist package) dynamically, but I am satisfied with my own solution for now.


