Lista dentro de la cotización personalizada

Lista dentro de la cotización personalizada

Me gustaría crear un entorno de lista personalizado que funcione tanto en el texto principal como en mi propia cita (en mi caso, el entorno al que llamo dialogue( list) está dentro del entorno al que llamo myquotation( trivlist)). Pero tengo problemas para obtener las sangrías esperadas. Mi ejemplo de trabajo:

\documentclass{article}
\usepackage[paperwidth=12cm,paperheight=11cm]{geometry}
\usepackage{ifthen}

% quotes
\newenvironment{myquotation}
    {\begin{trivlist}
        \ifthenelse{\isodd{1}}
                   {\setlength\leftskip{6.5mm} \setlength\rightskip{0mm}}
                   {\setlength\leftskip{0mm} \setlength\rightskip{6.5mm}}
        \setlength\itemindent{\parindent}
        \item\relax \slshape}
    {\end{trivlist}}

% dialogues
\newcommand{\entrylabel}[1]{
    \ifthenelse{\equal{}{#1}}{
        \hfill\mbox{\small{\textsc{--}}}
    }{
        \mbox{\small{\textsc{#1:}}}
    }
}
\newenvironment{dialogue}{\list{}{\renewcommand{\makelabel}{\entrylabel}
                                  \itemsep=0cm \topsep=0cm \parsep=0cm
                                  \listparindent=0em}
                         }{\endlist}

\begin{document}
Dialogue inside the quotation (unwanted indentation of the first item):
\begin{myquotation}
    \begin{dialogue}
    \item[Cookiemonster] Om, om, om...
    \item[Roadrunner] Beep, beep, beep...
    \item[Reksio] Hau, hau, hau...
    \end{dialogue}

    Some text inside the quotation following short customized dialogue.
\end{myquotation}

Dialogue inside the quotation (solution that doesn't work by flexible
vertical distances between list items):
\begin{myquotation}
    \mbox{}\vspace{-\baselineskip}
    \begin{dialogue}
    \item[Cookiemonster] Om, om, om...
    \item[Roadrunner] Beep, beep, beep...
    \item[Reksio] Hau, hau, hau...
    \end{dialogue}
\end{myquotation}

Dialogue outside the quotation:
\begin{dialogue}
\item[Cookiemonster] Om, om, om...
\item[Roadrunner] Beep, beep, beep...
\item[Reksio] Hau, hau, hau...
\end{dialogue}
\end{document}

ingrese la descripción de la imagen aquí

Para mí, lo más importante es eliminar la sangría del primer elemento dentro de mi cita. Inicialmente consideré la incorporación de una línea\mbox{}\vspace{-\baselineskip} en la definición de mi lista (llamada aquí dialogue), pero en el caso de espacios flotantes entre elementos y espacios verticales flotantes alrededor de la lista, no funciona correctamente.

¿Cómo mover automáticamente los siguientes elementos de la lista a las posiciones sin límite de texto sangrado (como lo señalan las flechas verdes en la imagen)?

Respuesta1

La sangría defectuosa se debe a un error \setlength\itemindent{\parindent}en su trivlist. Además, si desea que su entorno de diálogo cambie según el nivel, es mejor si el entorno exterior también es una lista.

No tengo idea de qué espacios verticales quieres, así que los eliminé todos. A la larga, es mejor y más fácil definir dichas listas con el paquete enumitem.

 \documentclass{article}
\usepackage[paperwidth=12cm,paperheight=11cm]{geometry}
\usepackage{ifthen}

% quotes

\newenvironment{myquotation}
    {\list{}{%
        \ifthenelse{\isodd{1}}
                   {\setlength\leftmargin{\parindent} \setlength\rightmargin{0mm}}
                   {\setlength\leftmargin{0mm} \setlength\rightmargin{6.5mm}}%
        \topsep=0cm \parsep=0cm \partopsep=0pt   \listparindent=0em
        }
        \item\relax \slshape
    }%
    {\endlist}

% dialogues
\newcommand{\entrylabel}[1]{%
    \ifthenelse{\equal{}{#1}}{%
        \hfill\mbox{\small{\textsc{--}}}%
    }{%
     \hspace\labelsep   \mbox{\small{\textsc{#1:}}}%
    }
}
\newenvironment{dialogue}{\list{}{\renewcommand{\makelabel}{\entrylabel}%
                                  \labelwidth0cm \itemindent-\leftmargin
                                  \topsep=0cm \parsep=0cm
                                  \partopsep=0pt
                                  \listparindent=0em
                                  }}{\endlist}

\begin{document}
Dialogue inside the quotation (unwanted indentation of the first item):

 \begin{myquotation}
 blblbl 
 \end{myquotation}


\begin{myquotation}
    \begin{dialogue}
    \item[Cookiemonster] Om, om, om...
    \item[Roadrunner] Beep, beep, beep...
    \item[Reksio] Hau, hau, hau...
    \item blbu
    \end{dialogue}

    Some text inside the quotation following short customized dialogue.
\end{myquotation}

Dialogue inside the quotation (solution that doesn't work by flexible
vertical distances between list items):
\begin{myquotation}
    \begin{dialogue}
    \item[Cookiemonster] Om, om, om...
    \item[Roadrunner] Beep, beep, beep...
    \item[Reksio] Hau, hau, hau...
    \end{dialogue}
\end{myquotation}

Dialogue outside the quotation:
\begin{dialogue}
\item[Cookiemonster] Om, om, om...
\item[Roadrunner] Beep, beep, beep...
\item[Reksio] Hau, hau, hau...
\end{dialogue}
\end{document}

ingrese la descripción de la imagen aquí

información relacionada