我打算使用-packagetagging
來組織我的履歷,例如,取決於我需要哪種語言。五個參數上不起作用......詭異的。\tagged{}
\cventry
在隨附的 MWE 中,第一個cventry{2016}
可以正常工作,但第二個則{2015}
不行。有人能解決這個問題嗎?謝謝你!
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\usepackage{tagging}
\firstname{John}
\familyname{Doe}
\title{MWE}
%-----------------------------------------------
\begin{document}
\makecvtitle
\usetag{EN} %Three possible tags: EN, DE, SP
\section{Education}
\cventry{2016}
{\tagged{EN}{Mathematics}\tagged{DE}{Mathematik}\tagged{SP}{Matem\'aticas}}
{University}
{USA}
{(unfinished)}
{\tagged{EN}{Research}\tagged{DE}{Forschung} \tagged{SP}{Investigaci\'on}}
\cventry{2015}
{Pilot}
{\tagged{EN}{Academy}\tagged{DE}{Pilotschule} \tagged{SP}{Academia}} %uncommenting THIS LINE causes error
{}
{}
{}
{}
\end{document}
答案1
\cventry
使用的預設定義\ifthenelse
無法處理您的輸入:
預設定義
\renewcommand*{\cventry}[7][.25em]{%
\cvitem[#1]{#2}{%
{\bfseries#3}%
\ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
\ifthenelse{\equal{#5}{}}{}{, #5}%
\ifthenelse{\equal{#6}{}}{}{, #6}%
.\strut%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}
改用\ifx
它就可以了:
\makeatletter
\renewcommand*{\cventry}[7][.25em]{%
\cvitem[#1]{#2}{%
{\bfseries#3}%
\ifx&\else{, {\slshape#4}}\fi%
\ifx&\else{, #5}\fi%
\ifx&\else{, #6}\fi%
.\strut%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi%
}%
}
\makeatother
完整程式碼:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\usepackage{tagging}
\makeatletter
\renewcommand*{\cventry}[7][.25em]{%
\cvitem[#1]{#2}{%
{\bfseries#3}%
\ifx&\else{, {\slshape#4}}\fi%
\ifx&\else{, #5}\fi%
\ifx&\else{, #6}\fi%
.\strut%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi%
}%
}
\makeatother
\firstname{John}
\familyname{Doe}
\title{MWE}
%-----------------------------------------------
\begin{document}
\makecvtitle
\usetag{EN} %Three possible tags: EN, DE, SP
\section{Education}
\cventry{2016}
{\tagged{EN}{Mathematics}\tagged{DE}{Mathematik}\tagged{SP}{Matem\'aticas}}
{University}
{USA}
{(unfinished)}
{\tagged{EN}{Research}\tagged{DE}{Forschung} \tagged{SP}{Investigaci\'on}}
\cventry{2015}
{Pilot}
{\tagged{EN}{Academy}\tagged{DE}{Pilotschule} \tagged{SP}{Academia}} %uncommenting THIS LINE causes error
{}
{}
{}
{}
\end{document}