18

I have a problem to get the following result in LaTeX:

enter image description here

The figure is not something I want to do with tikz, but I want to use \includegraphics{figure1.png}. Can someone help me to get this?

26

Here is my proposal for your code:

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

\begin{minipage}{0.5\textwidth}
\begin{figure}[H]
\includegraphics{figure1}
\caption{\label{fig:blue_rectangle} Rectangle}
\end{figure}
\end{minipage} \hfill
\begin{minipage}{0.45\textwidth}
\begin{itemize}
\item *Rectangle
\item *Color: blue
\end{itemize}
\end{minipage}

\end{document}

You can adapt the size of the two columns by playing with the 0.5\textwidth part to have it matching your need (It does not have to be equal for the two columns!).

NOTE: The minipage environments must not have any uncommented whitelines between them, i.e. they must touching, as shown in the example. If there is a line between them, LaTeX draws them separately.

  • Thanks, exactly what I needed. But how can I alter the height of the text on the right (''*rectangle, *color:blue'') with respect to the height of the figure? – user32451 Jun 18 '13 at 18:17
  • 1
    First of all you can use an option like this \begin{minipage}[X]{} where X is either t,c or b for top, center and bottom. You can also use the \vspace{Yin} or \vspace{Zcm} before the \begin{itemize} to add some space (Y inches or Z centimeters). – Ludovic C. Jun 18 '13 at 18:31
  • Thanks for your response. So how can I then indent my figure? – user32451 Jun 18 '13 at 18:45
  • When you say indent, you mean have an "extra" margin? If that's it add \hspace{} with whatever you want before the first minipage (make sure to adapt the size of the minipage environments then not to have one going out of the page). – Ludovic C. Jun 18 '13 at 18:49
4

EDITED to make rectangle, well... blue, per mrc's comment.

\documentclass{article}
\usepackage{calc,xcolor}
\begin{document}

%\def\x{\includegraphics{filename}}
\def\x{\textcolor{blue!70}{\rule{1in}{2in}}}
\def\y{\parbox[t]{1.5in}{\LARGE *Rectangle\\ {*Color: blue}}}

\begin{figure}
\centering
\rule{\widthof{\y}}{0in}~
\raisebox{\baselineskip -\heightof{\x}}{\x} 
~\y
\caption{Rectangle}
\end{figure}
\end{document}

enter image description here

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.