是否可以使用如下所示的类别添加多个科目和成绩moderncv
?
到目前为止我只有下面的代码
\cventry{Date--Date}{Subject}{College Name}{City}
{\textit{Grade}}{}
我尝试使用“多主题 moderncv”及其变体在 Google 上搜索答案,并在 Google 图片上查看是否有类似图片。我尝试过的唯一代码是:
\cventry{Date--Date}{Subject\newline Subject 2}{College Name}{City}
{\textit{Grade}\newline\textit{Grade 2}}{}
未能创造\newline
有人可以帮忙吗?
答案1
您可以使用tabularx
:
\documentclass{moderncv}
\moderncvtheme{classic}
\usepackage{tabularx}
\firstname{John}
\familyname{Doe}
\begin{document}
\section{Test section}
\begin{tabularx}{\linewidth}{Xl}
\textbf{College Name} & \textbf{City} \\
Subject 1--Grade & year--year \\
Subject 2--Grade & year--year \\
Subject 3--Grade & year--year \\
\end{tabularx}
\end{document}
为了将表格材料与章节标题对齐,可以使用适当的空格:
\documentclass{moderncv}
\moderncvtheme{classic}
\usepackage{tabularx}
\firstname{John}
\familyname{Doe}
\begin{document}
\section{Test section}
\hspace*{\dimexpr\hintscolumnwidth+\separatorcolumnwidth\relax}\begin{tabularx}{\dimexpr\linewidth-\hintscolumnwidth-\separatorcolumnwidth\relax}{Xl}
\textbf{College Name} & \textbf{City} \\
Subject 1--Grade & year--year \\
Subject 2--Grade & year--year \\
Subject 3--Grade & year--year \\
\end{tabularx}
\end{document}
另一种选择是使用\cventry
和\cvitem
:
\documentclass{moderncv}
\moderncvtheme{classic}
\firstname{John}
\familyname{Doe}
\begin{document}
\section{Test section}
\cventry{}{College Name}{}{}{\hfill\textbf{City}}{}
\cvitem{}{Subject 1--Grade\hfill year--year}
\cvitem{}{Subject 2--Grade\hfill year--year}
\cvitem{}{Subject 3--Grade\hfill year--year}
\end{document}