1

I am trying to have simple subsections titles like "Chapitre 1", "Chapitre 2" etc... with corresponding mark being the number only, but my example below seems to not give correct markings output in header (5-5 on first page, instead of 1-3 or 1-4 for example). Simple MWE follows to illustrate the (wrong) implementation for this. I think the marking= parameter does not like a command value (title= parameter seems fine with it). The idea is to avoid inputting the consecutive numbers manually but let the system to compute them for me.

\definenumber[chapternum]

\setupheads[
  number=yes,
  align=center]

\setuphead[subject][
  insidesection={\setnumber[chapternum][1]}]

\setuphead[subsection][
  insidesection={\incrementnumber[chapternum]}]

\startsetups[head1]
\getmarking[subject][top]\space - \getmarking[subject][bottom]\space - \pagenumber
\stopsetups

\startsetups[head2]
\getmarking[subsection][top]\space - \getmarking[subsection][bottom]\space - \pagenumber
\stopsetups

\setupheadertexts%
 [\setups{head1}]
 [\setups{head2}]

\definenumber[chapternum]

\starttext

\startsubject[marking={M1}, title={Subject 1}]

\startsubsection[marking={\getnumber[chapternum]}, title={Chapitre \getnumber[chapternum]}]

\input knuth

\stopsubsection

\startsubsection[marking={\getnumber[chapternum]}, title={Chapitre \getnumber[chapternum]}]

\input knuth

\stopsubsection

\startsubsection[marking={\getnumber[chapternum]}, title={Chapitre \getnumber[chapternum]}]

\input knuth

\stopsubsection

\startsubsection[marking={\getnumber[chapternum]}, title={Chapitre \getnumber[chapternum]}]

\input knuth

\stopsubsection

\stopsubject

\startsubject[marking={M2}, title={Subject 2}]

\startsubsection[marking={\getnumber[chapternum]}, title={Chapitre \getnumber[chapternum]}]

\input knuth

\stopsubsection

\stopsubject

\stoptext 
1

Not sure what you want to achieve...

\startsetups[head]
    \getmarking[subsectionnumber][top]
\stopsetups

\setupheadertexts
  [\setups{head}]

\starttext
    \startchapter[title={Chapter 1}]
        \dorecurse{10}{
            \startsubsection[title={Subsection #1}]
                \input knuth
            \stopsubsection
        }
    \stopchapter
\stoptext
  • Thanks Luigi. I simply wish to have centered headings whose title is some label ("Chapitre") followed with a number (from 1 to N) (eventually output with some conversion) and a mark which is that number. Of course I would like to avoid inputting the numbers myself. – Joseph Oct 30 '15 at 21:31
  • Tried: \setuplabeltext[subsection=Chapitre] \setuphead[subsection][align=center, distance=0pt] and simply \startsubsection and \stopsubsection. In previous attempts for this I missed the distance parameter. Without it the title was not perfectly centered. – Joseph Oct 30 '15 at 21:51

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.