EDITED to auto-center vertically the image, using \Xcventry
with an extra argument in which the underset material is provided as argument #1
. I use the \stackunder
macro to achieve it. It also can take an optional argument which will denote the gap between year and image.
In the MWE below, for the 1st entry, I use \cventry
and manually center using the optional argument of \stackunder
. For the 2nd-4th cases, I auto-center using \Xcventry
. The last case is a vanilla \cventry
with no underset.
EDITED to work with smaller images and multi-line titles and subtitles.
\documentclass{moderncv}
\moderncvstyle{classic}
\moderncvcolor{green}
\renewcommand{\familydefault}{\rmdefault}
\usepackage{stackengine}
\def\stackalignment{r}
\firstname{Andrew}
\familyname{\newline Doe}
\title{Curriculum Vitae}
\newcommand\Xcventry[8]{%
\setbox0=\hbox{\addstackgap[.5\baselineskip]{\parbox[b]{\hintscolumnwidth}{#1}}}%
\setbox2=\hbox{\parbox[b]{\dimexpr\linewidth-\hintscolumnwidth}{%
\textbf{#3}, \textit{#4}.\par#7}}%
\def\stacktype{L}%
\edef\stackshift{\the\dimexpr.5\dimexpr\ht2+\ht0-\baselineskip}%
\cventry{\stackunder[\stackshift]{#2}{%
\makebox[\hintscolumnwidth]{#1}}}{#3}{#4}{#5}{#6}{#7}{#8}%
}
\begin{document}
\maketitle
% MANUALLY
\cventry{\stackunder[8pt]{1970}{\includegraphics[width=\hintscolumnwidth]{example-image}}
}
{Title}{subtitle}{}{}{text\\text\\more text\\text\\text.}{}
% \Xcventry
\Xcventry{\includegraphics[width=\hintscolumnwidth]{example-image}}{1970}
{Title Title Title Title Title Title }{subtitle subtitle subtitle subtitle }
{}{}{text\\text\\more text\\text\\text.}{}
% \Xcventry
\Xcventry{\includegraphics[width=.5\hintscolumnwidth]{example-image}}{1970}
{Title}{subtitle}{}{}{text\\text\\more text\\text\\text.
\\more text\\text\\text.}{}
% \Xcventry
\Xcventry{\includegraphics[width=\hintscolumnwidth]{example-image}}{1970}
{Title Title Title Title Title Title }{subtitle subtitle subtitle subtitle }
{}{}{text\\text\\more text\\text\\text.
text\\text\\more text\\text\\text.}{}
% \cventry with no figure
\cventry{1970}
{Title}{subtitle}{}{}{text\\text\\more text\\text\\text.}{}
\end{document}
