From: Simon Pepping To: Sebastian Rahtz Subject: Re: jadetex 2.8 Date: Mon, 27 Dec 1999 10:29:39 +0100 Sebastian, Problem with nested displaygroups Situation: simple-page-sequence with page-n-columns: 2, display-group with span: 2, display-group. Here jadetex has a major problem with the nested display groups: JadeTeX WARNING: specifying column spans for floats not supported JadeTeX WARNING: specifying column spans for floats not supported (\end occurred inside a group at level 10) The attached files span.dsl and span.sgml illustrate the problem. The stylesheet span.dsl offers 11 options, selected by setting the variable 'selection' to a value between 1 and 11. See the comment in the style sheet for explanation. The problem is caused by the fact that a display group with save > 1 ends the multicols environment. The nested display group tries to do that again. Its end opens a new multicols environment, although none was closed. I have tried to rethink the strategy with multicols. One problem is that the DSSSL spec applies span to page-sequence. While that is not implemented, it is applied to simple-page-sequence with page-n-columns, but I have no specification of that. So I have devised my own scenario: I have assumed that both display-group and paragraph are to listen to span. Only display-groups and paragraphs at top level can change the span. Every toplevel display-group and paragraph with span > 1 will start a new multicols environment. Problem: One could specify span for all children at the simple-page-sequence level, causing each toplevel display-group and paragraph to start a new multicols environment. This seems a silly style specification, so I will not pay attention to it. That leads me to the following algorithm: begin: if attoplevel && pageNcols > 1 if span > 1 if newnumcols > 1 // span != pageNcols begin multicols // local, open at nesting level 1 end: if attoplevel && pageNcols > 1 if span > 1 if newnumcols > 1 // span != pageNcols end multicols // local, close at nesting level 1 Problem: There is always a multicols at toplevel if pageNcols > 1, started by the simple-page-sequence, but often it will remain empty. Similarly between successive toplevel paragraphs or display-groups which specify a span. Solution: Delay starting a multicols to the actual start of the first paragraph or display-group. Similarly after a spanned paragraph or display-group. That modifies the algorithm as follows: begin: if attoplevel && pageNcols > 1 if span > 1 if inmulticols end multicols // toplevel, close at nesting level 0 if newnumcols > 1 // span != pageNcols begin multicols // local, open at nesting level 1 else if span = 1 && !inmulticols begin multicols // delayed opening of toplevel, // toplevel, open at nesting level 0 end: if attoplevel && pageNcols > 1 if span > 1 if newnumcols > 1 // span != pageNcols end multicols // local, close at nesting level 1 Problem: What would be expected from a sequence specifying a span for its children, e.g. the following sosofo: (make simple-page-sequence page-n-columns: 4 (make sequence span: 2 (make paragraph) (make paragraph) (make paragraph))) Under the scheme proposed here each paragraph would create its own multicols environment. Is this the intended behaviour, or should sequence also listen to span? Notes about the implementation: \@displaylevel can have three values: 0: at top level. Display groups and paragraphs which see this value are at toplevel. Their start may close or open a multicols. They set the value to 1 after their own \begingroup. Then they may open a multicols. 1: within a top level display group or paragraph. Their start sets the value to 2 after their own \begingroup. End of display groups and paragraphs which see this value may close a multicols. 2: below top level. Display groups and paragraphs which see this value do nothing with multicols. The value is automatically decremented by TeX's grouping. A simple switch \if@toplevel does not do, because it is false when entering the end of a toplevel display group or paragraph. \@SavedSpan contains the localized value of the span. It is required by the end of display groups and paragraphs to see if they should close a multicols. The toplevel multicols is closed by the end of a simple-page-sequence. The code in ncols.tex goes a long way towards a solution, and it works in normal cases. But I am very uncertain about the many cases that the affected \Par definitions serve. Where in the if branches should I insert my code? For now I just inserted it at a suitable place. See the lines % SP for my changes. Note: \Seq may also open a multicols environment. I have not dealt with it; under the scheme proposed here this possibility might be removed.