https://wiki.contextgarden.net/api.php?action=feedcontributions&user=Adrien+Licari&feedformat=atomWiki - User contributions [en]2024-03-28T12:58:09ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=Command/definestructureconversionset&diff=23423Command/definestructureconversionset2017-07-18T08:50:26Z<p>Adrien Licari: Add the case of enumerations in MkIV, as was discussed on the texexchange forum</p>
<hr />
<div>{{Reference<br />
|name=definestructureconversionset<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\definestructureconversionset<span class="first">[name]</span><span class="second">[''conversion'',''conversion'',...]</span><span class="third">[''default'']</span><br />
</td><br />
</tr><br />
<!-- --><br />
<tr valign="top" class="first"> <br />
<td>[name]</td><br />
<td>''Name of the conversion set''</td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[''conversion'',''conversion'',...]</td><br />
<td>''Conversions for {{cmd|part}}, {{cmd|chapter}}, {{cmd|section}}, etc.''</td><br />
</tr><br />
<tr valign="top" class="third"> <br />
<td class="cmd">[''default'']</td><br />
<td>''Default setting if no explicit conversion is set''</td><br />
</tr><br />
<!-- --><br />
</table><br />
<!--<br />
* <span class="cmd" class="first"> name</span> = name of the conversion set<br />
* <span class="cmd" class="second">list</span> = list with explicit settings for certain headings<br />
* <span class="cmd" class="third">default</span> = default setting if no explicit conversion is set<br />
--><br />
<br />
== Description == <br />
<br />
The command defines conversion of internal counters.<br />
<br />
The first argument is just the name which is used as argument for {{code|sectionconversionset}} in {{cmd|setuphead}}, and for {{code|prefixconversionset}} in {{cmd|setupcaption}}, {{cmd|setupenumerations}} etc in MkII, and for {{code|numberconversionset}} for the same purpose in MkIV. The name of the conversion can be prefixed with the name of a sectionblock, e.g. {{code|\definestructureconversionset|[bodypart:myconversion][A,I,n,R][numbers]}}.<br />
<br />
With the second argument you can set a conversion of the counter for the headings. The list always starts at the {{cmd|part}} level and continues with {{cmd|chapter}} etc. but it’s possible to leave entries empty.<br />
<br />
With the third argument one can set a default value which is used when no value for a heading is set with the second argument.<br />
<br />
== Example ==<br />
<context mode=mkiv source=yes><br />
% mode=mkiv<br />
<br />
\setuppapersize[A5]<br />
<br />
\definestructureconversionset[myconversion]<br />
[A, % part: capital letters<br />
KR, % chapter: small caps Roman<br />
, % section: none defined (use fallback)<br />
m, % subsection: medieaval, a.k.a. oldstyle<br />
R] % subsubsection: capital Roman<br />
[r]<br />
<br />
\setupheads<br />
[part,chapter,section,subsection,subsubsection]<br />
[before={}, after={}, <br />
sectionconversionset=myconversion]<br />
<br />
\part{Part}<br />
\chapter{Chapter}<br />
\section{Section}<br />
\subsection{Subsection}<br />
\subsubsection{Subsubsection}<br />
</context><br />
<br />
<br />
Be careful not to let a whitespace after {{code|myconversion}}, or it is taken as a part of it :<br />
<br />
<context mode=mkiv source=yes><br />
% mode=mkiv<br />
<br />
\definestructureconversionset[questionNums][n,n,a,a][n]<br />
\defineenumeration[question]<br />
\setupenumeration[% some setups<br />
style=normal,<br />
numberconversionset=questionNums % this does not work : add a comma or close bracket here<br />
]<br />
</context><br />
<br />
== See also ==<br />
* {{cmd|defineconversion}}<br />
* [[:Category:Command/Conversions|Command/Conversions]]<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Conversions|definestructureconversionset]]<br />
[[Categry:Command/MkIV only|definestructureconversionset]]</div>Adrien Licari