# ConTeXt: Block vs Environment vs Group

I've seen these all used somewhat interchangeably. What's the difference?

edit: I've seen many \start..stop blocks referred sometimes referred to as environment. For example the verbatim environment for \start...stoptyping block. Some are even ambiguously named like \start...startsectionblockenvironment. Then there's the big picture. Is \start...stoptext an environment or a block? Excursions says this in section 40.5, Floating Blocks:

A block in CONTEXT is a text element, for example a table or a figure that you can process in a special way. You have already seen the use of \placefigure and \placetable. These are both examples of floating blocks.

Where does that leave regular paragraphs? From the wiki I get the sense that colloquially blocks imply 'more' vmode whereas environments can be either vmode or hmode. So \start..stoptextbackground is an environment rather than a block because it can be used inline?

What do you call a clump of text that forms a semantic element, a higher-level view than characters, glue and boxes? On a tangent I came across TeX 'groups' and, knowing nothing of them, decided perhaps they could be related to this question.

• Could you please give an example for each (what you refer to)? If I hear environment in ConTeXt I am thinking about environment files (as opposed to a LaTeX context where I would think of environment macros) which have nothing to do with grouping (which I would associate with TeX groups). – TeXnician Dec 5 '18 at 21:00

In the manual a \start...\stop pair is usually called environment. I don't think ConTeXt has a notion of a block. There is the concept of sectionblock but that is just another name for sectioning level (chapter, section, subsection, etc.).

Taking the excursion as a reference for terminology is a bit dangerous, because it was not written by Hans. Therefore the phrases used in there do not necessarily reflect the names in the ConTeXt core. I would not call it “floating blocks” but “floating objects” or just “floats”. It's in the details just calls them “floats”.

For clumps of text the regular typographic classification applies. Glyphs make up words, words make up lines, lines make up paragraphs, paragraphs make up sections (or sectionblocks in ConTeXt-speak), sections make up the document.

TeX's grouping is related to environments. Usually environments for a group, i.e. the contents of a \start...\stop pair are enclosed in a lexical group (exceptio probat regulam).

Now \start...\stoptext takes a special place. \starttext does not start a new level grouping and therefore \stoptext does not end the group. This has to do with the engine internals as typesetting a long document within a lexical group would overflow TeX's memory. There are other environments which do not form a group but they are rare.

• Oh, groups are formed by {,}! Where do itemgroups fall into this typographic classification, in relation to lines and paragraphs? And paragraphs and sectionblocks are both groups? – user19087 Dec 6 '18 at 4:56
• *itemgroups and other non-paragraph environments. – user19087 Dec 6 '18 at 5:02
• @user19087 An item in an itemgroup is just a paragraph with indentation and a symbol in front of the first line. In Plain TeX, the definiton of \item is actually just \par\hang\textindent which shows more clearly that it is just a regular paragraph with hanging indentation. – Henri Menke Dec 6 '18 at 7:54
• So do the regular typographic classifications form implicit groups, i.e. words, lines, paragraphs, and sections, i.e. is it groups "all the way down"? – user19087 Dec 6 '18 at 17:37