I have the line


I want the "name" variable to be on the left, and the image to be on the right of the page. But it turns out the image goes on the left of the next line. How can I make it be in the same line as the "name", but to the right?

EDIT: Removing the begin{figure}


yields the same result.

  • Your \parbox is set to fill \textwidth, which leaves no room to place the image against the right margin. Just set \noindent{\LARGE\textbf{\name}}\hfill\includegraphics[..]{...}%. – Werner Oct 29 '13 at 5:16

You don't need figure environment if not using caption. figure is a float and moves around. You don't need \parbox too.

\noindent\textbf{name} \hfill\includegraphics[width=2cm]{example-image-a}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.