<glimmer-definition>
   <settings>
      <language>LaTeX</language>
      <compiler>glimmerout latex %2 2&gt;&amp;1</compiler>
      <debugger>%term% xdvi %3</debugger>
      <execution>%term% dvips -Pwww %3.dvi; ggv %3.ps</execution>
   </settings>

   <mime-types>
      <extension>tex</extension>
      <extension>sty</extension>
      <extension>cls</extension>
   </mime-types>

   <syntax-items>
      <syntax-item>
         <name>comment</name>
         <start-regex>%</start-regex>
         <end-regex>\n</end-regex>
         <style>comment</style>
      </syntax-item>
   </syntax-items>

   <pattern-items>
      <pattern-item>
         <name>include</name>
         <regex>\\\(input\|include\|includeonly\)</regex>
         <style>preprocessor</style>
      </pattern-item>
      <pattern-item>
         <name>keywords00</name>
         <regex>\\\(\\%\|noindent\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords01</name>
         <regex>\\\(AA\|SS\|aa\|cr\|dp\|em\|fi\|ht\|if\|or\|wd\|Box\|TeX\|and\|box\|day\|def\|end\|exa\|exb\|exc\|fam\|flq\|frq\|glq\|grq\|hss\|ifx\|let\|lhd\|mag\|mho\|par\|put\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords02</name>
         <regex>\\\(ref\|rhd\|the\|toc\|vss\|Alph\|HUGE\|Huge\|Join\|alph\|atop\|char\|cite\|copy\|crcr\|date\|dots\|else\|emph\|eqno\|fbox\|fill\|font\|frac\|gdef\|glqq\|grqq\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords03</name>
         <regex>\\\(hbox\|hfil\|huge\|item\|kern\|kill\|left\|list\|long\|mark\|math\|mbox\|ull\|omit\|oval\|over\|part\|plus\|quad\|read\|rule\|sbox\|show\|skip\|span\|stop\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords04</name>
         <regex>\\\(time\|tiny\|toks\|vbox\|verb\|vfil\|vtop\|xdef\|year\|LARGE\|LaTeX\|Large\|Roman\|above\|addto\|array\|begin\|cline\|count\|ddots\|depth\|dimen\|frame\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords05</name>
         <regex>\\\(fussy\|hfill\|hfuzz\|hline\|hrule\|hsize\|hskip\|ifcat\|ifdim\|ifeof\|ifnum\|ifodd\|index\|input\|label\|large\|ldots\|leqno\|lower\|lrbox\|minus\|mkern\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords06</name>
         <regex>\\\(month\|mskip\|ewif\|outer\|qquad\|raise\|relax\|right\|roman\|small\|smash\|space\|title\|today\|unlhd\|unrhd\|value\|vfill\|vfuzz\|vline\|vrule\|vsize\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords07</name>
         <regex>\\\(vskip\|width\|write\|LaTeXe\|accent\|arabic\|author\|bezier\|center\|circle\|csname\|divide\|family\|forall\|global\|halign\|height\|hspace\|ifcase\|ifhbox\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords08</name>
         <regex>\\\(iftrue\|ifvbox\|ifvoid\|indent\|insert\|lccode\|limits\|mathbf\|mathit\|mathop\|mathrm\|mathsf\|mathtt\|muskip\|ocite\|ocorr\|umber\|obeycr\|openin\|output\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords09</name>
         <regex>\\\(parbox\|parsep\|pounds\|secdef\|setbox\|sfcode\|sloppy\|string\|symbol\|textbf\|textit\|textmd\|textrm\|textsc\|textsf\|textsl\|texttt\|textup\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords10</name>
         <regex>\\\(thanks\|topsep\|typein\|uccode\|uchyph\|unhbox\|unkern\|unskip\|unvbox\|usebox\|valign\|vector\|vspace\|vsplit\|Diamond\|advance\|badness\|bibcite\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords11</name>
         <regex>\\\(bibdata\|bibitem\|bibname\|bigskip\|botmark\|caption\|catcode\|chapter\|chardef\|closein\|dashbox\|delcode\|dotfill\|endgraf\|endlist\|endmath\|errhelp\|everycr\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords12</name>
         <regex>\\\(fboxsep\|footins\|headsep\|hfilneg\|hoffset\|iffalse\|ifhmode\|ifinner\|ifmmode\|ifvmode\|include\|itemize\|itemsep\|iterate\|itshape\|jobname\|lastbox\|leaders\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords13</name>
         <regex>\\\(leadsto\|lefteqn\|makebox\|mathbin\|mathcal\|mathord\|mathrel\|meaning\|medskip\|message\|ewfont\|ewhelp\|ewline\|ewpage\|oalign\|ofiles\|openout\|pageref\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords14</name>
         <regex>\\\(parskip\|pausing\|penalty\|picture\|poptabs\|protect\|qbezier\|radical\|refname\|rootbox\|savebox\|scshape\|section\|shipout\|showbox\|showthe\|skipdef\|slshape\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords15</name>
         <regex>\\\(special\|stretch\|subitem\|tabbing\|tabskip\|tabular\|textbar\|thempfn\|thepage\|thepart\|toksdef\|topmark\|topskip\|typeout\|unhcopy\|unvcopy\|upshape\|usefont\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords16</name>
         <regex>\\\(vadjust\|vcenter\|vfilneg\|voffset\|appendix\|bfseries\|bibstyle\|boldmath\|citation\|cleaders\|closeout\|countdef\|dimendef\|document\|endarray\|endgroup\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords17</name>
         <regex>\\\(endinput\|endlrbox\|eqnarray\|equation\|everyjob\|everypar\|fboxrule\|floatsep\|fnsymbol\|fontname\|fontsize\|footnote\|footskip\|framebox\|glossary\|hbadness\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords18</name>
         <regex>\\\(labelsep\|language\|lastkern\|lastskip\|leftmark\|leftskip\|lineskip\|markboth\|mathchar\|mathcode\|mathopen\|maxdepth\|mdseries\|minipage\|moveleft\|multiply\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords19</name>
         <regex>\\\(multiput\|ewcount\|ewdimen\|ewlabel\|oexpand\|oindent\|olimits\|onumber\|ullfont\|overline\|pagegoal\|pagename\|parshape\|partname\|patterns\|prevgraf\|proclaim\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords20</name>
         <regex>\\\(pushtabs\|raisebox\|rmfamily\|samepage\|sffamily\|skewchar\|sqsubset\|sqsupset\|stackrel\|textfont\|textless\|theenumi\|thehours\|thetable\|trivlist\|ttfamily\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords21</name>
         <regex>\\\(underbar\|vbadness\|verbatim\|vpageref\|vphantom\|xleaders\|Leftarrow\|LoadClass\|addvspace\|backslash\|batchmode\|bibindent\|centering\|clearpage\|columnsep\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords22</name>
         <regex>\\\(delimiter\|endcenter\|endcsname\|enumerate\|everyhbox\|everymath\|everyvbox\|firstmark\|flushleft\|fontdimen\|fontshape\|futurelet\|hangafter\|hlinefill\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords23</name>
         <regex>\\\(hrulefill\|immediate\|indexname\|intextsep\|leftarrow\|linebreak\|linewidth\|listfiles\|looseness\|lowercase\|makeindex\|makelabel\|maketitle\|marginpar\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords24</name>
         <regex>\\\(markright\|mathclose\|mathgroup\|mathinner\|mathpunct\|medmuskip\|moveright\|muskipdef\|ewlength\|onscript\|onecolumn\|pagebreak\|pagedepth\|pagestyle\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords25</name>
         <regex>\\\(pagetotal\|paragraph\|parindent\|partopsep\|prevdepth\|quotation\|restorecr\|rightmark\|rightskip\|setlength\|showlists\|sloppypar\|smallskip\|spaceskip\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords26</name>
         <regex>\\\(tabcolsep\|tablename\|textstyle\|textwidth\|theenumiv\|thefigure\|thinlines\|tolerance\|topmargin\|twocolumn\|underline\|unpenalty\|uppercase\|Rightarrow\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords27</name>
         <regex>\\\(addpenalty\|aftergroup\|begingroup\|botfigrule\|dblfigrule\|deadcycles\|enditemize\|endpicture\|endtabbing\|endtabular\|ensuremath\|errmessage\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords28</name>
         <regex>\\\(escapechar\|figurename\|flushright\|fontfamily\|fontseries\|globaldefs\|hangindent\|headheight\|hyphenchar\|indexspace\|itemindent\|labelenumi\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords29</name>
         <regex>\\\(labelitemi\|labelwidth\|leavevmode\|leftmargin\|linespread\|mathaccent\|mathchoice\|mathnormal\|ewcommand\|ewcounter\|ewsavebox\|ewtheorem\|oboundary\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords30</name>
         <regex>\\\(ocorrlist\|ormalfont\|ormalsize\|umberline\|pageshrink\|paperwidth\|qbeziermax\|raggedleft\|relpenalty\|rightarrow\|scriptfont\|scriptsize\|scrollmode\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords31</name>
         <regex>\\\(selectfont\|setcounter\|settodepth\|settowidth\|shortstack\|showoutput\|subsection\|subsubitem\|tabbingsep\|textbullet\|textdagger\|textdollar\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords32</name>
         <regex>\\\(textemdash\|textendash\|textheight\|textnormal\|thechapter\|theminutes\|thesection\|thicklines\|thinmuskip\|topfigrule\|unboldmath\|unitlength\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords33</name>
         <regex>\\\(usecounter\|usepackage\|varepsilon\|xspaceskip\|PackageInfo\|addtolength\|adjdemerits\|arraycolsep\|boxmaxdepth\|chaptermark\|chaptername\|clubpenalty\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords34</name>
         <regex>\\\(columnwidth\|dblfloatsep\|deffootnote\|displaymath\|enddocument\|endeqnarray\|endequation\|endlinechar\|endminipage\|endtrivlist\|endverbatim\|expandafter\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords35</name>
         <regex>\\\(extracolsep\|flushbottom\|fontsubfuzz\|footnotesep\|hyphenation\|includeonly\|inputlineno\|labelitemii\|labelitemiv\|lastpenalty\|leftmargini\|leftmarginv\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords36</name>
         <regex>\\\(linepenalty\|makeatother\|mathchardef\|mathversion\|multicolumn\|ewlinechar\|olinebreak\|onstopmode\|opagebreak\|ormalcolor\|ouppercase\|pagestretch\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords37</name>
         <regex>\\\(paperheight\|parfillskip\|raggedright\|rightmargin\|scriptfont0\|scriptspace\|scriptstyle\|sectionmark\|setlanguage\|settoheight\|spacefactor\|stepcounter\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords38</name>
         <regex>\\\(textcircled\|textgreater\|textsection\|theequation\|thefootnote\|thickmuskip\|topfraction\|totalheight\|CheckCommand\|IfFileExists\|MessageBreak\|PackageError\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords39</name>
         <regex>\\\(ProvidesFile\|abstractname\|addtocounter\|addtoversion\|appendixname\|arraystretch\|baselineskip\|bibliography\|binoppenalty\|contentsline\|contentsname\|displaystyle\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords40</name>
         <regex>\\\(displaywidth\|endenumerate\|endflushleft\|endquotation\|endsloppypar\|endtitlepage\|everydisplay\|filecontents\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords41</name>
         <regex>\\\(fontencoding\|footnotemark\|footnoterule\|footnotesize\|footnotetext\|ignorespaces\|labelitemiii\|leftmarginii\|leftmarginiv\|leftmarginvi\|listoftables\|makeatletter\|makeglossary\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords42</name>
         <regex>\\\(marginparsep\|mathellipsis\|mathsterling\|mathsurround\|egthinspace\|obreakspace\|oldstylenums\|overfullrule\|pretolerance\|raggedbottom\|renewcommand\|romannumeral\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords43</name>
         <regex>\\\(setpapersize\|showboxdepth\|showoverfull\|splitbotmark\|splittopskip\|subparagraph\|textellipsis\|textfloatsep\|textfraction\|textsterling\|theparagraph\|tracingfonts\|tracingpages\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords44</name>
         <regex>\\\(tracingstats\|widowpenalty\|CurrentOption\|DeclareOption\|MakeLowercase\|MakeUppercase\|OptionNotUsed\|ProvidesClass\|addtocontents\|brokenpenalty\|columnseprule\|discretionary\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords45</name>
         <regex>\\\(displayindent\|displaylimits\|documentclass\|documentstyle\|doublerulesep\|endflushright\|errorstopmode\|frenchspacing\|hyphenpenalty\|lefthyphenmin\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords46</name>
         <regex>\\\(leftmarginiii\|linethickness\|listoffigures\|listparindent\|listtablename\|marginparpush\|maxdeadcycles\|medskipamount\|oddsidemargin\|outputpenalty\|pagenumbering\|paragraphmark\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords47</name>
         <regex>\\\(splitmaxdepth\|subsubsection\|textbackslash\|textbraceleft\|textdaggerdbl\|textparagraph\|textquoteleft\|texttrademark\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords48</name>
         <regex>\\\(thempfootnote\|thesubsection\|thispagestyle\|tracingmacros\|tracingonline\|tracingoutput\|AtEndOfPackage\|ExecuteOptions\|Leftrightarrow\|NeedsTeXFormat\|PackageWarning\|ProcessOptions\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords49</name>
         <regex>\\\(RequirePackage\|arrayrulewidth\|atopwithdelims\|bottomfraction\|dbltopfraction\|enddisplaymath\|evensidemargin\|holdinginserts\|leftrightarrow\|lineskiplimits\|listfigurename\|marginparwidth\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords50</name>
         <regex>\\\(mathunderscore\|newenvironment\|overwithdelims\|pagefilstretch\|predisplaysize\|refstepcounter\|righthyphenmin\|showboxbreadth\|splitfirstmark\|subsectionmark\|suppressfloats\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords51</name>
         <regex>\\\(tabularnewline\|textasciitilde\|textbraceright\|textexclamdown\|textquoteright\|textregistered\|textunderscore\|AtBeginDocument\|ProvidesPackage\|abovewithdelims\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords52</name>
         <regex>\\\(addcontentsline\|afterassignment\|baselinestretch\|cleardoublepage\|dbltextfloatsep\|defaultskewchar\|delimiterfactor\|enlargethispage\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords53</name>
         <regex>\\\(exhyphenpenalty\|floatingpenalty\|includegraphics\|insertpenalties\|newmathalphabet\|normalmarginpar\|pagefillstretch\|tableofcontents\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords54</name>
         <regex>\\\(textasciicircum\|textsuperscript\|thefootnotemark\|thesubparagraph\|tracingcommands\|tracingrestores\|abovecaptionskip\|abovedisplayskip\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords55</name>
         <regex>\\\(belowcaptionskip\|belowdisplayskip\|descriptionlabel\|emergencystretch\|interlinepenalty\|nonfrenchspacing\|pagefilllstretch\|renewenvironment\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords56</name>
         <regex>\\\(reversemarginpar\|scriptscriptfont\|subparagraphmark\|textcompwordmark\|textquestiondown\|textquotedblleft\|textvisiblespace\|thesubsubsection\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords57</name>
         <regex>\\\(tracinglostchars\|InputIfFileExists\|bibliographystyle\|defaulthyphenchar\|errorcontextlines\|floatpagefraction\|predisplaypenalty\|scriptscriptstyle\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords58</name>
         <regex>\\\(subsubsectionmark\|textquotedblright\|tracingparagraphs\|PassOptionsToClass\|defaultscriptratio\|delimitershortfall\|finalhypendemerits\|nulldelimiterspace\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords59</name>
         <regex>\\\(postdisplaypenalty\|textperiodcentered\|displaywidowpenalty\|DeclareRobustCommand\|PackageWarningNoLine\|PassOptionsToPackage\|dblfloatpagefraction\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords60</name>
         <regex>\\\(doublehyphendemerits\|textasteriskcentered\|DeclareOldFontCommand\|abovedisplayshortskip\|belowdisplayshortskip\|defaultscriptscriptratio\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>keywords61</name>
         <regex>\\\(newcommand\|newpage\)\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>function</name>
         <regex>\\\([A-Z,a-z]\)*\b</regex>
         <style>function</style>
      </pattern-item>
      <pattern-item>
         <name>options</name>
         <regex>\b\(10pt\|11pt\|12pt\|onecolumn\|twocolumn\|a4paper\|article\|book\|hangul\|graphicx\)\b</regex>
         <style>preprocessor</style>
      </pattern-item>
      <pattern-item>
         <name>operators</name>
         <regex>\(&amp;\)</regex>
         <style>symbol</style>
      </pattern-item>
   </pattern-items>

</glimmer-definition>

<python-definition>
def insert_latex_part():
    glimmer.insert("\part { }")
    glimmer.move(-2)
def insert_latex_chapter():
    glimmer.insert("\chapter { }")
    glimmer.move(-2)
def insert_latex_section():
    glimmer.insert("\section { }")
    glimmer.move(-2)
def insert_latex_subsection():
    glimmer.insert("\subsection { }")
    glimmer.move(-2)
def insert_latex_subsubsection():
    glimmer.insert("\subsubsection { }")
    glimmer.move(-2)
def insert_latex_paragraph():
    glimmer.insert("\paragraph { }")
    glimmer.move(-2)
def insert_latex_subparagraph():
    glimmer.insert("\subparagraph { }")
    glimmer.move(-2)
def insert_latex_appendix():
    glimmer.insert("\appendix")

def insert_latex_table(rows,cols):
    glimmer.insert("\\begin{tabular}{")
    # FIX-ME: support different table styles
    for i in range(0,cols):
        glimmer.insert("l")
    glimmer.insert("}\n")    
    for i in range(0,rows):
        for j in range(1,cols):
            glimmer.insert (" & ")
        glimmer.insert("\\\\ \n")
    glimmer.insert("\end{tabular}\n")

def latex_table_wizard():
    window = GnomeDialog("LaTeX Table",STOCK_BUTTON_OK, STOCK_BUTTON_CANCEL)
    rows_frame = GtkFrame("Rows")
    window.vbox.pack_start(rows_frame,expand=TRUE,fill=TRUE)
    rows_adjustment= GtkAdjustment(1,1,99,1,5)
    rows_spin=GtkSpinButton(rows_adjustment,1,0)
    rows_frame.add(rows_spin)
    cols_frame = GtkFrame("Columns")
    window.vbox.pack_start(cols_frame,expand=TRUE,fill=TRUE)
    cols_adjustment= GtkAdjustment(1,1,99,1,5)
    cols_spin=GtkSpinButton(cols_adjustment,1,0)
    cols_frame.add(cols_spin)
    rows_spin.show()
    rows_frame.show()
    cols_spin.show()
    cols_frame.show()
    window.vbox.show()
    window.show()
    reply = window.run()
    if reply == OK:
             rows = rows_spin.get_value()
             cols = cols_spin.get_value()
             insert_latex_table(rows,cols)
    window.destroy()

glimmer.add_sub_to_menu("_Insert/", "LaTeX Environments", -1)
glimmer.add_item_to_menu("_Insert/LaTeX Environments/", "tabular", "tabular", "", -1, latex_table_wizard)

glimmer.add_sub_to_menu("_Insert/", "LaTeX Sectioning",-1)
glimmer.add_item_to_menu("_Insert/LaTeX Sectioning/", "part", "part", "", -1, insert_latex_part)
glimmer.add_item_to_menu("_Insert/LaTeX Sectioning/", "chapter", "chapter", "", -1,insert_latex_chapter);
glimmer.add_item_to_menu("_Insert/LaTeX Sectioning/", "section", "section", "", -1,insert_latex_section);
glimmer.add_item_to_menu("_Insert/LaTeX Sectioning/", "subsection", "subsection", "", -1,insert_latex_subsection);
glimmer.add_item_to_menu("_Insert/LaTeX Sectioning/", "subsubsection", "subsubsection", "", -1,insert_latex_subsubsection);
glimmer.add_item_to_menu("_Insert/LaTeX Sectioning/", "paragraph", "paragraph", "", -1,insert_latex_paragraph);
glimmer.add_item_to_menu("_Insert/LaTeX Sectioning/", "subparagraph", "subparagraph", "", -1,insert_latex_subparagraph);
glimmer.add_item_to_menu("_Insert/LaTeX Sectioning/", "appendix", "appendix", "", -1,insert_latex_appendix);
</python-definition>
