我尝试编辑\cvdoubleitem
class moderncv
、 style中的banking
。我想将类别加粗。我尝试了以下操作,但这样做时对齐方式非常奇怪,尽管可以正确地将文本加粗。
\renewcommand*{\cvdoubleitem}[5][.5em]{%
\cvitem[#1]{\bfseries#2}{%
\begin{minipage}[t]{\doubleitemcolumnwidth}#3\end{minipage}%
\hfill% fill of \separatorcolumnwidth
\begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintstyle{\bfseries#4}\end{minipage}%
\hspace*{\separatorcolumnwidth}%
\begin{minipage}[t]{\doubleitemcolumnwidth}#5\end{minipage}}}
我以为编辑代码这里可能会有帮助,但是原始代码本身出现了错误,所以我没有尝试。
MWE 如下所示:
\documentclass[12pt,letterpaper,sans]{moderncv}
\moderncvstyle{banking}
\name{ieujrghieu}{wirjufhiuryg}
\renewcommand*{\cvdoubleitem}[5][.5em]{%
\cvitem[#1]{\bfseries#2}{%
\begin{minipage}[t]{\doubleitemcolumnwidth}#3\end{minipage}%
\hfill% fill of \separatorcolumnwidth
\begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintstyle{\bfseries#4}\end{minipage}%
\hspace*{\separatorcolumnwidth}%
\begin{minipage}[t]{\doubleitemcolumnwidth}#5\end{minipage}}}
\begin{document}
\cvdoubleitem{TTTTTTT}{doiuehneiuhrigbn3ghbn iurh fg3iuh gi3uh giu43ygh iu3 ghiu3rg3iu}{GGGGGGGGGG}{eihg uegh iuh 39uf h23 948h f924 fu4g fiuf 2iuf g4iuf g}
\cvdoubleitem{PPPPPPPPP}{rusfhvioehr iughe r}{MMMMMM}{3iurgh re3uygh 3eur}
\end{document}
答案1
在当前版本的moderncv
2.0.0 类样式中,您将在文件中banking
找到命令的正确定义:\cvdoubleitem
moderncvbodyiii.sty
\renewcommand*{\cvdoubleitem}[5][.25em]{%
\begin{minipage}[t]{\doubleitemcolumnwidth}\hintstyle{#2}: #3\end{minipage}%
\hfill% fill of \separatorcolumnwidth
\begin{minipage}[t]{\doubleitemcolumnwidth}\ifthenelse{\equal{#4}{}}{}{\hintstyle{#4}: }#5\end{minipage}%
\par\addvspace{#1}}
命令\hintstyle
定义文本#2
或#4
必须以粗体打印。它在类中定义为,\renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
并\hintfont
定义为\renewcommand*{\hintfont}{\bfseries}
要取消打印粗体,您可以定义自己的新命令\mycvdoubleitem
并删除这两个命令\hintstyle{}
。现在您可以\mycvdoubleitem
根据需要进行更改。
以下 MWE 显示了命令\cvdoubleitem
和\mycvdoubleitem
\documentclass[12pt,letterpaper,sans]{moderncv}
\moderncvstyle{banking}
\name{ieujrghieu}{wirjufhiuryg}
\newcommand*{\mycvdoubleitem}[5][.25em]{%
\begin{minipage}[t]{\doubleitemcolumnwidth}#2: #3\end{minipage}%
\hfill% fill of \separatorcolumnwidth
\begin{minipage}[t]{\doubleitemcolumnwidth}\ifthenelse{\equal{#4}{}}{}{#4: }#5\end{minipage}%
\par\addvspace{#1}}
\begin{document}
\cvdoubleitem{1TTTTTTT}{2doiuehneiuhrigbn3ghbn iurh fg3iuh gi3uh
giu43ygh iu3 ghiu3rg3iu}{3GGGGGGGGGG}{4eihg uegh iuh 39uf h23 948h
f924 fu4g fiuf 2iuf g4iuf g}
\cvdoubleitem{1PPPPPPPPP}{2rusfhvioehr iughe r}{3MMMMMM}{43iurgh
re3uygh 3eur}
\mycvdoubleitem{1TTTTTTT}{2doiuehneiuhrigbn3ghbn iurh fg3iuh gi3uh
giu43ygh iu3 ghiu3rg3iu}{3GGGGGGGGGG}{4eihg uegh iuh 39uf h23 948h
f924 fu4g fiuf 2iuf g4iuf g}
\mycvdoubleitem{1PPPPPPPPP}{2rusfhvioehr iughe r}{3MMMMMM}{43iurgh
re3uygh 3eur}
\end{document}
结果