我正在使用这里的乳胶模板来制作简历简历模板。
作为参考,我添加了以下几行
\newcommand{\cvdoublecolumn}[2]{%
\cvline{}{%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
\hfill%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
}%
}
\newcommand{\cvreference}[7]{%
\textbf{#1}\newline% Name
\ifthenelse{\equal{#2}{}}{}{\addresssymbol~#2\newline}%
\ifthenelse{\equal{#3}{}}{}{#3\newline}%
\ifthenelse{\equal{#4}{}}{}{#4\newline}%
\ifthenelse{\equal{#5}{}}{}{#5\newline}%
\ifthenelse{\equal{#6}{}}{}{\emailsymbol~\texttt{#6}\newline}%
\ifthenelse{\equal{#7}{}}{}{\phonesymbol~#7}}
一切都很好。要添加两个引用,它可以很好地并排工作。但是添加另一个引用,它会出现在下一行,对齐会中断,并且会创建一个新页面。
我怎样才能解决这个问题 ?
我已经用其他方法修复了这个问题,我在 minipage 中放了 3 列
\newcommand{\cvdoublecolumn}[3]{%
\cvline{}{%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
%\hfill%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
%\hfill%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#3\end{minipage}%
}%
}
答案1
您可以为三列提供必要的定义:
\newlength\listtripleitemmaincolumnwidth
\makeatletter
\renewcommand*{\recomputecvlengths}{%
\setlength{\quotewidth}{0.65\textwidth}%
\setlength{\maincolumnwidth}{\textwidth-\separatorcolumnwidth-\hintscolumnwidth}%
\setlength{\listitemmaincolumnwidth}{\maincolumnwidth-\listitemsymbolwidth}%
\setlength{\doubleitemmaincolumnwidth}{\maincolumnwidth-\hintscolumnwidth-\separatorcolumnwidth-\separatorcolumnwidth}%
\setlength{\doubleitemmaincolumnwidth}{0.5\doubleitemmaincolumnwidth}%
\setlength{\listdoubleitemmaincolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}%
\setlength{\listdoubleitemmaincolumnwidth}{0.5\listdoubleitemmaincolumnwidth}%
\setlength\listtripleitemmaincolumnwidth{.66\listdoubleitemmaincolumnwidth}%
\renewcommand{\headwidth}{\textwidth}%
\setlength{\parskip}{0\p@}%
}
\makeatother
\newcommand{\cvtriplecolumn}[3]{%
\cvline{}{%
\begin{minipage}[t]{\listtripleitemmaincolumnwidth}#1\end{minipage}%
\hfill%
\begin{minipage}[t]{\listtripleitemmaincolumnwidth}#2\end{minipage}%
\hfill%
\begin{minipage}[t]{\listtripleitemmaincolumnwidth}#3\end{minipage}%
}%
}
完整示例:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage{lipsum}
\usepackage[scale=0.75]{geometry}
\newlength\listtripleitemmaincolumnwidth
\makeatletter
\renewcommand*{\recomputecvlengths}{%
\setlength{\quotewidth}{0.65\textwidth}%
\setlength{\maincolumnwidth}{\textwidth-\separatorcolumnwidth-\hintscolumnwidth}%
\setlength{\listitemmaincolumnwidth}{\maincolumnwidth-\listitemsymbolwidth}%
\setlength{\doubleitemmaincolumnwidth}{\maincolumnwidth-\hintscolumnwidth-\separatorcolumnwidth-\separatorcolumnwidth}%
\setlength{\doubleitemmaincolumnwidth}{0.5\doubleitemmaincolumnwidth}%
\setlength{\listdoubleitemmaincolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}%
\setlength{\listdoubleitemmaincolumnwidth}{0.5\listdoubleitemmaincolumnwidth}%
\setlength\listtripleitemmaincolumnwidth{.66\listdoubleitemmaincolumnwidth}%
\renewcommand{\headwidth}{\textwidth}%
\setlength{\parskip}{0\p@}%
}
\makeatother
\newcommand{\cvdoublecolumn}[2]{%
\cvline{}{%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
\hfill%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
}%
}
\newcommand{\cvtriplecolumn}[3]{%
\cvline{}{%
\begin{minipage}[t]{\listtripleitemmaincolumnwidth}#1\end{minipage}%
\hfill%
\begin{minipage}[t]{\listtripleitemmaincolumnwidth}#2\end{minipage}%
\hfill%
\begin{minipage}[t]{\listtripleitemmaincolumnwidth}#3\end{minipage}%
}%
}
\newcommand{\cvreference}[7]{%
\textbf{#1}\newline% Name
\ifthenelse{\equal{#2}{}}{}{\addresssymbol~#2\newline}%
\ifthenelse{\equal{#3}{}}{}{#3\newline}%
\ifthenelse{\equal{#4}{}}{}{#4\newline}%
\ifthenelse{\equal{#5}{}}{}{#5\newline}%
\ifthenelse{\equal{#6}{}}{}{\emailsymbol~\texttt{#6}\newline}%
\ifthenelse{\equal{#7}{}}{}{\phonesymbol~#7}}
\firstname{John}
\familyname{Doe}
\nopagenumbers
\begin{document}
\section{References}
\cvdoublecolumn{\cvreference{A}{B}{C}{D}{E}{F}{G}}{\cvreference{A}{B}{C}{D}{E}{F}{G}}
\cvtriplecolumn{\cvreference{A}{B}{C}{D}{E}{F}{G}}{\cvreference{A}{B}{C}{D}{E}{F}{G}}{\cvreference{A}{B}{C}{D}{E}{F}{G}}
\end{document}
结果: