I understand the use and purpose of floats containing figures and tables. It makes a lot of sense if you think about the overall aesthetics of the page. However I find the graphical distance between the point of reference and the figure itself is often distracting and cumbersome to read. When a figure is referenced more than once, or represents a standalone item in the document this is clearly a good compromise. However there are times where an illustration is part of the discourse (think about an illustration aiding a subtle point in an explanation) and putting it in a float feels unnatural and distracting.

Currently, when I feel an inline figure is more appropriate I just wrap the \includegraphics or tikz code in a center environment. Are there better ways?

More specifically: does the center environment put the correct spacing? Which penalties should be set (and how) around the picture to avoid unpleasant pagebreaks?

  • 4
    This feels really about design not TeX per se. As already noted, floats are common for scientific work, although not everyone uses them (see Edward Tufte's work for example). – Joseph Wright Aug 26 '14 at 13:19
  • 6
    This question appears to be off-topic because it is about document design rather than about TeX, LaTeX, and friends. – Mico Aug 26 '14 at 13:28
  • 1
    I think you should ask this typographic question on graphicdesign.stackexchange.com. – Mensch Aug 26 '14 at 13:52
  • 2
    My criterion is that a graphic element that can't float doesn't need a caption either. If a caption is necessary, then the object should float. – egreg Aug 26 '14 at 14:08
  • 3
    I rephrased the question so it is more focused on TeX issues. I am interested in the definition of an environment for inline illustrations that sets up the right spacing, alignment and penalties. – Bordaigorl Aug 26 '14 at 14:47

I am not too sure if getting advice from TeX hackers on typography is good advice but certainly is solid advice on anything related to LaTeX. My own preference is to mix both floating and non-floating figures and I like non-floating figures. Here are some samples:

enter image description here

Here is the same "style" for an arts page

enter image description here

Here is one "Life Magazine style"

enter image description here

These and many others produced via the doc/docstrip method for .dtx files in honour of David Carlisle and Frank Mittelbach!

As for the technical advice a \medskip before and after the figure is sufficient. Use the captionof of package caption for the caption and the spacing for the caption will be taken care of.

| improve this answer | |
  • 1
    I am still waiting with my credit card at hand. When do you release this? – percusse Aug 26 '14 at 17:44
  • 2
    @percusse It is still very buggy for general release and I am trying to get it to work with XeLaTeX and pdfLaTeX so I am in polyglossia land at the moment. – Yiannis Lazarides Aug 26 '14 at 17:59
  • @YiannisLazarides I enjoy also use both: float and fixed figures. By example, for create a portrait with a logo, is better, easier to do with fixed not floating objects. I completely ignore if the enforce the position of the floatings or waive the environments for floating objects cause any problems to the compiler. – Aradnix Aug 26 '14 at 20:43
  • +1 The latex figure placement algorithm is so not optimised for this kind of document:-) – David Carlisle Aug 27 '14 at 12:30
  • @DavidCarlisle We need to give some food for thought to the LaTeX3 Team:) – Yiannis Lazarides Aug 27 '14 at 19:46

The answers depend a lot on what kind of document you are producing.

LaTeX's float placement algorithm is a lot better and has a lot more parameters than many users believe. See Frank's description One of the most common problems of course is that when things don't go quite as people expect they use [h] which makes it much more likely that the figure can not be positioned, and that it floats to the end of the document.

That said, it is just an algorithm, coded in TeX, using the memory constraints of the 1980's (and to a lesser extent updated for latex2e in the 1990's). If you are writing a thesis, that is, a single document which may be worked on over a period of months or years, you could contemplate taking more manual control over the figure positioning. If you are prepared to rewrite text and adjust figure scaling or order, in order to make things fit while maintaining good page breaks, then you should expect to be able to make a better job than an automatic placement. However this does introduce a very high additional overhead in the document production, that after potentially any edit you need to adjust the figure placement by hand.

If you are setting up typesetting rules for multiple documents, manually placing all figures is rarely an option and allowing latex to place them is usually the best choice.

If you are positioning things by hand there are two possible styles.

You may explicitly word the document on the basis that images (like equations) are non floating and are part of the text narrative. So the text can refer to "the figure below" etc, in this case figures do not need captions (just as equations do not) and a center environment is probably a good choice.

Or, you may want a look that, to the reader, looks like a document with captioned, floating, figures, but where you have taken control of the float positioning by hand just as a technical production detail. Here you do not just want center as it will not keep the image and caption together, you need a minipage or the float package H option to produce an unbreakable box into which you can place the image and caption. Arranging that such captioned boxes come in sensible places such as top of page by hand would be a lot of work, but not impossible, if you want absolutely full control over your document.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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