moderncv 包附带许多内置命令。我认为一个有用的命令是,\cvlistitem
当\cvlistdoubelitem
要列出的项目很小并且适合两列时。但是当我有可以放在三列中的非常小的项目时,我该怎么办?我尝试使用 minipages,但遇到了 2 个问题:
- 我必须猜测可用空间的宽度,因为将小页面的宽度设置
0.3\textwidth
为第三个小页面,使其位于其他小页面下方 - 我必须强制小页面内内容的垂直位置
有没有一种最简单的规范方法来实现这样的\cvlisttripleitem
?
这是一个 MWE(实际上并不是那么简单):
\documentclass[10pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}
\firstname{First}
\lastname{Last}
\begin{document}
\maketitle
\section{Technical skills}
% itemize
\cvitem{group 1}{
\begin{itemize}
\item skill 1
\item skill 2
\item skill 3
\end{itemize}
}
\cvitem{group 2}{\begin{itemize} \item skill 4 \end{itemize}}
\section{Double itemize}
% double itemize
\cvlistdoubleitem{skill 1}{skill 4}
\cvlistdoubleitem{skill 2}{skill 5}
\cvlistdoubleitem{skill 3}{}
\section{Triple itemize}
%triple itemize
\cvitem{}{
\begin{minipage}[t]{0.25\textwidth}
\begin{itemize}
\item tiny item 1
\item tiny item 2
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.25\textwidth}
\begin{itemize}
\item tiny item 3
\item tiny item 4
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.25\textwidth}
\begin{itemize}
\item tiny item 5
\end{itemize}
\end{minipage}
}
%\cvlisttripleitem{1}{2}{3}
\section{Triple itemize}
% triple itemize
% does not work
\cvitem{}{
\begin{minipage}{0.3\textwidth}
\begin{itemize}
\item tiny item 1
\end{itemize}
\end{minipage}
\begin{minipage}{0.3\textwidth}
\begin{itemize}
\item tiny item 2
\end{itemize}
\end{minipage}
\begin{minipage}{0.3\textwidth}
\begin{itemize}
\item tiny item 3
\end{itemize}
\end{minipage}
}
% description
\section{Complicated entries}
\cvitem{}{\begin{description}
\item [Technical name] short description explaining the technical name
\item [Some buzz word] clarification and precision about this buzz word and my skills
\end{description}
}
% description
\section{Complicated entries (bis)}
\cvitem{Technical name}{short description explaining the technical name}
\cvitem{Some buzz word}{clarification and precision about this buzz word and my skills}
% enumerate
\section{No practical use}
\cvitem{}{
\begin{enumerate}
\item item 1
\begin{enumerate}
\item sub-item 1
\item sub-item 2
\end{enumerate}
\item item $n+1$
\end{enumerate}
}
\end{document}
答案1
multicols*
这是使用包中的一个选项multicol
。
\usepackage{multicol}
.
.
.
\section{Triple itemize here again}
% triple itemize
% does not work
\hspace*{\dimexpr\hintscolumnwidth+\separatorcolumnwidth\relax}
\begin{minipage}{\maincolumnwidth}
\begin{multicols*}{3}
\begin{itemize}
\item tiny item 1
\item tiny item 2
\item tiny item 3
\item tiny item 4
\item tiny item 5
\end{itemize}
\end{multicols*}
\end{minipage}
% description
.
.
.
需要考虑的长度有三种。左列的宽度为\hintscolumnwidth
,分隔符的宽度为\separatorcolumnwidth
,主列\maincolumnwidth
更宽。
\documentclass[10pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}
\firstname{First}
\lastname{Last}
\usepackage{multicol}
\begin{document}
\maketitle
\section{Technical skills}
% itemize
\cvitem{group 1}{
\begin{itemize}
\item skill 1
\item skill 2
\item skill 3
\end{itemize}
}
\cvitem{group 2}{\begin{itemize} \item skill 4 \end{itemize}}
\section{Double itemize}
% double itemize
\cvlistdoubleitem{skill 1}{skill 4}
\cvlistdoubleitem{skill 2}{skill 5}
\cvlistdoubleitem{skill 3}{}
\section{Triple itemize}
%triple itemize
\cvitem{}{
\begin{minipage}[t]{0.25\textwidth}
\begin{itemize}
\item tiny item 1
\item tiny item 2
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.25\textwidth}
\begin{itemize}
\item tiny item 3
\item tiny item 4
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.25\textwidth}
\begin{itemize}
\item tiny item 5
\end{itemize}
\end{minipage}
}
%\cvlisttripleitem{1}{2}{3}
\section{Triple itemize here again}
% triple itemize
% does not work
\hspace*{\dimexpr\hintscolumnwidth+\separatorcolumnwidth\relax}
\begin{minipage}{\maincolumnwidth}
\begin{multicols*}{3}
\begin{itemize}
\item tiny item 1
\item tiny item 2
\item tiny item 3
\item tiny item 4
\item tiny item 5
\end{itemize}
\end{multicols*}
\end{minipage}
% description
\section{Complicated entries}
\cvitem{}{\begin{description}
\item [Technical name] short description explaining the technical name
\item [Some buzz word] clarification and precision about this buzz word and my skills
\end{description}
}
% description
\section{Complicated entries (bis)}
\cvitem{Technical name}{short description explaining the technical name}
\cvitem{Some buzz word}{clarification and precision about this buzz word and my skills}
% enumerate
\section{No practical use}
\cvitem{}{
\begin{enumerate}
\item item 1
\begin{enumerate}
\item sub-item 1
\item sub-item 2
\end{enumerate}
\item item $n+1$
\end{enumerate}
}
\end{document}
另一个选择是使用tasks
包。稍后我会添加一个示例。