7

I find it hard to chose between tags {wrap} and {floats} for questions like:

{wrap} (× 71 of which 15% are mine) is about formatting an object (e.g. images) so that it is surrounded by text

{floats} (× 1335) is about the floating environments figure, table and other, custom-defined floats, and concerns issues such as positioning, labelling, captioning, indexing and listing of said floats. For questions specifically about formatting a float caption, consider using {captions}.

I thought long about this and I consider {wrap} now a subsection of the larger family {floats} where the latter also includes \linewidth wide floats. On the other hand, TeX-learners coming from CSS will more readily use the term floating instead of wrapping.

I am eager to learn how others see this and if tagging practices should be changed for this type of questions.

Interestingly and by means of reference, Contradictory tag wiki entries: {floats}, {tables}, {figures} was recently discussed here, but this did not encompass {wrap}.

3 Answers 3

12

Since 'float' has a technical definition in TeX which is well defined: an object whose placement is determined algorithmically by TeX itself, (subject to parameters given by the user), it's not the case that should be a subtag of in the general sense.

The tag should be used for questions involving wrapping text around other elements, usually images. In these cases, the tag will usually not apply, since by definition you can't wrap text around something the placement of which TeX (and not you) is responsible for.

With respect to the questions you link to, I would say that the first question deals with both floating objects and wrapped text, so both tags are appropriate. In the second question, the tag is inappropriate since the question does not deal with what TeX calls a 'float'.

5
  • I am sorry to say that I am still confused. If I understand you correctly, {floats} should be reserved for objects that are automatically placed by TeX, not oneself. {wrap} then remains for the other objects. Furthermore, mind you that the {floats} tag definition is stated in LaTeX terms that do not necessarily apply to ConTeXt. Sep 13, 2013 at 6:59
  • @SergeStroobandt We have many more examples of LaTeX-named tags with a LaTeX-specific description, and we freely use them for ConTeXt questions. There's an open discussion about it, the consensus seems to be that we really use them even when they "do not fit well", especially to avoid tag duplicates, but it is a lot my opinion, which is not confirmed in that question. The floats are basically a TeX-core phenomenon hence it applies to ConTeXt as well.
    – yo'
    Sep 13, 2013 at 8:38
  • Alan, on the other hand, notice that figure is a synonym of floats, therefore one naturally includes it when speaking about wrapped figures.
    – yo'
    Sep 13, 2013 at 12:06
  • @tohecz This is a problem with the TeX definition of 'figure' vs. the everyday definition. The figure tag is intended to refer to the floating environment called figure and not the everyday usage that just means roughly 'image'. Whether or not posters recognize this difference is of course another matter...
    – Alan Munn
    Sep 13, 2013 at 17:18
  • 1
    @SergeStroobandt You do understand correctly. The issue of differences between ConTeXt and LaTeX is, as tohecz suggests, somewhat open for discussion. But in the ConTeXt wiki, such objects are still referred to as floats, so at least in this case the tag can be used for both formats without much difficulty.
    – Alan Munn
    Sep 13, 2013 at 17:26
7

The confusion between the distinction between {wrap} and {float} is an instance of the confusion caused by the difference in terminology between LaTeX and ConTeXt.

LaTeX has a separate environment for wrapfigure and figure while ConTeXt treats both as instance of float and the behavior is chosen based on the value of the location key. Neither one is right, nor the other wrong. Such decisions are design choices, and LaTeX and ConTeXt authors chose differently.

The situation with other tags is no better:

  • {lists} in LaTeX is a generic tag to describe itemize, description, and enumerate. In ConTeXt, all are implemented using itemgroups environment. ConTeXt has a description and enumerate environment but they mean something completely different: enumerate is similar to theorems in LaTeX, and description to, well, unnumbered theorems.

  • {lists} in ConTeXt refers to what LaTeX calls {toc}: List of Figures, List of Tables, List of Blah, are all implemented using list environment in ConTeXt.

In my opinion, it basically boils down to this: many tags on this site are named after the LaTeX environment that implements them so that it is easier for users to find the right tag. Given that 99.9999% of users on this site are LaTeX users, that is the right thing to do. Either we (the ConTeXt users) create a new tag for everything {context-hanging}, {context-list}, {context-enumeration}, {context-registers}, {context-marking}, {context-itemize}, and so on; or accept the fact that the tags of many ConTeXt questions will not make sense to ConTeXt users (like the {wrap} tag).

1
  • Thanks, Aditya for adding this clarification.
    – Alan Munn
    Sep 16, 2013 at 1:36
5

A LaTeX float (or what the tex primitive level calls inserts) is feature of page breaking. When breaking up the document into pages certain units of the document that have been saved in special boxes can be moved from one page to another to achieve good page breaks.

Note that this moving process only uses the size of the box it is independent of any content inside the box. LaTeX has two default floating environments, figure and table figure is often used for included images and table is often used for tabular material, but LaTex doesn't actually care, either can take arbitrary LaTeX content.

Wrapping is a feature of line breaking, not page breaking. It is adjusting the paragraph shape so that some lines of text are shorter to make space, usually for an included image.

As can be seen from the above, from an implementation standpoint and are essentially unconnected. They are only related because an author, when choosing to include an image, has some choices (possibly automated) of whether to fit the image to the text by wrapping text around it or by floating the image to find a good place.

4
  • Would that, by any chance, be the reason why wrapping in TeX near a page end always goes so horribly wrong? Sep 14, 2013 at 21:22
  • 2
    @SergeStroobandt it's tricky, the model is that the paragraph line breaker breaks the text into lines onto a potentially infinite scroll and then asynchronously the page breaker chops off bits of that scroll, adds floats and footnotes and page head and foot and ships out a page. There is no feedback from the page breaker to the line breaker so to get a different line break algorithm at a page break takes a lot of ingenuity and lateral thinking. It's not surprising it often goes wrong, it's surprising it ever works:-) Sep 14, 2013 at 21:25
  • User Aditya accomplished just that in ConTeXt. Sep 14, 2013 at 22:25
  • 2
    that's using \dimexpr(\pagegoal-\pagetotal-2\lineheight wrapfig does basically the same calculation in latex, it can be wrong sometimes:-) (due to the asynchronous nature of page breaking, \pagetotal isn't a totally reliable test outside the output routine) (not looked in detail at th econtext version, just flicked over the answer your referenced) Sep 14, 2013 at 22:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .