[Tex/LaTex] wrapfigure in moderncv

moderncvtextposwrapfigure

I want to add my photo in moderncv environment! Itemize positioning and other floats are missed up! I tried to use \textpos package but didn't work! Here is the code

\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{adjustbox}
\usepackage[absolute,overlay]{textpos}

\begin{wrapfigure}{r}{0.3\textwidth}
    \vspace*{-2.3cm}
    \hspace*{-2cm}
    \centering
    \adjustbox{cframe=color1}{\includegraphics[scale=0.07]{photo}}
\end{wrapfigure}

and with \textpos

\begin{textblock}{7}(7,7)
    \begin{figure}
        \includegraphics[scale=0.7]{photo}
    \end{figure}
\end{textblock}

I get these errors: Environment \begin{figure} is undefined and textblock ended with \end{figure}

Best Answer

you can't use wrapfigure in this context as it demands too much for it to be properly placed. On the other hand, if you want to overlay the photo, you can use textpos package but don't put your photo inside a figure environment as it is a float. This is how it should be done:

\documentclass{article}
\usepackage{graphicx}
\usepackage[absolute,overlay]{textpos}
\begin{document}
  \begin{textblock}{7}(7,7)                   %% adjust position
        \includegraphics[scale=0.7]{photo}
\end{textblock}
\end{document}

enter image description here

Another option will be to use tikz with remember picture, andoverlay` options:

\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
  \begin{tikzpicture}[remember picture,overlay]
        \node at ($(current page.north) +(0,-6in)$){\includegraphics[scale=0.7]{photo}};
\end{tikzpicture}
\end{document}

Here you can use page location hooks so that job becomes easy.

Related Question