Remove comma from moderncv's \cventry
The entry you're showing is produce with \cventry
, so we want to change the definition of this macro. It is defined in moderncvstyleclassic.sty
. All I did is copy it into my preamble verbatim and remove the undesired comma. (In the MWE, I actually copied the line and commented out the original, to make the change recognizable.
\documentclass{moderncv}
\moderncvstyle{casual}
%%%
% the following definition is from the file moderncvstyleclassic.sty
\renewcommand*{\cventry}[7][.25em]{%
\cvitem[#1]{#2}{%
{\bfseries#3}%
% \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}% I changed this line (with comma) ...
\ifthenelse{\equal{#4}{}}{}{ {\slshape#4}}% ... into this one (without comma).
\ifthenelse{\equal{#5}{}}{}{, #5}%
\ifthenelse{\equal{#6}{}}{}{, #6}%
.\strut%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}
%%%
\firstname{John}
\familyname{Doe}
\begin{document}
\section{Education}
\cventry{December 2012}{Master of Science in Chocolatology}{University of Candyland}{Sugartown}{A+ with Golden Gummy Bear}{I am the chocolate-man.}
\end{document}
instead of redefining the whole command yourself also consider using xpatch
:
\usepackage{xpatch}
\xpatchcmd\cventry{,}{}{}{}
this line replaces the first occurence in the macro text of ,
by the empty string - i.e. removes it.
Here is also a nice documentation of how the command works.
Obvious comment, but in case you want to be able to switch between having and not having the comma, you can define a new command \cventrynocomma
like this:
\newcommand*{\cventrynocomma}[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}}