Can you please add next time a short compilable code instead your given code snippets?
To get rid of the blanks before the comas you need to add some %
or delete some blanks before the writen %
in your definition of both commands.
You can ommit the first line (use \newcommand
in the next line):
\newcommand*{\cvshortentry}[7][.25em]{}
Your definition for \publication}[6]
is faulty, you defined only 5 arguments and should think about the case the argument is empty.
So please change your definitions to:
\newcommand*{\cvshortentry}[7][.25em]{%
\cvitem[#1]{#2}{%year
{\bfseries{#3}}% title
\ifthenelse{\equal{#4}{}}{}{, {#4}}%
\ifthenelse{\equal{#5}{}}{}{, #5}%
.\strut%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small#6\end{minipage}}\fi%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small{\slshape#7}\end{minipage}}\fi%
}%
}
\newcommand{\publication}[6]{%
\cvitem{#1}{% year
{#2}% authors
{, #3}% title
{\slshape, #4}% journal / status
{\ifthenelse{\equal{#5}{}}{}{\small, #5}}%
{\ifthenelse{\equal{#6}{}}{}{, #6}}%
.%
}%
}
With the following complete code
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic} % casual, classic, banking, oldstyle and fancy
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
% personal data
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\extrainfo{additional information}
\photo[64pt][0.4pt]{example-image-a}
\quote{Some quote}
\setlength{\footskip}{66pt}
%\newcommand*{\cvshortentry}[7][.25em]{}
\newcommand*{\cvshortentry}[7][.25em]{%
\cvitem[#1]{#2}{%year
{\bfseries{#3}}% title
\ifthenelse{\equal{#4}{}}{}{, {#4}}%
\ifthenelse{\equal{#5}{}}{}{, #5}%
.\strut%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small#6\end{minipage}}\fi%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small{\slshape#7}\end{minipage}}\fi%
}%
}
\newcommand{\publication}[6]{%
\cvitem{#1}{% year
{#2}% authors
{, #3}% title
{\slshape, #4}% journal / status
{\ifthenelse{\equal{#5}{}}{}{\small, #5}}%
{\ifthenelse{\equal{#6}{}}{}{, #6}}%
.%
}%
}
\begin{document}
\makecvtitle
\section{Current Projects}
\cvshortentry{}{Poject Name}{Some description of the project}{\small \textcolor{blue}{some more comments}}{}{}
\section{Selected Publications}
\publication{2018}{I.M. Lopez, J. Doe}{Title of article}{Journal}{\textcolor{blue}{some comments}}{}
\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6} % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\end{document}
you get the wished result:

{\bfseries #3}<space here>
delete that space. and the space/neline after{, {#4}}
should be removed or commented out, similaly all the spaces added at the end of every line in\publication