LaTeX forum ⇒ Graphics, Figures & TablesFigures in the margin

Information and discussion about graphics, figures & tables in LaTeX documents.
Posts: 2
Joined: Thu Oct 30, 2008 4:09 pm

Figures in the margin

Postby scdpinto » Sat Jan 10, 2009 3:12 pm


I have what seemed to me a simple problem, but I haven't found any useful hints on all the web.

I would like to set a text with a wide outer margin, and place almost all my figures in this margin (including caption). Now I have no problems putting my pictures or any text in those margins, but a figure environment is a float. And so is a marginal note. There seems to be a constraint there.

What I do not want (and I have found tricks for these), are figures in the text block with their captions in the margin, "wrapped" figures, figures extending into the margin, or only graphics but no floating environment in the margin.

Any ideas will be highly appreciated.
Thanks a lot.

Recommended reading 2021: • •
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Figures in the margin

Postby localghost » Sat Jan 10, 2009 3:41 pm

The solution is given with the caption package. It allows captions for figures or tables outside float environments. Search the manual for the \captionof command. A good example is given in epslatex (Section 22 - Marginal figures, p. 89f). In this context I recommend to use the marginnote package for a more flexible typesetting of marginals. For the case that you are running into trouble, build a minimal working example (MWE) and we will see what we can do.

Best regards and welcome to the board
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Posts: 2
Joined: Thu Oct 30, 2008 4:09 pm

Figures in the margin

Postby scdpinto » Sat Jan 10, 2009 9:07 pm

Thanks a lot for your very quick reply!

And it works, too. The \captionof (caption-outside-float) command is a feature of the newer versions of the caption package I was not aware of. If you only need the functionality of this command (as a memoir class user I don't need the rest, for instance), you can load the "lighter" package capt-of, which has no other features.

For the record (in case people are interested in doing the same thing), calling the package is as simple as \usepackage{capt-of} in your preamble. And to place a figure in the margin, instead of naively:

\caption{Text of the caption}

(This doesn't work)
You do the following:

\captionof{figure}{Text of the caption}

The same should work for tables as well.
Thanks a lot for the help!

Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 10 guests