1

I tried some tweaking with the \setuphead command, in order to have the sections appear as I wanted. In particular, the subsection titles appear without the section number.

However, when I use \in to reference this subsection, I would like to see the whole number, like I.1 in the following MWE.

\setuppapersize[A4][A4]
\setuphead[section][sectionsegments=section, conversion=Romannumerals]
\setuphead[subsection][margin=1cm, sectionsegments=subsection, conversion=numbers]
\starttext
\section{One}
\subsection[sec:oneone]{One-one}
Text
\subsection{One-two}
Text
\section{Two}
\subsection{Two-one}
Text reference to one-one should be I.1 and it is only 1 : \in[sec:oneone]
\subsection{Two-two}
Text
\stoptext

In this achievable in ConTeXt ?

4

It is certainly achievable in context. The main problem with context is to find out how, as documentation is sparse and if you find example they seldom explain the underlying concepts. The following seems to work, but I have no idea why one has to use sectionconversionset instead of conversion (which doesn't give a roman numeral in the reference). I also don't understand the exact syntax of prefixsegments.

\definestructureconversionset [myset]
 [
   Romannumerals,
   Romannumerals,
   Romannumerals,
 ]
 [numbers]
\setuphead [sectionconversionset=myset]
\setuppapersize[A4][A4]
\setuphead[section][sectionsegments=section]
\setuphead[subsection][margin=1cm, sectionsegments=subsection]
\setupreferencestructureprefix [subsection][default] [prefixsegments=section:*]
\starttext
\section{One}
\subsection[sec:oneone]{One-one}
Text
\subsection{One-two}
Text
\section{Two}
\subsection{Two-one}
Text reference to one-one should be I.1 and it is only 1 : \in[sec:oneone]
\subsection{Two-two}
Text
\stoptext 

enter image description here

Side remark:

Imho it would be more context-like if you would use \startsection / \stopsection

  • I completely agree that the documentation is scarce and not very well organized. It would be great if a ConTeXt-guru could create a big tutorial for making a totally custom layout, with this kind of modifications, and deeply explained a concept at each part of the tutorial... – A. Licari Jul 23 '16 at 15:39
  • The conversions are explained in the \definestructureconversionset page. The syntax for prefixsegments is begin level:end level, here section:* means »beginning from section all the way down«. – Henri Menke Aug 23 '16 at 12:25

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.