<?xml version="1.0" encoding="UTF-8"?>

<?context-directive job ctxfile x-setups.ctx ?>

<cd:interface xmlns:cd="http://www.pragma-ade.com/commands">

    <cd:command name="definehead" level="style" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-section-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setuphead"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setuphead" level="style" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="frontpartlabel">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="bodypartlabel">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="appendixlabel">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="backpartlabel">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="expansion">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                    <cd:constant type="xml"/>
                </cd:parameter>
                <cd:parameter name="catcodes">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="sectionresetset">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="sectionseparatorset">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="sectionconversionset">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="conversion">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="sectionstarter">
                    <cd:resolve name="value-starter"/>
                </cd:parameter>
                <cd:parameter name="sectionstopper">
                    <cd:resolve name="value-stopper"/>
                </cd:parameter>
                <cd:parameter name="sectionset">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="sectionsegments">
                    <cd:resolve name="value-prefixsegments"/>
                </cd:parameter>
                <cd:parameter name="referenceprefix">
                    <cd:constant type="+"/>
                    <cd:constant type="-"/>
                    <cd:constant type="cd:text"/>
                </cd:parameter>
                <cd:parameter name="style">
                    <cd:resolve name="value-style"/>
                </cd:parameter>
                <cd:parameter name="color">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:parameter name="textstyle">
                    <cd:resolve name="value-style"/>
                </cd:parameter>
                <cd:parameter name="textcolor">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:parameter name="numberstyle">
                    <cd:resolve name="value-style"/>
                </cd:parameter>
                <cd:parameter name="numbercolor">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:parameter name="coupling">
                    <cd:constant type="cd:section"/>
                </cd:parameter>
                <cd:parameter name="ownnumber">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:parameter name="beforesection">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="aftersection">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="insidesection">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="incrementnumber">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                    <cd:constant type="list"/>
                    <cd:constant type="empty"/>
                </cd:parameter>
                <cd:parameter name="placehead">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                    <cd:constant type="hidden"/>
                    <cd:constant type="empty"/>
                    <cd:constant type="section"/>
                </cd:parameter>
                <cd:parameter name="number">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
                <cd:parameter name="page">
                    <cd:inherit name="page"/>
                </cd:parameter>
                <cd:parameter name="marking">
                    <cd:constant type="page"/>
                    <cd:constant type="reset"/>
                </cd:parameter>
                <cd:parameter name="header">
                    <cd:resolve name="value-textstate"/>
                </cd:parameter>
                <cd:parameter name="text">
                    <cd:resolve name="value-textstate"/>
                </cd:parameter>
                <cd:parameter name="footer">
                    <cd:resolve name="value-textstate"/>
                </cd:parameter>
                <cd:parameter name="before">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="after">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="inbetween">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="continue">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
                <cd:parameter name="aligntitle">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                    <cd:constant type="float"/>
                </cd:parameter>
                <cd:parameter name="interlinespace">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="interaction">
                    <cd:constant type="list"/>
                    <cd:constant type="reference"/>
                </cd:parameter>
                <cd:parameter name="internalgrid">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="grid">
                    <cd:resolve name="value-grid"/>
                </cd:parameter>
                <cd:parameter name="align">
                    <cd:inherit name="setupalign"/>
                </cd:parameter>
                <cd:parameter name="tolerance">
                    <cd:inherit name="setuptolerance"/>
                </cd:parameter>
                <cd:parameter name="strut">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
                <cd:parameter name="hang">
                    <cd:constant type="line"/>
                    <cd:constant type="broad"/>
                    <cd:constant type="fit"/>
                    <cd:constant type="none" default="yes"/>
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="margin">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="indentnext">
                    <cd:resolve name="value-indentnext"/>
                </cd:parameter>
                <cd:parameter name="alternative">
                    <cd:constant type="text"/>
                    <cd:constant type="paragraph"/>
                    <cd:constant type="normal" default="yes"/>
                    <cd:constant type="margin"/>
                    <cd:constant type="inmargin"/>
                    <cd:constant type="top"/>
                    <cd:constant type="middle"/>
                    <cd:constant type="bottom"/>
                    <cd:constant type="reverse"/>
                    <cd:constant type="margintext"/>
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="width">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="numberwidth">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="textwidth">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="distance">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="textdistance">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="commandbefore">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="commandafter">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="command">
                    <cd:constant type="cd:twoarguments"/>
                </cd:parameter>
                <cd:parameter name="textcommand">
                    <cd:constant type="cd:oneargument"/>
                </cd:parameter>
                <cd:parameter name="deeptextcommand">
                    <cd:constant type="cd:oneargument"/>
                </cd:parameter>
                <cd:parameter name="numbercommand">
                    <cd:constant type="cd:oneargument"/>
                </cd:parameter>
                <cd:parameter name="deepnumbercommand">
                    <cd:constant type="cd:oneargument"/>
                </cd:parameter>
                <cd:parameter name="location">
                    <!-- optional margin location -->
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="criterium">
                    <cd:constant type="strict"/>
                    <cd:constant type="positive"/>
                    <cd:constant type="all"/>
                </cd:parameter>
                <cd:parameter name="hidenumber">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupheads" level="style" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section-list-optional"/>
            <cd:assignments list="yes">
                <cd:inherit name="setuphead"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="section" generated="yes" variant="instance" level="document" category="structure" file="strc-sec.mkiv">
        <cd:sequence>
            <cd:instance value="section"/>
        </cd:sequence>
        <cd:arguments>
            <cd:resolve name="keyword-reference-list-optional"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
        <cd:instances>
            <cd:resolve name="instance-section"/>
        </cd:instances>
    </cd:command>

    <cd:command name="section" generated="yes" variant="instance:ownnumber" level="document" category="structure" file="strc-sec.mkiv">
        <cd:sequence>
            <cd:instance value="section"/>
        </cd:sequence>
        <cd:arguments>
            <cd:resolve name="keyword-reference-list-optional"/>
            <cd:resolve name="argument-number"/>
            <cd:resolve name="argument-text"/>
        </cd:arguments>
        <cd:instances>
            <cd:resolve name="instance-section"/>
        </cd:instances>
    </cd:command>

    <cd:command name="section" generated="yes" variant="instance:assignment" level="document" category="structure" file="strc-sec.mkiv">
        <cd:sequence>
            <cd:instance value="section"/>
        </cd:sequence>
        <cd:arguments>
            <cd:resolve name="assignment-sectiondata-list"/>
        </cd:arguments>
        <cd:instances>
            <cd:resolve name="instance-section"/>
        </cd:instances>
    </cd:command>

    <cd:command name="section" type="environment" generated="yes" variant="instance" level="document" category="structure" file="strc-sec.mkiv">
        <cd:sequence>
            <cd:instance value="section"/>
        </cd:sequence>
        <cd:arguments>
            <cd:resolve name="assignment-sectiondata-list-optional"/>
            <cd:resolve name="assignment-userdata-list-optional"/>
        </cd:arguments>
        <cd:instances>
            <cd:resolve name="instance-section"/>
        </cd:instances>
    </cd:command>

    <cd:command name="namedsection" type="environment" level="document" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
            <cd:resolve name="assignment-sectiondata-list-optional"/>
            <cd:resolve name="assignment-userdata-list-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="placerawheaddata" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="placerawheadtext" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="placerawheadnumber" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="repeathead" level="document" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="definesection" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="placeheadtext" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="placeheadnumber" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupheadnumber" level="style" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
            <cd:keywords>
                <cd:constant type="cd:number" prefix="cd:sign" method="none"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="determineheadnumber" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="currentheadnumber" level="system" category="structure" file="strc-sec.mkiv"/>

    <cd:command name="namedheadnumber" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="somenamedheadnumber" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-section"/>
            <cd:keywords delimiters="braces">
                <cd:constant type="previous"/>
                <cd:constant type="current"/>
                <cd:constant type="next"/>
                <cd:constant type="first"/>
                <cd:constant type="last"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="headnumber" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
            <cd:keywords optional="yes">
                <cd:constant type="previous"/>
                <cd:constant type="current" default="yes"/>
                <cd:constant type="next"/>
                <cd:constant type="first"/>
                <cd:constant type="last"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="someheadnumber" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
            <cd:keywords>
                <cd:constant type="previous"/>
                <cd:constant type="current"/>
                <cd:constant type="next"/>
                <cd:constant type="first"/>
                <cd:constant type="last"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="namedstructureheadlocation" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-section"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="structurenumber" level="system" category="structure" file="strc-sec.mkiv"/>

    <cd:command name="structuretitle" level="system" category="structure" file="strc-sec.mkiv"/>

    <cd:command name="structurevariable" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-key"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="structureuservariable" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-key"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="namedstructurevariable" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-section"/>
            <cd:resolve name="argument-key"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="namedstructureuservariable" level="system" category="structure" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-section"/>
            <cd:resolve name="argument-key"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="definesectionlevels" level="style" category="structure" file="strc-lev.mkvi">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-section-list"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="sectionlevel" type="environment" level="document" category="structure" file="strc-lev.mkvi">
        <cd:arguments>
            <cd:resolve name="keyword-name-optional"/>
            <cd:resolve name="assignment-sectiondata-list-optional"/>
            <cd:resolve name="assignment-userdata-list-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="subjectlevel" type="environment" level="document" category="structure" file="strc-lev.mkvi">
        <cd:arguments>
            <cd:resolve name="keyword-name-optional"/>
            <cd:resolve name="assignment-sectiondata-list-optional"/>
            <cd:resolve name="assignment-userdata-list-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="defineheadalternative" level="style" category="structure" file="strc-ren.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupheadalternative"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupheadalternative" level="style" category="structure" file="strc-ren.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="alternative">
                    <cd:constant type="horizontal"/>
                    <cd:constant type="vertical" default="yes"/>
                    <cd:constant type="somewhere"/>
                </cd:parameter>
                <cd:parameter name="renderingsetup">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="localheadsetup" type="environment" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headhbox" level="system" category="structure" file="strc-ren.mkiv">
        <cd:arguments>
            <cd:resolve name="string-boxoptions"/>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="headvbox" level="system" category="structure" file="strc-ren.mkiv">
        <cd:arguments>
            <cd:resolve name="string-boxoptions"/>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="headreferenceattributes" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headnumbercontent" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headtextcontent" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headwidth" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headtextwidth" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headnumberwidth" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headnumberdistance" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headtextdistance" level="system" category="structure" file="strc-ren.mkiv"/>

    <cd:command name="headsetupspacing" level="system" category="structure" file="strc-ren.mkiv"/>

</cd:interface>