[Tex/LaTex] Align Fbox to the left and text to the right

alignmentfbox

I m a beginner with LaTex and I don't really understand how to align an FBox to the left with an image inside and some text to the right.

Current implementation without boxing:

\noindent\begin{minipage}{0.8\textwidth}
   \includegraphics[width = 0.5\linewidth]{graph_southampton.PNG}
\end{minipage}

\hfill

\begin{minipage}{0.9\textwidth}\raggedleft

Yesasd asdjkasdk jakdsajkd\\
alsdjaojzxkc \\
asdjkasm

\end{minipage}

Output:

enter image description here

As you may notice they are not properly aligned, I just sent you a bit from what I have before and after to get a glimpse of my page format.

Now with Boxing

\noindent\fbox{ 

    \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
        \lefting
        \includegraphics[width = 0.5\linewidth]{graph_southampton.PNG}
    \end{minipage}

    \hfill

    \begin{minipage}{0.001\textwidth}

        asdaksdaskdl

    \end{minipage}

}

Output

enter image description here

The box size is perfect but the text outruns the boundaries.

Could you please help me with some suggestions on both cases?

Best Answer

an empty line starts a new paragraph

\documentclass{article}
\usepackage{graphicx}
\begin{document}

\noindent
\begin{minipage}{0.6\textwidth}
\fbox{\includegraphics[width=\linewidth]{tiger}}
\end{minipage}
\hfill
\begin{minipage}{0.35\textwidth}\raggedleft     
        Yesasd asdjkasdk jakdsajkd\\
        alsdjaojzxkc \\
        asdjkasm
\end{minipage}

\end{document}

enter image description here

For an image with a caption use

\documentclass{article}
\usepackage{hvfloat}
\begin{document}

\hvFloat[capPos=right,capVPos=bottom,objectFrame]{figure}%
   {\includegraphics[width=0.6\linewidth]{tiger}}%
   {The caption of the figure which is on the right bottom
    of the page.}%
   {fig-label}

\end{document}

enter image description here

Related Question