Talk:LaTeX/Floats, Figures and Captions

Code wrapfloatbox not working
For some strange reason, the code in wrapfloatbox gives me a number of errors, of which the most important seems to be: Missing \begin{document}... Apparently, something goes wrong with the @ symbol, because in the output the text starts with: simplerule[2]fs@cfont 12 simplerules@capt@@simplerule s@iftopcapt

I couldn't find a way around it yet, but in any case it would be nice to make the code self-contained. To run that example, people also have to remember to add the package wrapfig to the preamble.

Text overlapping figures
Can we put a section about how to have a transparent figure legend placed over a full page picture, as this is something I really want to be able to do.

Errors in Wrapping figures
I modified Andy Robert's wrapping.tex according to instructions on additional parameters of wrapping and it did not work. The image was not wrapped, but sticked out of page. I was using latex + dvipdf because pdflatex had problems with .eps file.

If these examples do not work, perhaps, we should remove them? --Derbeth talk 20:14, 2 January 2007 (UTC)


 * yes, the example you tried didn't work. Now I have fixed everything, improving the article. It should be fine now Alessio Damato 15:29, 12 January 2007 (UTC)
 * Thanks! --Derbeth talk 12:43, 13 January 2007 (UTC)

PDF's and .tex sources
I removed mention of .tex sources at the end of this chapter. I think that everything has already been used here, but if you want to link them again, see http://www.andy-roberts.net/misc/latex/latextutorial6.html. --Derbeth talk 20:33, 2 January 2007 (UTC)

Aligning Captions
The captions under figures always are in the centre of the page, regardless of where the figure is. How can this be changed? --Munchkinguy 03:49, 5 July 2007 (UTC)
 * what do you mean exactly? do you want to change the position or the alignment of the captions?? Alessio Damato 15:43, 5 July 2007 (UTC)

Footnotes in Floats
Quite often one (me as well) would like to have footnotes in captions or in the body of a table. For example to explain the variables or the source of the information.

Two information I've found are: for tables: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footintab for captions: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ftncapt

The general (but for some reason disliked) solution is to put everything in a minipage. Should we add this to the page?

placeins
We should mention the package placeins somewhere (it "Defines a \FloatBarrier command, beyond which floats may not pass; useful, for example, to ensure all floats for a section appear before the next \section command.")

inside floats, \centering is better than \begin{center} ... \end{center}
We should mention that somewhere. It's documented at, e.g., : "with the combination of figure and center you get a doublespacing before and after, whereas the combination of figure and \centering only gives you the spacing from figure."

p placement specifier
Controlling placement of full-page figures is a very annoying problem for the unexperienced users. Clear explanation of [p] in this document would be very useful.

Subfloats
Hey I just wanted to mention that subfig package overrides the definition of captions for the KOMA-Script package. Since koma is widely used I thought it should be mentioned here too. The remedy to this is to use the subfigure package, which is much more comprehensive and does not overide the KOMA-Script settings. If no body changes this note here, I will edit the main article and add this. Cheers, Oz.

I think that'd be the prober way, Oz. I'm a LaTeX newbie and I got confused since I don't have a subfig package with subfloats, but a subfigure package using subfigures. Otherwise this article is a great resource. Weeeeeeee, Jack. (10:41, 23 March 2010 JackSchnippes)

The subfigure and subfig packaged are NOT under current developement anymore so I would suggest to replace subfig to caption and subcaption --Nobelium (discuss • contribs) 22:20, 25 September 2011 (UTC)

File:Latex example subfig.png

The shown example picture is quite misleading, as no horizontal spaces between figures are defined in the code itself but are visible in the picture.

141.19.87.180 (discuss)
 * You're right, so I've tweaked the code to match the image as I don't have the source figures. Also in testing this I noticed that the description in the list below the example didn't seem to be quite right, so I changed it to match the behaviour I can produce here.  It didn't 'feel' quite right anyway given the handling of whitespace elsewhere (just in case there could be a difference in implementation I'm using MikTeX 2.9 on Windows XP. ChrisHodgesUK (discuss • contribs) 13:43, 29 February 2012 (UTC)


 * Thanks for your efforts, still I have got one suggestion left: to put "~" into a new line with a comment e. g.  --Escalator (discuss • contribs) 16:14, 5 March 2012 (UTC)


 * I've done this, with an additional note in the comment about line feeds - feel free to tweak it though - I think you're able to as a new user. ChrisHodgesUK (discuss • contribs) 17:18, 6 March 2012 (UTC)


 * Thanks again :-) You are right, I might edit on my own. But still need some time to learn the right approaches and deepen my beginner´s LaTeX knowledge, thus being rather cautios so far :-) Escalator (discuss • contribs) 14:50, 8 March 2012 (UTC)

Changed the subfloat-part according to Nobelium's suggestion. and  are listed as deprecated in the newest (german) version of l2tabu.pdf. -Konteki (discuss • contribs) 10:06, 4 May 2012 (UTC)


 * forgotten [width=\textwidth] on include graphics, because \includegraphics takes a picture size way too big by default and the width must be \textwidth because subfigure is basically a minipage environment and thus \textwidth is already a third of the page's \textwidth Otherwise results in overlapping figures with pdflatex (TexLive 2012 Debian).

i just corrected it

Je ne détiens pas la vérité universelle (discuss • contribs) 10:07, 16 May 2012 (UTC)

I just wanted to mention that I have had many headaches with the subcaption package. It does not seem to play nicely with a lot of templates for academic journals. For example the templates for the Institute of Physics, and the publisher Springer. Despite being deprecated I find myself dropping back to the subfigure package. I think the incompatibilities need to be addressed before subcaption can be recommended for widespread use, alternatively it should be presented as just one option amongst subfigure and subfig.

the specifier
In the examples the  specifier is often used but it isn't accepted as a good specifier. I admit that it should be explaned but it should'n be used in the example. The way I learned to use specifiers is:
 * 1) make your document without specifiers
 * 2) once a chapter is completely written, add the specifier   or   to the figures that aren't placed like you want.
 * 3) if that doesn't help: use the   specifier
 * 4) as last option, if it's still not looking good, you can use  . But if you have to use   a lot, your document is'n well written and contains to much figures compared to the amount of text.
 * That feels like a good approach, but the last comment about the ratio of graphics to text isn't necessarily true - it depends what you're writing, a 3 page paper doesn't give you as much flexibility as a book, for example. ChrisHodgesUK (discuss • contribs) 10:58, 17 May 2012 (UTC)

auto reorder floats
IS there a way to have LaTeX automatically reorder my float numbers based on the order that I reference them? i.e. if I move a reference to Figure 2 up above the reference for figure 1, can I set it up so that I don't have to move the figure to get it to become figure 1? 128.8.211.123 (discuss) 18:24, 6 October 2011 (UTC)

My picture is not where i want it!
Helpers hear this quite often because users don't know what is going on. Would it be a good iea to change the title of this page to Automatic placement of figure and table boxes (or something similar) that it becomes really really obvious why figures/tables are moved. Thoughts? The title needs changing anyway since there is no mention of tables right now. --Johannes Bo (discuss • contribs) 15:18, 16 October 2016 (UTC)

Waste of time
Sorry guys, but working on this wikibook is a real waste of time. If the starters of this book would have thought a few moments about how to structure it, we wouldn't have duplication of stuff. Why is this float placement stuff discussed TWO times when it should be only once? Why is there a separation between figures and tables on this page? Why x? Why Y? Why Z?

Is anybody even reading this? If so, give a short call out. This thing is driving me completely nuts.--Johannes Bo (discuss • contribs) 16:31, 28 October 2016 (UTC)

limit on number of floats
"LaTeX by default can cope with maximum 18 floats" -- this can mislead readers into thinking that their document can't have more than 18 figures. I believe that the limit is only on the number of floats which haven't been placed at any point of time. Please clarify it. Zero0000 (discuss • contribs) 04:55, 10 March 2018 (UTC)
 * The whole page and the whole wikibook needs attention. I slightly mended that part for now. Complete rewrite needed.--Johannes Bo (discuss • contribs) 07:43, 10 March 2018 (UTC)