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 have two figure/caption related questions.

Firstly, in many textbooks, it is customary to put thin figures (along with their captions) entirely in the outer margin of the page. What is the most elegant way of doing this in LaTeX?

Secondly, for wider figures many books set the figure to be the width of the page (so spewing out into the outer margin) and then place the caption in the margin space below the figure. How can one achieve this effect in LaTeX?

share|improve this question
1  
This is one of those things where I think that you often find yourself trying to do this kind of complex layout, you may find that life would be easier with Context. –  Charles Stewart Aug 30 '10 at 20:49
    
Have you tried the caption package? I think this package do whatever you want. –  Vahid Damanafshan Aug 31 '10 at 1:51
2  
@charles: I'm certainly not against such comments by any means whatsoever, but without an example from you demonstrating ConTeXt's superiority here, it's not a very compelling argument. @vahid: no, caption only styles the figure captions, not the figures themselves. –  Will Robertson Aug 31 '10 at 8:59
add comment

2 Answers

up vote 15 down vote accepted

You can use the the tufte-book class. It has margin figures, margin notes as well as full width environments. In general it has the general style you are looking for. It also has a fullwidth environment for larger figures - as you describe.

share|improve this answer
add comment

Figures in margins

I haven't done this for years, but when I did I used the wrapfig package. Something like

\documentclass[twoside]{article}
\usepackage{wrapfig,calc,lipsum}
\newlength{\marginspace}
\setlength{\marginspace}{\marginparwidth+\marginparsep}
\setlength{\wrapoverhang}{\marginspace+\columnsep}
\begin{document}
\lipsum[1]
\begin{wrapfigure}{o}{\marginspace}
   \centering
   \rule{4em}{4em}
   \caption{Black box.}
   \label{fig:bb}
\end{wrapfigure}
\lipsum[2]
\end{document}

Full-width figures

This one is easier. Using the changepage package,

\documentclass{article}
\usepackage{changepage,lipsum,calc}
\newenvironment{wide}{%
  \strictpagecheck % just in case
  \begin{adjustwidth*}{0pt}{-\marginparsep-\marginparwidth}
}{%
  \end{adjustwidth*}
}
\begin{document}
\lipsum
\begin{wide}
\lipsum
\end{wide}
\end{document}

Of course, you could also use a command instead of an environment if you prefer.


While the code above is fairly small (in the scheme of things) the floatrow package provides an interface around such elements (and much more).


Update: I don't personally use floatrow, so I don't know if it has its own methods for doing something like this, but here's an example of putting a margin caption beneath a wide figure:

\makeatletter
\newcommand\margincaption[1]{%
  \par
  \setbox\@tempboxa=\hbox{\parbox{\marginparwidth}{\caption{#1}}}
  \@tempdima=\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax
  \par\null\hfill\usebox\@tempboxa\par
  \vspace*{\dimexpr-\@tempdima-\baselineskip\relax}
}
\makeatother
...
\lipsum[1]
\begin{figure}[tp]
\begin{wide}
\rule{15cm}{1em}
\margincaption{A black long line with lots of explanation so it fills up some space.}
\end{wide}
\end{figure}
\lipsum[2]
\end{document}
share|improve this answer
    
The floatrow package seems to do most of what I need. However, I wonder how, with a wide/full width environment, the caption can be placed in the outer margin below the figure? –  Freddie Witherden Aug 31 '10 at 9:17
add comment

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.