![如何在 moderncv 中的“itemize”后删除多余的空格?](https://linux22.com/image/281386/%E5%A6%82%E4%BD%95%E5%9C%A8%20moderncv%20%E4%B8%AD%E7%9A%84%E2%80%9Citemize%E2%80%9D%E5%90%8E%E5%88%A0%E9%99%A4%E5%A4%9A%E4%BD%99%E7%9A%84%E7%A9%BA%E6%A0%BC%EF%BC%9F.png)
在文档中,在 a 中moderncv
使用会在逐项列表后产生额外的空格。itemize
cvitem
这是一个最小工作示例:
\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}
我可以\vspace{-1em}
在每个后面添加一个itemize
来删除空格,但这似乎是在与 LaTeX 作斗争,而不是接受它。 是否有可以更改的设置来删除此处多余的空格?
答案1
cvitem
该类已经提供了设置间距的选项moderncv
:
\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}
查看moderncv.cls
文件:
% 创建带有标题和相应文本的简历行
% 用法:\cvitem[间距]{标题}{文本}
答案2
用一个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}
您还可以选择使用[t]
位置说明符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}