[Tex/LaTex] Trouble inserting picture in CV template

cvfloatstemplates

I'm making a resume based on a latex template (link: https://www.sharelatex.com/templates/cv-or-resume/cies-breijs-resume ) and I'd like to insert a figure.

There is some free space in the template in the upper right corner (if you take away the date) where I would like to insert the figure. I however can't manage to get a small picture there in the correct spot. Have tried with wrapfigure and regular figure in multiple places and with multiple settings. Purpose is to have a small profile picture in the upper right corner. Can anybody help?

The relevant code is:

% Start a document with the here given default font size and paper size.
\documentclass[10pt,a4paper]{article}

% Set the page margins.
\usepackage[a4paper,margin=0.75in]{geometry}

% Setup the language.
\usepackage[english]{babel}
\hyphenation{Some-long-word}

% Makes resume-specific commands available.
\usepackage{resume}




\begin{document}  % begin the content of the document
\sloppy  % this to relax whitespacing in favour of straight margins


% title on top of the document
\maintitle{Cies Breijs}{June 12, 1982}{Last update on \today}

\nobreakvspace{0.3em}  % add some page break averse vertical spacing

% \noindent prevents paragraph's first lines from indenting
% \mbox is used to obfuscate the email address
% \sbull is a spaced bullet
% \href well..
% \\ breaks the line into a new paragraph
\noindent\href{mailto:cies.at.kde.dot.nl}{cies\mbox{}@\mbox{}kde.nl}\sbull
\textsmaller{+}31.646469087\sbull
{\newnums cies010} \emph{(Skype)}\sbull
\href{http://www.linkedin.com/in/ciesbreijs}{www.linkedin.com/in/ciesbreijs}
\\
Mathenesserplein 84\sbull
3022\thinspace {\large \sc ld}\sbull
Rotterdam\sbull
The Netherlands

\spacedhrule{0.9em}{-0.4em}  % a horizontal line with some vertical spacing before and after

\roottitle{Summary}  % a root section title

The rest is not included but available in the link.

Edit:

Example of my second issue (see comment to accepted answers). The blue is the image that is off-page, i.e., too much in the upper right corner. It would be better if the center of the image roughly coincided with the red text. The red text is scratched out to protect privacy.

enter image description here

Best Answer

No need for extra packages; simply include your image with a standard \includegraphics and use \smash, as in

The Netherlands\hfill 
\smash{\includegraphics[width=3cm]{example-image-a}}

A complete example:

enter image description here

The code:

\documentclass[10pt,a4paper]{article}
\usepackage[a4paper,margin=0.75in]{geometry}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{resume}

\begin{document}
\sloppy

\maintitle{Cies Breijs}{June 12, 1982}{}

\nobreakvspace{0.3em}

\noindent\href{mailto:cies.at.kde.dot.nl}{cies\mbox{}@\mbox{}kde.nl}\sbull
\textsmaller{+}31.646469087\sbull
{cies010} \emph{(Skype)}\sbull
\href{http://www.linkedin.com/in/ciesbreijs}{www.linkedin.com/in/ciesbreijs}
\\
Mathenesserplein 84\sbull
3022\thinspace {\large \sc ld}\sbull
Rotterdam\sbull
The Netherlands\hfill 
\smash{\includegraphics[width=3cm]{example-image-a}}

\spacedhrule{0.9em}{-0.4em}

\roottitle{Summary}

\end{document}

Update

If the image's height is too big, one could reduce it in \includegraphics, as in

\includegraphics[height=2cm]{example-image-a}

or use instead something like

The Netherlands\hfill 
\raisebox{-.5\totalheight}[0pt][.5\totalheight]{\includegraphics[width=3cm,height=5cm]{example-image-a}}
Related Question