<?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" 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" 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: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="location">
                    <!-- optional margin location -->
                    <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:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupheads" 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" 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" 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" 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" 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="part" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="chapter" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="section" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsection" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsection" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubsection" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubsubsection" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="title" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subject" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubject" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubject" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubsubject" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubsubsubject" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-reference-list-optional"/>
                <cd:resolve name="argument-text"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="part" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="chapter" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

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

        <cd:command name="subsection" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsection" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubsection" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubsubsection" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="title" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subject" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubject" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubject" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubsubject" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

        <cd:command name="subsubsubsubsubject" type="environment" file="strc-sec.mkiv">
            <cd:arguments>
                <cd:resolve name="assignment-sectiondata-list-optional"/>
                <cd:resolve name="assignment-userdata-list-optional"/>
            </cd:arguments>
        </cd:command>

    -->

    <cd:command name="namedsection" type="environment" 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="definesection" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
        </cd:arguments>
    </cd:command>

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

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

    <cd:command name="setupheadnumber" 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" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-section"/>
        </cd:arguments>
    </cd:command>

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

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

    <cd:command name="somenamedheadnumber" 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" 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" 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" file="strc-sec.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-section"/>
        </cd:arguments>
    </cd:command>

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

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

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

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

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

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

    <cd:command name="definesectionlevels" 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" 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" 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" 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" 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" file="strc-ren.mkiv"/>

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

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

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

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

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

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

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

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

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

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

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

</cd:interface>
