Difference between revisions of "Command/definestructureconversionset"

From Wiki
Jump to navigation Jump to search
m (Text replace - "== Help from ConTeXt-Forum ==" to "== Help from ConTeXt-Forum == All issues with:")
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{Reference
 
{{Reference
|name=definestrcutureconversionset
+
|name=definestructureconversionset
 
|attributes=
 
|attributes=
 
}}
 
}}
  
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>definestructureconversionset</syntax>
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
   <tr>
 
   <tr>
     <td colspan="2" class="cmd">\definestrcutureconversionset<span class="first">[name]</span><span class="second">[...,list,...]</span><span class="third">[default]</span>
+
     <td colspan="2" class="cmd">\definestructureconversionset<span class="first">[name]</span><span class="second">[''conversion'',''conversion'',...]</span><span class="third">[''default'']</span>
 
     </td>
 
     </td>
 
   </tr>
 
   </tr>
Line 13: Line 15:
 
   <tr valign="top" class="first">  
 
   <tr valign="top" class="first">  
 
     <td>[name]</td>
 
     <td>[name]</td>
     <td><i>Name of the conversion set</i></td>
+
     <td>''Name of the conversion set''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[list,...]</td>
+
     <td class="cmd">[''conversion'',''conversion'',...]</td>
     <td><i>List with explicit settings for certain headings</i></td>
+
     <td>''Conversions for {{cmd|part}}, {{cmd|chapter}}, {{cmd|section}}, etc.''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="third">  
 
   <tr valign="top" class="third">  
     <td class="cmd">[default]</td>
+
     <td class="cmd">[''default'']</td>
     <td><i>Default setting if no explicit conversion is set</i></td>
+
     <td>''Default setting if no explicit conversion is set''</td>
 
   </tr>
 
   </tr>
 
<!-- -->
 
<!-- -->
Line 35: Line 37:
 
The command defines conversion of internal counters.
 
The command defines conversion of internal counters.
  
The first argument is just the name which is used as argument for sectionconverionset in <code>\setuphead</code> for prefixconverionset in <code>\setupcaption</code>, <code>\setupenumeration</code> etc. The name of the conversion can be prefixed with the name of a sectionblock, e.g. <code>\definestructureconverionset[bodypart:myconversion][A,I,n,R][numbers]</code>.
+
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]}}.
 
   
 
   
With the second argument you can set a conversion of the counter for the headings, the list starts always with the <code>\part</code> level and continues with <code>\chapter</code> etc. but it’s possible leave entries empty.
+
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.
 
   
 
   
 
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.
 
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.
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
+
<context mode=mkiv source=yes>
 +
% mode=mkiv
 +
 
 +
\setuppapersize[A5]
 +
 
 +
\definestructureconversionset[myconversion]
 +
    [A,  % part: capital letters
 +
    KR,  % chapter: small caps Roman
 +
      ,  % section: none defined (use fallback)
 +
    m,  % subsection: medieaval, a.k.a. oldstyle
 +
    R]  % subsubsection: capital Roman
 +
    [r]
 +
 
 +
\setupheads
 +
    [part,chapter,section,subsection,subsubsection]
 +
    [before={}, after={},
 +
    sectionconversionset=myconversion]
 +
 
 +
\part{Part}
 +
\chapter{Chapter}
 +
\section{Section}
 +
\subsection{Subsection}
 +
\subsubsection{Subsubsection}
 +
</context>
 +
 
 +
 
 +
Be careful not to let a whitespace after {{code|myconversion}}, or it is taken as a part of it :
 +
 
 +
<context mode=mkiv source=yes>
 +
% mode=mkiv
 +
 
 +
\definestructureconversionset[questionNums][n,n,a,a][n]
 +
\defineenumeration[question]
 +
\setupenumeration[% some setups
 +
                  style=normal,
 +
                  numberconversionset=questionNums % this does not work : add a comma or close bracket here
 +
                ]
 +
</context>
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
* {{cmd|defineconversion}}
[http://http://www.ntg.nl/pipermail/ntg-context/2012/065245.html Wolfgang's answer in the mail archive]
+
* [[:Category:Command/Conversions|Command/Conversions]]
  
== Help from ConTeXt-Forum ==
+
== Help from ConTeXt-Mailinglist/Forum ==
 
All issues with:
 
All issues with:
 
{{Forum|{{SUBPAGENAME}}}}
 
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Commands|definestrcutureconversionset]]
+
[[Category:Command/Conversions|definestructureconversionset]]
 +
[[Categry:Command/MkIV only|definestructureconversionset]]

Latest revision as of 14:33, 13 October 2019

\definestructureconversionset

Syntax (autogenerated)

Syntax

\definestructureconversionset[name][conversion,conversion,...][default]
[name] Name of the conversion set
[conversion,conversion,...] Conversions for \part, \chapter, \section, etc.
[default] Default setting if no explicit conversion is set

Description

The command defines conversion of internal counters.

The first argument is just the name which is used as argument for sectionconversionset in \setuphead, and for prefixconversionset in \setupcaption, \setupenumerations etc in MkII, and for numberconversionset for the same purpose in MkIV. The name of the conversion can be prefixed with the name of a sectionblock, e.g. \definestructureconversionset.

With the second argument you can set a conversion of the counter for the headings. The list always starts at the \part level and continues with \chapter etc. but it’s possible to leave entries empty.

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.

Example

% mode=mkiv

\setuppapersize[A5]

\definestructureconversionset[myconversion]
    [A,   % part: capital letters
     KR,  % chapter: small caps Roman
      ,   % section: none defined (use fallback)
     m,   % subsection: medieaval, a.k.a. oldstyle
     R]   % subsubsection: capital Roman
    [r]

\setupheads
    [part,chapter,section,subsection,subsubsection]
    [before={}, after={}, 
     sectionconversionset=myconversion]

\part{Part}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}


Be careful not to let a whitespace after myconversion, or it is taken as a part of it :

% mode=mkiv

\definestructureconversionset[questionNums][n,n,a,a][n]
\defineenumeration[question]
\setupenumeration[% some setups
                  style=normal,
                  numberconversionset=questionNums % this does not work : add a comma or close bracket here
                 ]

See also

Help from ConTeXt-Mailinglist/Forum

All issues with:

definestructureconversionset