Lista dentro do orçamento personalizado

Lista dentro do orçamento personalizado

Eu gostaria de criar um ambiente de lista customizado que funcione tanto no texto principal quanto na minha própria citação (no meu caso, o ambiente que eu chamo dialogue( list) está dentro do ambiente que eu chamo myquotation( trivlist)). Mas tenho problemas para obter os recuos esperados. Meu exemplo de trabalho:

\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}

insira a descrição da imagem aqui

Para mim o mais importante é remover o recuo do primeiro item da minha cotação. Inicialmente considerei a incorporação de linha \mbox{}\vspace{-\baselineskip}em minha definição de lista (chamada aqui dialogue), mas no caso de espaços flutuantes entre itens e espaçamentos verticais flutuantes ao redor da lista isso não funciona corretamente.

Como mover automaticamente os seguintes itens da lista para as posições sem limite de texto recuado (conforme apontado pelas setas verdes na imagem)?

Responder1

O recuo defeituoso vem do errado \setlength\itemindent{\parindent}em sua lista de perguntas e respostas. Além disso, se você quiser que o seu ambiente de diálogo mude dependendo do nível, é melhor que o ambiente externo também seja uma lista.

Não tenho ideia de quais espaços verticais você deseja, então removi todos eles. No longo prazo é melhor e mais fácil definir tais listas com o pacote 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}

insira a descrição da imagem aqui

informação relacionada