1

The title may sound like a duplicate and you may think that the package wrapfig deals with that. But, what I am asking for is quite different. I am not sure if the wrapfig package could help.

I have a figure and I want to place an explanation to the right side of it. I want them to start at the same vertical level, and then the text to wrap the figure around. I made a illustration in Inkscape. Please see the figure below:

enter image description here

So far I have tried to use the graphbox package, after the recommendation in this Tex-Exchange post . However, I couldn't figure out, how the text should continue at the next line. I even doubt if that package would help at all. I have placed the code I used for it is below. You can download the pdf file here (I cannot use \rule{width}{height} as the use of \includegraphics is required).

\documentclass{article}
\usepackage{mwe}
\usepackage{graphbox} 
\begin{document}
\begin{tabular}{ll}
\includegraphics[align=t,scale=0.75]{by-nc-nd-eu.pdf} & 
This work is licensed under the Creative Commons Attribution-Share Alike 3.0 License 
(CC BY-ND 3.0 ): http://creativecommons.org/licenses/by-nc-nd/3.0/\\
\end{tabular}
\end{document}

An the output is:

enter image description here

Any solution (including package, style recommendations) are appreciated!

T-800
  • 137
  • Please give us a minimal example of what you have tried. It is tedious for us to set up a problem and to guess around. Thank you – LaRiFaRi Jan 20 '15 at 11:18
  • @LaRiFaRi Thanks for your notice. I have edited my post in that respect. – T-800 Jan 20 '15 at 11:54
  • wrapfig does exactly what you describe, and doesn't do anything else, in what way does it not meet your needs? – David Carlisle Jan 20 '15 at 12:06
  • @DavidCarlisle I first tried to resolve the matter with wrapfig. But I couldn't let the text start at the same vertical level with the figure. The text was always above the figure. I must have missed something – T-800 Jan 20 '15 at 12:14

2 Answers2

1

Bingo!

\documentclass{article}
\usepackage{graphicx}
\usepackage{url}
\usepackage{wrapfig}
\begin{document}
\noindent
\begin{wrapfigure}[2]{l}{1cm}
    \centering
    \includegraphics[width=1cm]{example-image-a}\\
\end{wrapfigure}
This work is licensed under the Creative Commons Attribution-Share Alike 3.0 License
(CC BY-ND 3.0 ): \url{http://creativecommons.org/licenses/by-nc-nd/3.0/}

\end{document}

Use 2 for 2 lines, small letter l for not floating and change 1cm as you wish in [2]{l}{1cm}. Keep the same width in \includegraphics[width=1cm]... also.

enter image description here

With your picture:

\documentclass{article}
\usepackage{graphicx}
\usepackage{url}
\usepackage{wrapfig}
\begin{document}
\noindent
\begin{wrapfigure}[2]{l}{1.6cm}
    \centering
    \includegraphics[scale=0.55]{by-nc-nd-eu}\\
\end{wrapfigure}
This work is licensed under the Creative Commons Attribution-Share Alike 3.0 License
(CC BY-ND 3.0 ): \url{http://creativecommons.org/licenses/by-nc-nd/3.0/}

\end{document}

enter image description here

  • I actually need to use this in a minipage. But when I do that (lets say \begin{minipage}{120mm}) the alignment is not preserved any more. Why does it happen and how can I prevent that? Can you give me any clue? – T-800 Jan 20 '15 at 14:25
  • @T-1000 Why do you need a minipage? BTW have you tried \begin{minipage}[t]? Better dispense with minipage. –  Jan 20 '15 at 14:29
  • I want to push the text to the bottom of the page. Therefore, I use \mbox{} and \vfill. But at the end, what I get is the same as in the case of a minipage environment. (When I encountered the problem, I decided to place it in a minipage first and then to push it down) – T-800 Jan 20 '15 at 14:33
  • @T-1000 I am lost. Why do you want to push the text down? –  Jan 20 '15 at 14:40
  • I am very sorry, I had to explain like this: I want the figure and text to be located at the end of the page. I mean the both of them, not just the text (again; vertically aligned). – T-800 Jan 20 '15 at 14:44
  • @T-1000 In that case, if you don't have any text in the page, better use \mbox{}\vfill. –  Jan 20 '15 at 15:37
1

Alternatively, you can let wrapfig.sty work out the width and the number of lines:

\documentclass{article}

\usepackage{graphicx}
\usepackage{wrapfig}

\begin{document}

\begingroup
\setlength{\intextsep}{0pt}
\setlength{\columnsep}{3pt}
\parindent0pt
\begin{wrapfigure}{l}{0cm}\includegraphics[height=1.75\baselineskip]{SS_Today}\end{wrapfigure}
This work is licensed under the Creative Commons Attribution-No Derivatives Licence (CC BY-NC-ND 3.0)\\ http://creativecommons.org/licences/by=nc=nd/3.0

\endgroup

\end{document}

The {0cm} essentially tells wrapfig.sty to use the natural width of the graphic so that you don't have to specify it. Note using the optional argument for the number of lines to wrap tells wrapfig.sty to work it out. The length \intextsep determines the amount of standoff at the top and bottom the the wrapped figure. The length \columnsep determines the standoff at the left and right of the wrapped figure. I have specified these lengths locally, but you could put them in the preamble if there are other similar instances.

Example

NOTE I had to use a screenshot of your graphic, thus the height option in the call to \includegraphics. I forgot to include the screenshot -- fixed.

sgmoye
  • 8,586