1

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:

Output of MWE

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:

Desired result

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.

  • I think you want a tabular environment – corvus_192 Nov 28 '22 at 20:23
  • @corvus_192 I think you're right that converting to a tabular environment is going to be best. When I get that worked out, I'll update with my solution. I wanted this dialogue environment to work, but I am afraid I am asking too much of it and tabular environments have all of these features built in. – jaredbrewer Nov 28 '22 at 21:01
  • @corvus_192 Okay, so I got the tabular environment working, but some of my paragraphs are in excess of the length of the page and overflow. I gather that it is difficult to introduce within-cell page breaks, so I am unsure how to proceed on this direction. – jaredbrewer Nov 28 '22 at 21:11

1 Answers1

0

What about desclist?


mwe


\documentclass[]{article}
\usepackage{desclist}
\newcounter{dianum}
\setcounter{dianum}{-1}
\usepackage{lipsum}
\begin{document}
\begin{desclist}{\sffamily}{\ \addtocounter{dianum}{1}(\arabic{dianum}):}[maxlabelwidth......]\itemsep2em\itemindent0em\parindent1em
\item[Peter] \lipsum[1][1-5] \par \lipsum[2][1-5] 
\item[Bartholomew] \lipsum[3][1-5] \par \lipsum[4][1-5] 
\item[Peter] \lipsum[5][1-5] \par \lipsum[2][1-9] 
\item[Bartholomew] \lipsum[7-9] 
\item[Bartholomew] \lipsum[10-11] 
\end{desclist}
\end{document}
Fran
  • 80,769