Hello,

one of the main features of both ConTeXt and LaTeX over plain TeX
is their heavily "object-oriented" approach to source writing,
giving a large set of useful tools to build well-structured
documents.

There is though one aspect which has not been addressed in either:
structuring of the sections. One still uses \chapter, \section,
\subsection etc to denote the start of any of these, while
structured writing would call for \startchapter ... \stopchapter,
\startsection ... \stopsection etc.

My proposal is to switch to such a method, while still retaining
compatibility with the old-style sectioning (maybe we can use some
flag like the one used to left left/right alignment use the
_correct_ term --what was the switch name?).

How should it work:

\startchapter[optional reference name]

Possible stuff before the title (e.g. an epigraph)

\title{Title of the chapter}
Optional commands to set alternative forms of the title (see
below)

Content

\stopchapter

Some pluses that would come from this approach, apart from
intrinsic structure:

* easy way to know where a section starts and ends (so as to be
able to put both starting and ending page in the ToC, for example).

* easy way to set different titles for ToCs, running heads, (PDF)
bookmarks etc. Consider the following hierarchy of titles:

title listtitle markingtitle bmtitle

Setting one of them would also set the subsequent ones (e.g.
setting the title would set all forms, setting the listtitle would
set the list, marking and bm title, but not the title). This is at
times needed because running heads usually need shorter texts, and
one cannot put special stuff (e.g. math) in bookmarks.
\title would also actually typeset the title. Note that none of
the commands \title, \listtitle, \markingtitle, \bmtitle should
write anything to the .tuo file; this ought to be done by the
\stop<section-name> command, which would save all of them together
with the appropriate counter values and beginning/ending page.

* easy way to put things before the title (e.g. an epigraph) while
still within the structure of the section.

* also comes from the above: currently, when using the /XYZ method
for PDF references, link targets end out-of-the-window because the
TeX cohordinate used is that of the baseline. This means that the
visible part of the page does not include the target reference
(which is rather uncomfortable). Instead, with the new approach
the mark could be set "right before everything else, but still
within the correct structure", with optimal PDF navigation.

* in editors that allow folding: proper folding of whole sections.

Hans, do you think you can implement this easily?

-- 
Giuseppe "Oblomov" Bilotta

Reply via email to