Como posso remover o espaço extra após `itemize` no moderncv?

Como posso remover o espaço extra após `itemize` no moderncv?

Em um moderncvdocumento, usar an itemizein a cvitemproduz espaçamento extra após a lista detalhada.

Aqui está um exemplo mínimo de trabalho:

\documentclass{moderncv}

\moderncvstyle{casual}
\moderncvcolor{green}

\name{John}{Smith}

\begin{document}
\makecvtitle

\section{List section}
\cvitem{Some category}{
    \begin{itemize}
        \item the first
        \item the second
        \item the third
    \end{itemize}
}
\cvitem{Another category}{
    \begin{itemize}
        \item number one
        \item number two
        \item number three
    \end{itemize}
}
\cvitem{text}{with a description}

More text.

\end{document}

Posso adicionar um \vspace{-1em}após cada um itemizepara remover o espaço, mas isso parece lutar contra o LaTeX em vez de adotá-lo. Existe uma configuração que posso alterar para remover o espaçamento extra aqui?

Responder1

Uma opção para definir o espaçamento de a cvitemjá é fornecida pela moderncvclasse:

\documentclass{moderncv}
\moderncvstyle{casual}
\moderncvcolor{green}

\name{John}{Smith}

\begin{document}
\makecvtitle

\section{List section}
\cvitem[-1.2em]{Some category}{           %new code
    \begin{itemize}
        \item the first
        \item the second
        \item the third
    \end{itemize}
}
\cvitem[-1.2em]{Another category}{       %new code  
    \begin{itemize}
        \item number one
        \item number two
        \item number three
    \end{itemize}
}
\cvitem{text}{with a description}

More text.
\end{document}

insira a descrição da imagem aqui

Veja o moderncv.clsarquivo:

% cria uma linha de currículo com um cabeçalho e um texto correspondente

% de uso: \cvitem[espaçamento]{cabeçalho}{texto}

Responder2

Use um minipage:

\documentclass{moderncv}

\moderncvstyle{casual}
\moderncvcolor{green}

\name{John}{Smith}

\begin{document}
\makecvtitle

\section{List section}
\cvitem{Some category}{%
   \begin{minipage}{\linewidth}
    \begin{itemize}
        \item the first
        \item the second
        \item the third
    \end{itemize}
    \end{minipage}
}
\cvitem{Another category}{%
   \begin{minipage}{\linewidth}
    \begin{itemize}
        \item number one
        \item number two
        \item number three
    \end{itemize}
    \end{minipage}
}
\cvitem{text}{with a description}

More text.

\end{document}

insira a descrição da imagem aqui

Você também pode preferir usar [t]o especificador de posição para minipage:

\documentclass{moderncv}

\moderncvstyle{casual}
\moderncvcolor{green}

\name{John}{Smith}

\begin{document}
\makecvtitle

\section{List section}
\cvitem{Some category}{%
   \begin{minipage}[t]{\linewidth}
    \begin{itemize}
        \item the first
        \item the second
        \item the third
    \end{itemize}
    \end{minipage}
}
\cvitem{Another category}{%
   \begin{minipage}[t]{\linewidth}
    \begin{itemize}
        \item number one
        \item number two
        \item number three
    \end{itemize}
    \end{minipage}
}
\cvitem{text}{with a description}

More text.

\end{document}

insira a descrição da imagem aqui

informação relacionada