
INCWSLEVEL()

DEFINESYMBOL(txt)()

DEFINEMACRO(abstract)(1)(\
    SETSYMBOL(XXabstracttext)(ARG1)\
)

DEFINEMACRO(addntosymbol)(3)(\
    SETCOUNTER(XXx)(ARG2)\
    XXaddntosymbol(ARG1)(ARG3)\
)

DEFINEMACRO(affiliation)(1)(\
    setaffilstring(ARG1)\
)

DEFINEMACRO(AfourEnlarged)(0)(\
)

DEFINEMACRO(appendix)(0)(\
    SETCOUNTER(XXchaptercounter)(0)\
    SETCOUNTER(XXsectcounter)(0)\
    SETCOUNTER(XXsubsectcounter)(0)\
    SETCOUNTER(XXsubsubsectcounter)(0)\
    setchapterstring(Appendix)\
)

DEFINEMACRO(article)(3)(\
    redef(chapter)(1)(ERROR(chapters only available in reports or books!))\
    redef(part)(1)(ERROR(parts only available in books!))\
    redef(nchapter)(1)(chapter())\
    redef(npart)(1)(part())\
    XXstartdocument(article)\
    ATEXIT(INTERNALINDEX(copy))\
    XXsetdocumentheader(ARG1)(ARG2)(ARG3)\
)

DEFINEMACRO(attribclear)(0)(\
)

DEFINEMACRO(attribinsert)(0)(\
)

DEFINEMACRO(attrib)(1)(\
)

DEFINEMACRO(bf)(1)(\
    ARG1+nop()\
)

DEFINEMACRO(bind)(1)(\
    ARG1 \
)

DEFINEMACRO(book)(3)(\
    XXstartdocument(book)\
    XXsetdocumentheader(ARG1)(ARG2)(ARG3)\
)

DEFINEMACRO(cell)(1)(\
    ADDTOCOUNTER(XXcol)(1)\
    nop() \
    ARG1 \
    IFEQUAL(XXcol)(XXtablewidth)
    (\
        XXnl()\
    )()\
)

DEFINEMACRO(cellsline)(2)(\
    SETCOUNTER(XXx)(ARG1-1)\
    EVAL(NOTRANS(ADDTOCOUNTER(XXx))(NOTRANS(-)COUNTERVALUE(XXcol)))\
    IFGREATER(XXx)(-1)(\
        ADDTOCOUNTER(XXcol)(XXx+ARG2)\
        XXnl()\
    )()\
)

DEFINEMACRO(cells)(2)(\
    ADDTOCOUNTER(XXcol)(ARG1)\
    nop() \
    ARG1 \
    IFEQUAL(XXcol)(XXtablewidth)
    (\
        XXnl()\
    )()\
)

DEFINEMACRO(center)(1)(\
    ADDTOCOUNTER(XXcenter)(1)\
    XXnl()\
    ARG1\
    +XXnl()\
    ADDTOCOUNTER(XXcenter)(-1)\
)

DEFINEMACRO(chapter)(1)(\
    SETCOUNTER(XXsectcounter)(0)\
    SETCOUNTER(XXsubsectcounter)(0)\
    SETCOUNTER(XXsubsubsectcounter)(0)\
    ADDTOCOUNTER(XXchaptercounter)(1)\
    XXsetlastnumber(COUNTERVALUE(XXchaptercounter))\
    XXnl()\
    getchapterstring() SYMBOLVALUE(XXlastnumber): ARG1\
    +XXnl()\
    XXtocentry(getchapterstring() SYMBOLVALUE(XXlastnumber): ARG1)\
)

DEFINEMACRO(cindex)(1)(\
)

DEFINEMACRO(cite)(1)(\
    [ARG1]\
)

DEFINEMACRO(clearpage)(0)(\
    nl()nl()\
)

DEFINEMACRO(code)(1)(\
    XXnl()\
    NOEXPAND(ARG1)\
    XXnl()\
)

DEFINEMACRO(columnline)(2)(\
    SETCOUNTER(XXx)(ARG1)\
    XXnl()\
)

COMMENT(
                                 Yodl
                             PREDEFINDED
                               COUNTERS
END COMMENT)

COMMENT(
    XXonlyblanks is defined by Yodl to indicate that only blanks were 
    inserted since PARAGRAPH() was called. It can be used to prevent the 
    output of multiple blank lines.

    To prevent the calling of PARAGRAPH in a certain context, use
    PUSHMACRO(PARAGRAPH)(0)() at the begin of the context, and
    POPMACRO(PARAGRAPH) at the end of the context.

    Just before PARAGRAPH is called, the symbol XXparagraph is set to the
whitespace text that would have been inserted if PARAGRAPH wasn't
defined. This does not happen if XXparagraph is not defined. It is NOT defined
by default. 

    The ifonlyblanks()() macro can be used to distinguish between series of
PARAGRAPH() activations and the first time PARAGRAPH is called following other
output. 

    If PARAGRAPH() would be called from within PARAGRAPH() itself its literal
whitespace text is output at that point. No nested calls of PARAGRAPH will
occur from an automated call of PARAGRAPH. It is possible, however, to call
PARAGRAPH recursively yourself (at your own risk)

END COMMENT)


DEFINECOUNTER(XXchaptercounter)(0)      COMMENT(for chapters)
DEFINECOUNTER(XXenumcounter)(0)         COMMENT(for ordered enums)
DEFINECOUNTER(XXpartcounter)(0)         COMMENT(for parts)
DEFINECOUNTER(XXsectcounter)(0)         COMMENT(for sections)
DEFINECOUNTER(XXsubsectcounter)(0)      COMMENT(for subsections)
DEFINECOUNTER(XXsubsubsectcounter)(0)   COMMENT(for subsubsections)

DEFINECOUNTER(XXtablewidth)(0)          COMMENT(the width of a table)
DEFINECOUNTER(XXcol)(0)                 COMMENT(col nr or idx in table/tbl)
DEFINECOUNTER(XXcenter)(0)              COMMENT(incremented in center(...))
DEFINECOUNTER(XXtr)(0)          \// 1 inside tr.
DEFINECOUNTER(XXtwrap)(0)       \// if != 0 then man-table cell contents are 
                                \//   wrapped in a T{ ... T} block (set by 
                                \//   twrap(value)
DEFINECOUNTER(XXx)(0)           \// scratch counter: no assumptions, and not
                                \//   necessarily unaltered after macro calls


DEFINECOUNTER(XXfootnotecounter)(0)    COMMENT(for footnotes)
DEFINECOUNTER(XXfigurecounter)(1)      COMMENT(for figures)

DEFINEMACRO(dashes)(1)(\
PUSHSUBST(0)\
    NOTRANS(--)\
POPSUBST()\
)

DEFINEMACRO(def)(3)(\
    DEFINEMACRO(ARG1)(ARG2)(ARG3)\
)

DEFINEMACRO(description)(1)(\
    ARG1\
)

DEFINEMACRO(dit)(1)(\
    CHAR(o) ARG1\
)

DEFINEMACRO(eit)(0)(\
    USECOUNTER(XXenumcounter). \
)

DEFINEMACRO(ellipsis)(0)(\
    NOTRANS(...)\
)

DEFINEMACRO(email)(1)(\
    nemail(ARG1)(ARG1)\
)

DEFINEMACRO(em)(1)(\
    ARG1+nop()\
)

DEFINEMACRO(enumerate)(1)(\
    enumeration(ARG1)\
)

DEFINEMACRO(enumeration)(1)(\
    PUSHCOUNTER(XXenumcounter)(0)\
    ARG1\
    POPCOUNTER(XXenumcounter)\
)

DEFINEMACRO(euro)(0)(\
    EUR\
)

DEFINEMACRO(evalsymbol)(2)(\
    EVAL(SETSYMBOL+nop()(ARG1)(ARG2))\
)

DEFINEMACRO(fig)(1)(\
    getfigurestring() \
    ref(ARG1)\
)

DEFINEMACRO(figure)(3)(\
    XXsetlastnumber(COUNTERVALUE(XXfigurecounter))\
    label(ARG3)

    ------------------------------------------------------------------
    Insert Figure SYMBOLVALUE(XXlastnumber)
    (ARG2)
    about here (file: ARG1)
    ------------------------------------------------------------------\
    ADDTOCOUNTER(XXfigurecounter)(1)\
)

DEFINEMACRO(file)(1)(\
    ARG1\
)

DEFINEMACRO(findex)(1)(\
)

DEFINEMACRO(footnote)(1)(\
    \ (ARG1)\
)

DEFINEMACRO(gagmacrowarning)(1)(\
    NOUSERMACRO(ARG1)\
)

DEFINEMACRO(getaffilstring)(0)(\
    SYMBOLVALUE(XXaffilstring)\
)

DEFINEMACRO(getauthorstring)(0)(\
    SYMBOLVALUE(XXauthorstring)\
)

DEFINEMACRO(getchapterstring)(0)(\
    SYMBOLVALUE(XXchapterstring)\
)

DEFINEMACRO(getdatestring)(0)(\
    SYMBOLVALUE(XXdatestring)\
)

DEFINEMACRO(getfigurestring)(0)(\
    SYMBOLVALUE(XXfigurestring)\
)

DEFINEMACRO(getpartstring)(0)(\
    SYMBOLVALUE(XXpartstring)\
)

DEFINEMACRO(gettitlestring)(0)(\
    SYMBOLVALUE(XXtitlestring)\
)

DEFINEMACRO(gettocstring)(0)(\
    SYMBOLVALUE(XXtocstring)\
)

DEFINEMACRO(htmlbodyopt)(2)(\
)

DEFINEMACRO(htmlcommand)(1)(\
)

DEFINEMACRO(htmlheadfile)(1)(\
)

DEFINEMACRO(htmlheadopt)(1)(\
)

DEFINEMACRO(htmlnewfile)(0)(\
)

DEFINEMACRO(htmlstyle)(2)(\
)

DEFINEMACRO(htmlstylesheet)(1)(\
)

DEFINEMACRO(htmltag)(2)(\
    IFZERO(ARG2)(\
        NOTRANS(</ARG1>)\
    )(\
        XXtag(ARG1))\
)

DEFINEMACRO(ifnewparagraph)(2)(\
    IFZERO(XXwrotetext)(\
        ARG2
    )(\
        ARG1)\
)

DEFINEMACRO(includefile)(1)(\
    TYPEOUT(Yodl: including file ARG1)\
    INCLUDEFILE(ARG1)\
)

DEFINEMACRO(includeverbatim)(1)(\
    PUSHCHARTABLE()\
    NOEXPANDINCLUDE(ARG1)\
    POPCHARTABLE()\
)

DEFINEMACRO(itdesc)(2)(\
    dit(ARG1)XXnl()\
    quote(ARG2)\
)

DEFINEMACRO(itemization)(1)(\
    ARG1\
)

DEFINEMACRO(it)(0)(\
    NOTRANS(o )\
)

DEFINEMACRO(kindex)(1)(\
)

DEFINEMACRO(label)(1)(\
    INTERNALINDEX(txtlabel ARG1)\
)

DEFINEMACRO(langle)(0)(\
    CHAR(<)\
)

DEFINEMACRO(languagedutch)(0)(\
    setaffilstring(Organisatie)\
    setauthorstring(Auteur)\
    setchapterstring(Hoofdstuk)\
    setdatestring(Datum)\
    setfigurestring(Figuur)\
    setpartstring(Deel)\
    settitlestring(Titel)\
    settocstring(Inhoudsopgave)\
)

DEFINEMACRO(languageenglish)(0)(\
    settocstring(Table of Contents)\
    setaffilstring(Affiliation)\
    setauthorstring(Author)\
    setchapterstring(Chapter)\
    setdatestring(Date)\
    setfigurestring(Figure)\
    setpartstring(Part)\
    settitlestring(Title)\
)

DEFINEMACRO(languageportugese)(0)(\
    setaffilstring(AFILIAÇÃO)\
    setauthorstring(AUTOR)\
    setchapterstring(Capítulo)\
    setdatestring(DATA)\
    setfigurestring(figura)\
    setpartstring(Parte)\
    settitlestring(TÍTULO)\
    settocstring(Índice)\
)

DEFINEMACRO(latexaddlayout)(1)(\
)

DEFINEMACRO(latexcommand)(1)(\
)

DEFINEMACRO(latexdocumentclass)(1)(\
    SETSYMBOL(XXdocumentclass)(ARG1)\
)

DEFINEMACRO(latexlayoutcmds)(1)(\
)

DEFINEMACRO(latexoptions)(1)(\
)

DEFINEMACRO(latexpackage)(2)(\
)

DEFINEMACRO(LaTeX)(0)(\
    NOTRANS(LaTeX)\
)

DEFINEMACRO(lchapter)(2)(\
    SETCOUNTER(XXsectcounter)(0)\
    SETCOUNTER(XXsubsectcounter)(0)\
    SETCOUNTER(XXsubsubsectcounter)(0)\
    ADDTOCOUNTER(XXchaptercounter)(1)\
    XXsetlastnumber(COUNTERVALUE(XXchaptercounter))\
    XXnl()\
    label(ARG1)\
    getchapterstring() SYMBOLVALUE(XXlastnumber): ARG2\
    +XXnl()\
    XXtocentry(getchapterstring() SYMBOLVALUE(XXlastnumber): ARG2)\
)

DEFINEMACRO(letteraddenda)(2)(\
)

DEFINEMACRO(letteradmin)(2)(\
)

DEFINEMACRO(letterfootitem)(2)(\
)

DEFINEMACRO(letter)(6)(\
    ERROR(The letter document is available for LaTeX conversions only)
)

DEFINEMACRO(letterreplyto)(3)(\
)

DEFINEMACRO(letterto)(1)(\
)

DEFINEMACRO(link)(2)(\
    ARG1\
)

DEFINEMACRO(lref)(2)(\
    ARG1 [ARG2]\
)

DEFINEMACRO(lsect)(2)(\
    XXsectCounter()\
    XXsect(ARG2)\
    label(ARG1)\
)

DEFINEMACRO(lsubsect)(2)(\
    XXsubsectCounter()\
    XXsubsect(ARG2)\
    label(ARG1)\
)

DEFINEMACRO(lsubsubsect)(2)(\
    XXsubsubsectCounter()\
    XXsubsubsect(ARG2)\
    label(ARG1)\
)

DEFINEMACRO(lsubsubsubsect)(2)(\
    subsubsubsect(ARG2)\
    label(ARG1)\
)

DEFINEMACRO(lurl)(1)(\
    url(ARG1)(ARG1)\
)

DEFINEMACRO(mailto)(1)(\
)

DEFINEMACRO(makeindex)(0)(\
)

DEFINEMACRO(mancommand)(1)(\
)

DEFINEMACRO(manpageauthor)(0)(\
    manpagesection(AUTHOR)\
    DEFINESYMBOL(XXmanpageAuthor)()\
)

DEFINEMACRO(manpagebugs)(0)(\
    manpagesection(BUGS)\
)

DEFINEMACRO(manpagedescription)(0)(\
    manpagesection(DESCRIPTION)\
)

DEFINEMACRO(manpagediagnostics)(0)(\
    manpagesection(DIAGNOSTICS)\
)

DEFINEMACRO(manpagefiles)(0)(\
    manpagesection(FILES)\
)

DEFINEMACRO(manpagename)(2)(\
    manpagesection(NAME)\
    DEFINESYMBOL(XXmanpageName)()\
    ARG1 - ARG2\
)

DEFINEMACRO(manpageoptions)(0)(\
    manpagesection(OPTIONS)\
)

DEFINEMACRO(manpage)(5)(\
    notableofcontents()\
    XXstartdocument(article)\
    ATEXIT(XXcheckmanpage())\
    ATEXIT(INTERNALINDEX(copy))\
    XXsetdocumentheader(ARG1(ARG2))(ARG5+nl()(ARG4))(ARG3)\
)

DEFINEMACRO(manpagesection)(1)(\
    IFDEF(XXmanpageAuthor)
    (\
        ERROR(manpageauthor() MUST be the last section of the manpage.)
    )()\
    nsect(ARG1)\
)

DEFINEMACRO(manpageseealso)(0)(\
    manpagesection(SEE ALSO)\
)

DEFINEMACRO(manpagesynopsis)(0)(\
    manpagesection(SYNOPSIS)\
)

DEFINEMACRO(manttquoted)(1)(\
)

DEFINEMACRO(mbox)(1)(\
    ARG1\
)

DEFINEMACRO(metaCOMMENT)(1)(\
)

PUSHWSLEVEL()\
DEFINEMACRO(metaC)(1)(\
    IFSTRSUB(ARG1)(
)
    (\
        WARNING(NOEXPAND(metaC()) ignored: multiple lines in argument)\
    )
    (\
    )\
)\
POPWSLEVEL()

DEFINEMACRO(mscommand)(1)(\
)

DEFINEMACRO(nbsp)(1)(\
    IFEMPTY(ARG1)(\
        XXnbsp(1)\
    )(\
        XXnbsp(ARG1))\
)

DEFINEMACRO(nchapter)(1)(\
    SETCOUNTER(XXsectcounter)(0)\
    SETCOUNTER(XXsubsectcounter)(0)\
    SETCOUNTER(XXsubsubsectcounter)(0)\
    XXnl()\
    getchapterstring(): ARG1\
    +XXnl()\
)

DEFINEMACRO(nemail)(2)(\
    ARG1 <ARG2>\
)

DEFINEMACRO(nl)(0)(\
    XXnl()\
)

DEFINEMACRO(nodenmame)(1)(
)

DEFINEMACRO(nodeprefix)(1)(
)

DEFINEMACRO(nodetext)(1)(\
)

DEFINEMACRO(nohtmlfive)(0)(\
)

DEFINEMACRO(nohtmlimgstyle)(0)(\
)

DEFINEMACRO(nop)(1)(\
    ARG1\
)

DEFINEMACRO(nosloppyhfuzz)(0)(\
)

DEFINEMACRO(notableofcontents)(0)(\
    SETSYMBOL(XXgeneratetoc)()\
)

DEFINEMACRO(notitleclearpage)(0)(\
    SETSYMBOL(XXtitleclearpage)()\
)

DEFINEMACRO(notocclearpage)(0)(\
)

DEFINEMACRO(notransinclude)(1)(\
    PUSHCHARTABLE()\
    NOEXPANDINCLUDE(ARG1)\
    POPCHARTABLE()\
)

DEFINEMACRO(noxlatin)(0)(\
)

DEFINEMACRO(nparagraph)(1)(\
    paragraph(ARG1)\
)

DEFINEMACRO(npart)(1)(\
    XXnl()\
    getpartstring() \
    ARG1\
    +XXnl()\
)

DEFINEMACRO(nsect)(1)(\
    SETCOUNTER(XXsubsectcounter)(0)\
    SETCOUNTER(XXsubsubsectcounter)(0)\
    XXnl()\
    ARG1\
    +XXnl()\
)

DEFINEMACRO(nsubsect)(1)(\
    SETCOUNTER(XXsubsubsectcounter)(0)\
    XXnl()\
    ARG1\
    +XXnl()\
)

DEFINEMACRO(nsubsubsect)(1)(\
    XXnl()\
    ARG1\
    +XXnl()\
)

DEFINEMACRO(nsubsubsubsect)(1)(\
    subsubsubsect(ARG1)\
)

DEFINEMACRO(paragraph)(1)
(
    ARG1   \
)

DEFINEMACRO(part)(1)(\
    ADDTOCOUNTER(XXpartcounter)(1)\
    XXsetlastnumber(COUNTERVALUE(XXpartcounter))\
    XXnl()\
    getpartstring() SYMBOLVALUE(XXlastnumber): ARG1\
    +XXnl()\
    XXtocentry(getpartstring() SYMBOLVALUE(XXlastnumber): ARG1)\
)

DEFINEMACRO(pindex)(1)(\
)

DEFINEMACRO(plainhtml)(1)(\
)

DEFINEMACRO(printindex)(0)(\
)

DEFINEMACRO(quote)(1)
(
    ARG1\
)

DEFINEMACRO(rangle)(0)(\
    CHAR(>)\
)

DEFINEMACRO(redefinemacro)(3)(\
    redef(ARG1)(ARG2)(ARG3)\
)

DEFINEMACRO(redef)(3)(\
    DELETEMACRO(ARG1)\
    DEFINEMACRO(ARG1)(ARG2)(ARG3)\
)

DEFINEMACRO(ref)(1)(\
    INTERNALINDEX(txtref ARG1)\
    COMMENT([ARG1])\
)

DEFINEMACRO(report)(3)(\
    redef(part)(1)(ERROR(parts only available in books!))\
    redef(npart)(1)(part())\
    XXstartdocument(report)\
    ATEXIT(INTERNALINDEX(copy))\
    XXsetdocumentheader(ARG1)(ARG2)(ARG3)\
)

DEFINEMACRO(roffcmd)(4)(\
)

DEFINEMACRO(rowline)(0)(\
    XXnl()\
)

DEFINEMACRO(row)(1)(\
    PUSHCOUNTER(XXcol)(0)\
    ARG1\
    +XXnl()\
    POPCOUNTER(XXcol)\
)

DEFINEMACRO(sc)(1)(\
    ARG1\
)

DEFINEMACRO(sect)(1)(\
    XXsectCounter()\
    XXsect(ARG1)\
)

DEFINEMACRO(setaffilstring)(1)(\
    SETSYMBOL(XXaffilstring)(ARG1)\
)

DEFINEMACRO(setauthorstring)(1)(\
    SETSYMBOL(XXauthorstring)(ARG1)\
)

DEFINEMACRO(setchapterstring)(1)(\
    SETSYMBOL(XXchapterstring)(ARG1)\
)

DEFINEMACRO(setdatestring)(1)(\
    SETSYMBOL(XXdatestring)(ARG1)\
)

DEFINEMACRO(setfigureext)(1)(\
    SETSYMBOL(XXfigureext)(ARG1)\
)

DEFINEMACRO(setfigurestring)(1)(\
    SETSYMBOL(XXfigurestring)(ARG1)\
)

DEFINEMACRO(sethtmlfigureext)(1)(\
)

DEFINEMACRO(htmlmetacharset)(1)(\
)

DEFINEMACRO(setincludepath)(1)(\
    IFSTRSUB(ARG1)(.:)
    ()(\
        WARNING("No .: specification in ARG1))\
    SETSYMBOL(XXincludePath)(ARG1)\
)

DEFINEMACRO(setlanguage)(1)(\
    IFMACRO(languageARG1)(\
        languageARG1()\
    )(\
        ERROR(language ARG1 not yet supported))\
)

DEFINEMACRO(setlatexalign)(1)(\
)

DEFINEMACRO(setlatexfigureext)(1)(\
)

DEFINEMACRO(setlatexverbchar)(1)(\
)

DEFINEMACRO(setmanalign)(1)(\
)

DEFINEMACRO(setpartstring)(1)(\
    SETSYMBOL(XXpartstring)(ARG1)\
)

DEFINEMACRO(setrofftableoptions)(1)(\
)

DEFINEMACRO(setrofftab)(1)(\
)

DEFINEMACRO(settitlestring)(1)(\
    SETSYMBOL(XXtitlestring)(ARG1)\
)

DEFINEMACRO(settocstring)(1)(\
    SETSYMBOL(XXtocstring)(ARG1)\
)

DEFINEMACRO(sgmlcommand)(1)(\
)

DEFINEMACRO(sgmltag)(2)(\
    htmltag(ARG1)(ARG2)\
)

DEFINEMACRO(sloppyhfuzz)(1)(\
)

DEFINEMACRO(standardlayout)(0)(\
)

DEFINEMACRO(XXstarttableatt)(2)(\
    PUSHCOUNTER(XXtablewidth)(ARG1)\
    XXnl()\
)

DEFINEMACRO(strong)(1)(\
    ARG1
)

DEFINEMACRO(subsect)(1)(\
    XXsubsectCounter()\
    XXsubsect(ARG1)\
)

DEFINEMACRO(subs)(1)(\
    _ARG1\
)

DEFINEMACRO(subsubsect)(1)(\
    XXsubsubsectCounter()\
    XXsubsubsect(ARG1)\
)

DEFINEMACRO(subsubsubsect)(1)
(
    XXnl()\
    ARG1\
    +XXnl()\
)

DEFINEMACRO(sups)(1)(\
    ^ARG1\
)

COMMENT(
                                 Yodl
                             PREDEFINDED
                               SYMBOLS
END COMMENT)

COMMENT( 
        XXincludePath set by Yodl holds the current includepath XXincludePath
is Interrogated at file openings

        XXparagraph may be defined by the user. If defined, then it will
contain the white space that triggered the call of PARAGRAPH just before 
PARAGRAPH is called. 

        XXyodlVersion is set to Yodl's current version

END COMMENT)


DEFINESYMBOL(XXabstracttext)        ()
DEFINESYMBOL(XXaffilstring)         ()
DEFINESYMBOL(XXauthorstring)        ()
DEFINESYMBOL(XXchapterstring)       (Chapter)
DEFINESYMBOL(XXdatestring)          ()
        COMMENT(Documentclass should be set to:
                    book
                    report
                    article
                )
DEFINESYMBOL(XXdocumentclass)       (unknown)
DEFINESYMBOL(XXfigurestring)        (Figure)
DEFINESYMBOL(XXgeneratetoc)         (true)
DEFINESYMBOL(XXlastnumber)          ()

DEFINESYMBOL(XXpartstring)          (Part)
DEFINESYMBOL(XXtitlestring)         ()
DEFINESYMBOL(XXtitleclearpage)      ()
DEFINESYMBOL(XXtocstring)           (Table of Contents)

DEFINESYMBOL(XXtablealign)          ()
DEFINESYMBOL(XXalign)()         \// in txt mode: the default text indentation
DEFINESYMBOL(XXtao)()           \// tbl align override
DEFINESYMBOL(XXsym)()           \// scratch symbol value: no assumptions,
                                \//   and not kept at macro calls

DEFINEMACRO(tableatt)(3)(\
    XXstarttableatt(ARG1)(ARG2)\
    XXendtable(ARG3)\
)

DEFINEMACRO(table)(3)(\
    XXstarttable(ARG1)(ARG2)\
    XXendtable(ARG3)\
)

DEFINEMACRO(tac)(2)(\
    +XXtc(ARG2)(1)()\
)

DEFINEMACRO(tao)(2)(\
    IFDEF(ARG1)(\
        SETSYMBOL(XXtao)(ARG2)\
    )()\
)

DEFINEMACRO(tbl)(2)(\
    XXtblbegin(ARG1)\
    XXtblend(ARG2)\
)

DEFINEMACRO(tcell)(1)(\
    cell(ARG1)\
)

DEFINEMACRO(tc)(1)(\
    XXtc(ARG1)(1)()\
)

DEFINEMACRO(telycommand)(1)(\
)

DEFINEMACRO(texinfocommand)(1)(\
)

DEFINEMACRO(TeX)(0)(\
    NOTRANS(TeX)\
)

DEFINEMACRO(tindex)(1)(\
)

DEFINEMACRO(titleclearpage)(0)(\
    SETSYMBOL(XXtitleclearpage)()\
)

DEFINEMACRO(tline)(2)(\
    IFEMPTY(ARG2)(\//                    no endline was specified: end the row
        XXtlineEnd(ARG1)\
    )(\
        XXtlinePart(ARG1)(ARG2))\
)

DEFINEMACRO(tnac)(3)(\
    tnc(ARG1)(ARG3)\
)

DEFINEMACRO(tnc)(2)(\
    NOTRANS(    )\
    XXtc(ARG2)()()    \
)

DEFINEMACRO(tocclearpage)(0)(\
)

DEFINEMACRO(tr)(1)(\
    PUSHCOUNTER(XXtr)(1)\
    PUSHCOUNTER(XXcol)(0)\
    SYMBOLVALUE(XXalign)\//             simulates centering
    ARG1\
    XXnl()\
    POPCOUNTER(XXcol)\
    POPCOUNTER(XXtr)\
)

DEFINEMACRO(ttbegin)(0)(\
)

DEFINEMACRO(ttend)(0)(\
)

DEFINEMACRO(tt)(1)(\
    NOEXPAND(ARG1)\
)

DEFINEMACRO(twrap)(1)(\
)

DEFINEMACRO(txtcommand)(1)(\
    NOTRANS(ARG1)\
)

DEFINEMACRO(url)(2)(\
    ARG1\
)

DEFINEMACRO(verbinclude)(1)(\
    NOEXPANDINCLUDE(ARG1)\
)

DEFINEMACRO(verbinsert)(1)(\
    PIPETHROUGH(yodlverbinsert -N ARG1)()\
)

DEFINEMACRO(verborg)(1)(\
    NOEXPAND(ARG1)\
)

DEFINEMACRO(verbpipe)(2)(\
    PUSHCHARTABLE()\
    PIPETHROUGH(ARG1)(ARG2)()\
    POPCHARTABLE()\
)

DEFINEMACRO(verb)(1)(\
    PUSHSUBST(0)\
    verborg(ARG1)\
    POPSUBST()\
)

DEFINEMACRO(vindex)(1)(\
)

DEFINEMACRO(whenhtml)(1)(\
)

DEFINEMACRO(whenlatex)(1)(\
)

DEFINEMACRO(whenman)(1)(\
)

DEFINEMACRO(whenms)(1)(\
)

DEFINEMACRO(whensgml)(1)(\
)

DEFINEMACRO(whentely)(1)(\
)

DEFINEMACRO(whentexinfo)(1)(\
)

DEFINEMACRO(whentxt)(1)(\
    ARG1\
)

DEFINEMACRO(whenxml)(1)(\
)

DEFINEMACRO(xit)(1)(\
)

DEFINEMACRO(xmlcommand)(1)(\
)

DEFINEMACRO(xmlmenu)(3)(\
)

DEFINEMACRO(xmlnewfile)(0)(\
)

DEFINEMACRO(xmlsetdocumentbase)(1)(\
)

DEFINEMACRO(xmltag)(2)(\
    htmltag(ARG1)(ARG2)\
)

DEFINEMACRO(XXabstract)(0)(\
    IFSTREQUAL(XXabstracttext)()
    ()(\
        IFSTREQUAL(XXdocumentclass)(book)(
            ERROR(abstracts cannot appear in books!))()\
        XXnl()\
        SYMBOLVALUE(XXabstracttext)\
        XXnl()\
    )\
)

DEFINEMACRO(XXaddntosymbol)(2)(\
    XXifnzero(XXx)(\
        ADDTOSYMBOL(ARG1)(ARG2)\
        ADDTOCOUNTER(XXx)(-1)\
        XXaddntosymbol(ARG1)(ARG2)\// recursive call for the next symbol
    )\
)

DEFINEMACRO(XXchapternum)(0)(\
    IFSTREQUAL(XXdocumentclass)(article)
    ()(\
        COUNTERVALUE(XXchaptercounter).\
    )\
)

DEFINEMACRO(XXcheckmanpage)(0)(\
    IFSYMBOL(XXmanpageName)
    ()(\
        ERROR(manpage has missing manpagename()() entry)
    )\
    IFSYMBOL(XXmanpageAuthor)
    ()(\
        ERROR(manpage has missing manpageauthor() entry)
    )\
)

DEFINEMACRO(XXendtable)(1)(\
    ARG1\
    +XXnl()\
    POPCOUNTER(XXtablewidth)\
)


DEFINEMACRO(XXhtmlclass)(2)(\
)

DEFINEMACRO(XXifnempty)(2)(\
    IFSTREQUAL(ARG1)()
    ()(\
        ARG2\
    )\
)

DEFINEMACRO(XXifneq)(3)(\
    IFEQUAL(ARG1)(ARG2)\
    ()
    (\
        ARG3\
    )\
)

DEFINEMACRO(XXifnzero)(2)(\
    IFZERO(ARG1)
    ()(\
        ARG2\
    )\
)

DEFINEMACRO(XXlabelvalue)(1)(\
    INTERNALINDEX(labvalue ARG1)\
)

DEFINEMACRO(XXmanclass)(1)(\
)













DEFINEMACRO(XXnbsp)(1)(\
    XXifnzero(ARG1)(\
        NOTRANS( )\
        SETCOUNTER(XXx)(ARG1-1)\
        EVAL(XXnbsp+nop()(COUNTERVALUE(XXx)))\
    )\
)

PUSHWSLEVEL(0)\
DEFINEMACRO(XXnl)(0)(\
    CHAR(
)\
)\
POPWSLEVEL()


DEFINEMACRO(XXroffcmd)(4)(\
    XXnl()\
    NOTRANS(ARG1) ARG2\
    +XXifnempty(ARG3)
    (\
        XXnl()\
        ARG3\
    )\
    XXifnempty(ARG4)
    (\
        XXnl()\
        NOTRANS(ARG4)\
    )\
    INTERNALINDEX(ignorews)
    XXnl()\
)

DEFINEMACRO(XXsectCounter)(0)(\
    SETCOUNTER(XXsubsectcounter)(0)\
    SETCOUNTER(XXsubsubsectcounter)(0)\
    ADDTOCOUNTER(XXsectcounter)(1)\
    XXsetlastnumber(XXchapternum()COUNTERVALUE(XXsectcounter))\
)

DEFINEMACRO(XXsect)(1)(\
    XXnl()\
    SYMBOLVALUE(XXlastnumber): ARG1\
    +XXnl()\
    XXtocentry(SYMBOLVALUE(XXlastnumber): ARG1)\
)

DEFINEMACRO(XXsetdocumentheader)(3)(\
    XXsettxtdocumentheader(ARG1)(ARG2)(ARG3)\
)


DEFINEMACRO(XXsetlastnumber)(1)(\
    SETSYMBOL(XXlastnumber)(ARG1)\
    INTERNALINDEX(lastnumber SYMBOLVALUE(XXlastnumber))\
)


DEFINEMACRO(XXsetmandocumentheader)(3)(\
    XXifnempty(ARG1)(\
        XXroffcmd(.TH)(NOTRANS(")ARG1+NOTRANS(") NOTRANS(")\
            ARG3+NOTRANS("))()(.PP)\
        XXroffcmd(.SH)(NOTRANS(")ARG1+NOTRANS("))()()
    )\
    XXifnempty(ARG2)(\
        XXroffcmd(.SH)(NOTRANS(")ARG2+NOTRANS("))()()\
    )\
    XXifnempty(XXaffilstring)(\
        XXroffcmd(.SH)(NOTRANS(")SYMBOLVALUE(XXaffilstring)NOTRANS("))()()\
    )\
    XXifnempty(ARG3)(\
        XXroffcmd(.SH)(NOTRANS(")ARG3+NOTRANS("))()()\
    )\
)    

DEFINEMACRO(XXsettitleclearpage)(0)(\
)

DEFINEMACRO(XXsettocclearpage)(0)(\
    XXifnempty(XXtocclearpage)
    (\
        clearpage()\
    )\
)

DEFINEMACRO(XXsettxtdocumentheader)(3)(\
    XXifnempty(ARG1)
    (\
        TYPEOUT(Document title: ARG1)\
    )\
    XXnl()\
    XXifnempty(ARG1)
    (\
        gettitlestring(): ARG1
        +XXnl()\
    )\
    XXifnempty(ARG2)
    (\
        getauthorstring(): ARG2
        +XXnl()\
    )\
    XXifnempty(XXaffiliation)
    (\
        getaffilstring()\
        XXnl()\
    )
    XXifnempty(ARG3)
    (\
        getdatestring(): ARG3
        +XXnl()\
    )\
    XXnl()
    SYMBOLVALUE(XXabstracttext)\
    XXnl()\
    XXifnempty(ARG1)
    (\
        XXsettitleclearpage()\
    )\
    XXtableofcontents()\
)


DEFINEMACRO(XXstartdocument)(1)(\
    TYPEOUT(Yodl is processing a+nop()(n) ARG1)\
    SETSYMBOL(XXdocumentclass)(ARG1)\
    XXnl()\
)

DEFINEMACRO(XXstarttable)(2)(\
    PUSHCOUNTER(XXtablewidth)(ARG1)\
    XXnl()\
)

DEFINEMACRO(XXsubsectCounter)(0)(\
    SETCOUNTER(XXsubsubsectcounter)(0)\
    ADDTOCOUNTER(XXsubsectcounter)(1)\
    XXsetlastnumber(\
        XXchapternum()\
        COUNTERVALUE(XXsectcounter).\
        COUNTERVALUE(XXsubsectcounter)\
    )\
)

DEFINEMACRO(XXsubsect)(1)(\
    XXnl()\
    SYMBOLVALUE(XXlastnumber): ARG1\
    +XXnl()\
    XXtocentry(SYMBOLVALUE(XXlastnumber): ARG1)\
)

DEFINEMACRO(XXsubsubsectCounter)(0)(\
    ADDTOCOUNTER(XXsubsubsectcounter)(1)\
    XXsetlastnumber(\
        XXchapternum()\
        COUNTERVALUE(XXsectcounter).\
        COUNTERVALUE(XXsubsectcounter).\
        COUNTERVALUE(XXsubsubsectcounter)\
    )\
)

DEFINEMACRO(XXsubsubsect)(1)(\
    XXnl()\
    SYMBOLVALUE(XXlastnumber): ARG1\
    +XXnl()\
    XXtocentry(SYMBOLVALUE(XXlastnumber): ARG1)\
)


DEFINEMACRO(XXtableofcontents)(0)(\
    IFSTREQUAL(XXgeneratetoc)()(\
    )(\
        XXnl()\
        gettocstring()\
        XXnl()\
        INTERNALINDEX(txttoc)
        XXnl()\
        XXsettocclearpage()\
    )\
)

DEFINEMACRO(XXtag)(1)(\
    NOTRANS(<)ARG1 attribinsert()\
    NOTRANS(>)\
)\

DEFINEMACRO(XXtblbegin)(1)(\
    EVAL(PUSHCOUNTER+nop()(XXtablewidth)(STRLEN(ARG1)))\
    PUSHSYMBOL(XXalign)()\//           used for pseudo centering in txt mode
    XXifnzero(XXcenter)(\
        SETSYMBOL(XXalign)(        ))\
    XXnl()\
)

DEFINEMACRO(XXtblend)(1)(\
    ARG1\
    POPSYMBOL(XXalign)\
    XXnl()\
    POPCOUNTER(XXtablewidth)\
)

DEFINEMACRO(XXtc)(3)(\
    ARG1    \
    SETSYMBOL(XXtao)()\
)

DEFINEMACRO(XXtlineClose)(1)(\
    ADDTOCOUNTER(XXcol)(-1)\
    IFGREATER(XXcol)(XXtablewidth)(\
        ERROR(Table width (COUNTERVALUE(XXtablewidth)) exceeded))()\
    POPCOUNTER(XXcol)\
    SYMBOLVALUE(XXalign)\
    NOTRANS(----)\//            previous tline calls: end the line
    XXnl()\
)

DEFINEMACRO(XXtlineEnd)(1)(\
    IFZERO(XXcol)(\//            first call: do a row line
        XXtlineRow(ARG1)\
    )(\
        XXtlineClose())\//           previously called: end partial line(s)
)

DEFINEMACRO(XXtlineFirst)(1)(\
    PUSHCOUNTER(XXcol)(1)\//     colnr specified by XXcol; 
)

DEFINEMACRO(XXtlineNext)(2)(\
    SETCOUNTER(XXcol)(ARG2)\
)

DEFINEMACRO(XXtlinePart)(2)(\
    IFZERO(XXcol)(\//             first tline(beginNr)(endNr) call
        XXtlineFirst(ARG1))
    ()\
    SETCOUNTER(XXx)(ARG2+1)\
    EVAL(XXtlineNext+nop()(ARG1)(COUNTERVALUE(XXx)))\
)

DEFINEMACRO(XXtlineRow)(1)(\
    SYMBOLVALUE(XXalign)\
    SETSYMBOL(XXsym)()\//       set the full-width line
    IFEMPTY(ARG1)(\//           no request for specific length
        addntosymbol(XXsym)(60)(-)\
    )(\
        addntosymbol(XXsym)(ARG1)(-))\
    SYMBOLVALUE(XXsym)\
    XXnl()\
)

DEFINEMACRO(XXtlineSpan)(3)(\
)

DEFINEMACRO(XXtocentry)(1)(\
    INTERNALINDEX(txttocentry ARG1)\
)

DECWSLEVEL()
