Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I apologize for not knowing the correct term for this, but I want to put some kind of a infobox at the beginning of each section. What I want to ask about is for example on Wikipedia: you have this box on the right side where you can find information like population figures: http://en.wikipedia.org/wiki/Berlin. What's in this box might even be redundant to what is written in the text, but it makes it much nicer to (skim) read the document.

Ideally, I want this infobox to contain a tabular and I'd like it to be placed in the margin, but reaching inside the paragraph with the text floating around the box. Basically like this:

infobox

Can you tell me what the term for this is and what package I can use for this?

share|improve this question
    
You have induced me to make a low whistle :) I don't know the answer, but I'm looking forward to reading it. –  Ryan Reich Feb 1 '12 at 3:26

1 Answer 1

These are called wrapped illustrations and you can use Donald Arseneau's wrapfig package to create them.

wrapfig provides the environments wrapfigure and wrap-table for typesetting a float at the edge of the text, and making the text wrap around it.

The wrapfigure and wrap-table environments interact properly with the \caption command to produce proper numbering, but they are not regular floats like figure and table, so (as the manual says beware!) they may be printed out of sequence with the regular floats. You use them as follows:

\begin{wrapfigure}{r}{.4\textwidth}
    \includegraphics[width=.4\textwidth]{./path/file}
    %\caption{Wrapped figures}
    \begin{tabular}{ll}
      name & amanda\\
      age  & 25\\
    \end{tabular}
\end{wrapfigure}

If you want to add more information, such as a small table, use a tabular after \includegraphics. The format of the environment command allows for the insertion of an "overhang" amount to push the image into the margin a bit if required. For example

\begin{wrapfigure}{r}[20pt]{.4\textwidth}
  %...
\end{wrapfigure}
share|improve this answer
1  
I think the OP also want this to go into the margin a bit. –  Peter Grill Feb 1 '12 at 3:50
    
@PeterGrill -- thanks, I added a note that the OP can use the optional parameter for overhang to do this, although I don't see this clearly as the image link to the wiki just shows an infobox. –  Yiannis Lazarides Feb 1 '12 at 4:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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