[Tex/LaTex] Placement of figure inline with text

floatsinline()positioning

enter image description here

I have some issues placing a figure where i want. I want the picture to be inline with my name. Any way in can place the figure in line with the text, on the left side. I have tried floating it, {wrapfigure], doesnt work.

Best Answer

Putting the image into a figure environment means that it is allowed to float around; it will be placed wherever TeX thinks it fits. But you want to have it in a fixed place.

enter image description here

\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\hspace*{\fill}{\Huge\bfseries\sffamily Example Image}\hfill
\makebox[0cm][r]{\includegraphics[height=2cm]{example-image}}%
\bigskip

\section*{Personal Data}
\end{document}

Putting the image into \makebox[0cm][r]{...} removes its width, so it does not influence the centering of the headline. Moreover, r places it flush with the right border.

To center the headline vertically with the image, you can lower the image w.r.t. to the baseline using \raisebox.

\makebox[0cm][r]{\raisebox{-4ex}{\includegraphics[height=2cm]{example-image}}}%

enter image description here