home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / text / latex / mac / alpha60.hqx / Tcl / SystemCode / latexMenu.tcl < prev    next >
Encoding:
Text File  |  1995-07-09  |  13.0 KB  |  754 lines

  1. #############################################################################
  2. #############################################################################
  3. #
  4. # latexMenu.tcl (called from latex.tcl)
  5. #
  6. # LaTeX menu definition and key bindings
  7. #
  8. #############################################################################
  9. #
  10. # Author:  Tom Scavo (trscavo@syr.edu)
  11. #
  12. #############################################################################
  13. #############################################################################
  14.  
  15. proc getTeXMenu {} {
  16.     return {
  17.     
  18.         "/TTypeset"
  19.         
  20.         {menu -M TeX -n Goto -m -p interpretMenuItem {
  21.             "<U/SLaTeX"
  22.             "BibTeX"
  23.             "MakeIndex"
  24.             "(-"
  25.             {/cNext Tab Stop}
  26.             {<U/cPrev Tab Stop}
  27.             {<B/cnth Tab Stop╔}
  28.             "(-"
  29.             {Next Command}
  30.             {Prev Command}
  31.             {Next Command Select}
  32.             {Prev Command Select}
  33.             {Next Command Select With Args}
  34.             {Prev Command Select With Args}
  35.             "(-"
  36.             {Next Environment}
  37.             {Prev Environment}
  38.             {Next Environment Select}
  39.             {Prev Environment Select}
  40.             "(-"
  41.             {Next Section}
  42.             {Prev Section}
  43.             {Next Section Select}
  44.             {Prev Section Select}
  45.             {Next Subsection}
  46.             {Prev Subsection}
  47.             {Next Subsection Select}
  48.             {Prev Subsection Select}
  49.             }
  50.         }
  51.         
  52.         {menu -M TeX -n {LaTeX Utilities} -m -p interpretMenuItem {
  53.             {<I<O/TChoose Command}
  54.             "(-"
  55.             {<I/cInsert Literal Tab}
  56.             {Insert Tab Stop}
  57.             {Insert Reference╔}
  58.             "(-"
  59.             {<O/cDelete Tab Stops}
  60.             {Delete Comments}
  61.             "(-"
  62.             {Convert Quotes}
  63.             {Convert Dollar Signs}
  64.             "(-"
  65.             {Remove Auxiliary Files}
  66.             }
  67.         }
  68.         
  69.         "(-"
  70.         
  71.         {menu -M TeX -n Documents -m -p interpretMenuItem {
  72.             "letter"
  73.             "article"
  74.             "report"
  75.             "book"
  76.             "slides"
  77.             "custom╔"
  78.             "(-"
  79.             "options╔"
  80.             "packages╔"
  81.             "(-"
  82.             "filecontents╔"
  83.             }
  84.         }
  85.         
  86.         {menu -M TeX -n {Page Layout} -m -p interpretMenuItem {
  87.             "maketitle"
  88.             "(-"
  89.             "abstract"
  90.             "titlepage"
  91.             "(-"
  92.             "pagestyle╔"
  93.             "thispagestyle╔"
  94.             "pagenumbering╔"
  95.             "(-"
  96.             "twocolumn"
  97.             "onecolumn"
  98.             }
  99.         }
  100.         
  101.         {menu -M TeX -n Sectioning -m -p interpretMenuItem {
  102.             "part"
  103.             "chapter"
  104.             "section"
  105.             "subsection"
  106.             "subsubsection"
  107.             "paragraph"
  108.             "subparagraph"
  109.             "(-"
  110.             "appendix"
  111.             }
  112.         }
  113.         
  114.         "(-"
  115.         
  116.         {menu -M TeX -n {Text Style} -m -p interpretMenuItem {
  117.             "<B<I/Eemph"
  118.             "<B<O/Uunderline"
  119.             "(-"
  120.             "textup"
  121.             "<B<I/Itextit"
  122.             "<B<I/Stextsl"
  123.             "<B<I/Htextsc"
  124.             "(-"
  125.             "textmd"
  126.             "<B<I/Btextbf"
  127.             "(-"
  128.             "<B<I/Rtextrm"
  129.             "<B<I/Wtextsf"
  130.             "<B<I/Ytexttt"
  131.             "(-"
  132.             "textnormal"
  133.             }
  134.         }
  135.         
  136.         {menu -M TeX -n {Text Size} -m -p interpretMenuItem {
  137.             "tiny"
  138.             "scriptsize"
  139.             "footnotesize"
  140.             "small"
  141.             "normalsize"
  142.             "large"
  143.             "Large"
  144.             "LARGE"
  145.             "huge"
  146.             "Huge"
  147.             }
  148.         }
  149.         
  150.         {menu -M TeX -n International -m -p interpretMenuItem {
  151.             {ÿ}
  152.             {ù}
  153.             {Ö}
  154.             {Ü}
  155.             {¢}
  156.             "(-"
  157.             {ì}
  158.             {╧}
  159.             {╛}
  160.             {î}
  161.             {┐}
  162.             "(-"
  163.             {é}
  164.             {╬}
  165.             {«}
  166.             {ü}
  167.             {»}
  168.             "(-"
  169.             {º}
  170.             {┴}
  171.             {└}
  172.             }
  173.         }
  174.         
  175.         {menu -M TeX -n Environments -m -p interpretMenuItem {
  176.             "<I/kitemize╔"
  177.             "<U<I/kenumerate╔"
  178.             "<B<I/kdescription╔"
  179.             "thebibliography╔"
  180.             "(-"
  181.             "<I/lslide"
  182.             "<U<I/loverlay"
  183.             "<B<I/lnote"
  184.             "(-"
  185.             "<I/mfigure"
  186.             "<U<I/mtable"
  187.             "<B<I/mtabular╔"
  188.             "(-"
  189.             "<I/nverbatim"
  190.             "<U<I/nquote"
  191.             "<B<I/nquotation"
  192.             "verse"
  193.             "(-"
  194.             "<I/ocenter"
  195.             "<U<I/oflushleft"
  196.             "<B<I/oflushright"
  197.             "(-"
  198.             "<I/pgeneral╔"
  199.             }
  200.         }
  201.         
  202.         {menu -M TeX -n Boxes -m -p interpretMenuItem {
  203.             "<B<I/Mmbox"
  204.             "makebox"
  205.             "fbox"
  206.             "framebox"
  207.             "(-"
  208.             "newsavebox"
  209.             "sbox"
  210.             "savebox"
  211.             "usebox"
  212.             "(-"
  213.             "raisebox"
  214.             "(-"
  215.             "parbox"
  216.             "minipage"
  217.             "(-"
  218.             "rule"
  219.             }
  220.         }
  221.         
  222.         {menu -M TeX -n Miscellaneous -m -p interpretMenuItem {
  223.             "<B<I/Ffootnote"
  224.             {<B<I/Nmarginal note}
  225.             "(-"
  226.             "<B<I/Llabel"
  227.             "<B<I/Xref"
  228.             "<B<I/Ppageref"
  229.             "<B<I/Ccite"
  230.             "(-"
  231.             "<B<I/Jitem"
  232.             "(-"
  233.             "<B<I/'quotes"
  234.             {<U<B<I/'double quotes}
  235.             "(-"
  236.             "!╔ellipsis"
  237.             "!╨en-dash"
  238.             "!╤em-dash"
  239.             {TeX logo}
  240.             {LaTeX logo}
  241.             {LaTeX2e logo}
  242.             "date"
  243.             "(-"
  244.             "!ádag"
  245.             "ddag"
  246.             {!ñsection mark}
  247.             {!ªparagraph mark}
  248.             "!⌐copyright"
  249.             "!úpounds"
  250.             }
  251.         }
  252.         
  253.         "(-"
  254.         
  255.         {menu -M TeX -n {Math Modes} -m -p interpretMenuItem {}}
  256.         
  257.         {menu -M TeX -n {Math Style} -m -p interpretMenuItem {
  258.             "<B<I<O/Imathit"
  259.             "<B<I<O/Rmathrm"
  260.             "<B<I<O/Bmathbf"
  261.             "<B<I<O/Wmathsf"
  262.             "<B<I<O/Ymathtt"
  263.             "<B<I<O/Cmathcal"
  264.             "(-"
  265.             "<B<I<O/Ddisplaystyle"
  266.             "<B<I<O/Ttextstyle"
  267.             "<B<I<O/Sscriptstyle"
  268.             "scriptscriptstyle"
  269.             }
  270.         }
  271.         
  272.         {menu -M TeX -n {Math Environments} -m -p interpretMenuItem {
  273.             "<I/imath"
  274.             "(-"
  275.             "<U<I/idisplaymath"
  276.             "<B<I/iequation"
  277.             "(-"
  278.             "<U<I/jeqnarray*╔"
  279.             "<B<I/jeqnarray╔"
  280.             "(-"
  281.             "<I/jarray╔"
  282.             "(-"
  283.             "<I/pgeneral╔"
  284.             }
  285.         }
  286.         
  287.         {menu -M TeX -n Formulas -m -p interpretMenuItem {
  288.             "subscript"
  289.             "superscript"
  290.             "(-"
  291.             "<B<O/Ffrac"
  292.             {<B<O/Rsqrt}
  293.             {nth root}
  294.             "(-"
  295.             {<B<O/1one parameter╔}
  296.             {<B<O/2two parameters╔}
  297.             }
  298.         }
  299.     
  300.         {menu -M TeX -n Greek -m -p interpretMenuItem {
  301.             "alpha"
  302.             "beta"
  303.             "<SGamma"
  304.             "<Sgamma"
  305.             "<E<SDelta"
  306.             "<Sdelta"
  307.             "epsilon"
  308.             "zeta"
  309.             "eta"
  310.             "<STheta"
  311.             "<Stheta"
  312.             "iota"
  313.             "kappa"
  314.             "<SLambda"
  315.             "<Slambda"
  316.             "mu"
  317.             "nu"
  318.             "<SXi"
  319.             "<Sxi"
  320.             "omicron"
  321.             "<SPi"
  322.             "<Spi"
  323.             "rho"
  324.             "<SSigma"
  325.             "<Ssigma"
  326.             "tau"
  327.             "<SUpsilon"
  328.             "<Supsilon"
  329.             "<E<SPhi"
  330.             "<Sphi"
  331.             "chi"
  332.             "<SPsi"
  333.             "<Spsi"
  334.             "<E<SOmega"
  335.             "<Somega"
  336.             "(-"
  337.             "varepsilon"
  338.             "vartheta"
  339.             "varpi"
  340.             "varrho"
  341.             "varsigma"
  342.             "varphi"
  343.             }
  344.         }
  345.             
  346.         {menu -M TeX -n {Binary Operators} -m -p interpretMenuItem {
  347.             "!▒pm"
  348.             "mp"
  349.             "times"
  350.             "!╓div"
  351.             "ast"
  352.             "star"
  353.             "circ"
  354.             "bullet"
  355.             "cdot"
  356.             "cap"
  357.             "cup"
  358.             "uplus"
  359.             "sqcap"
  360.             "sqcup"
  361.             "vee"
  362.             "wedge"
  363.             "setminus"
  364.             "(-"
  365.             "diamond"
  366.             "bigtriangleup"
  367.             "bigtriangledown"
  368.             "triangleleft"
  369.             "triangleright"
  370.             "lhd"
  371.             "rhd"
  372.             "unlhd"
  373.             "unrhd"
  374.             "(-"
  375.             "oplus"
  376.             "ominus"
  377.             "otimes"
  378.             "oslash"
  379.             "odot"
  380.             "(-"
  381.             "bigcirc"
  382.             "dagger"
  383.             "ddagger"
  384.             "amalg"
  385.             "wr"
  386.             }
  387.         }
  388.         
  389.         {menu -M TeX -n Relations -m -p interpretMenuItem {
  390.             "<S!│geq"
  391.             "<S!▓leq"
  392.             "<E<Ssucc"
  393.             "<Sprec"
  394.             "<E<Ssucceq"
  395.             "<Spreceq"
  396.             "<E<S!╚gg"
  397.             "<S!╟ll"
  398.             "<E<Ssupset"
  399.             "<Ssubset"
  400.             "<E<Ssupseteq"
  401.             "<Ssubseteq"
  402.             "<E<Ssqsupset"
  403.             "<Ssqsubset"
  404.             "<E<Ssqsupseteq"
  405.             "<Ssqsubseteq"
  406.             "<E<Sni"
  407.             "<Sin"
  408.             "<E<Sdashv"
  409.             "<Svdash"
  410.             "(-"
  411.             "equiv"
  412.             "sim"
  413.             "simeq"
  414.             "asymp"
  415.             "!┼approx"
  416.             "cong"
  417.             "!¡neq"
  418.             "doteq"
  419.             "propto"
  420.             "(-"
  421.             "models"
  422.             "perp"
  423.             "mid"
  424.             "parallel"
  425.             "bowtie"
  426.             "join"
  427.             "smile"
  428.             "frown"
  429.             }
  430.         }
  431.         
  432.         {menu -M TeX -n Arrows -m -p interpretMenuItem {
  433.             "<SLeftarrow"
  434.             "<Sleftarrow"
  435.             "<E<SRightarrow"
  436.             "<Srightarrow"
  437.             "<E<SLeftrightarrow"
  438.             "<Sleftrightarrow"
  439.             "<E<SLongleftarrow"
  440.             "<Slongleftarrow"
  441.             "<E<SLongrightarrow"
  442.             "<Slongrightarrow"
  443.             "<E<SLongleftrightarrow"
  444.             "<Slongleftrightarrow"
  445.             "(-"
  446.             "<SUparrow"
  447.             "<Suparrow"
  448.             "<E<SDownarrow"
  449.             "<Sdownarrow"
  450.             "<E<SUpdownarrow"
  451.             "<Supdownarrow"
  452.             "(-"
  453.             "mapsto"
  454.             "longmapsto"
  455.             "leadsto"
  456.             "(-"
  457.             "leftharpoonup"
  458.             "rightharpoonup"
  459.             "leftharpoondown"
  460.             "rightharpoondown"
  461.             "rightleftharpoons"
  462.             "hookleftarrow"
  463.             "hookrightarrow"
  464.             "nearrow"
  465.             "searrow"
  466.             "swarrow"
  467.             "nwarrow"
  468.             }
  469.         }
  470.         
  471.         {menu -M TeX -n Dots -m -p interpretMenuItem {
  472.             "bullet"
  473.             "cdot"
  474.             "(-"
  475.             "ldots"
  476.             "cdots"
  477.             "vdots"
  478.             "ddots"
  479.             }
  480.         }
  481.         
  482.         {menu -M TeX -n Symbols -m -p interpretMenuItem {
  483.             "aleph"
  484.             "hbar"
  485.             "imath"
  486.             "jmath"
  487.             "ell"
  488.             "wp"
  489.             "Re"
  490.             "Im"
  491.             "mho"
  492.             "(-"
  493.             "angle"
  494.             "backslash"
  495.             "bot"
  496.             "emptyset"
  497.             "exists"
  498.             "forall"
  499.             "!░infty"
  500.             "nabla"
  501.             "!┬neg"
  502.             "!╢partial"
  503.             "prime"
  504.             "!├surd"
  505.             "top"
  506.             "(-"
  507.             "Box"
  508.             "Diamond"
  509.             "triangle"
  510.             "clubsuit"
  511.             "diamondsuit"
  512.             "heartsuit"
  513.             "spadesuit"
  514.             "(-"
  515.             "flat"
  516.             "natural"
  517.             "sharp"
  518.             }
  519.         }
  520.             
  521.         {menu -M TeX -n Functions -m -p interpretMenuItem {
  522.             "arccos"
  523.             "arcsin"
  524.             "arctan"
  525.             "arg"
  526.             "cos"
  527.             "cosh"
  528.             "cot"
  529.             "coth"
  530.             "csc"
  531.             "deg"
  532.             "det"
  533.             "dim"
  534.             "exp"
  535.             "gcd"
  536.             "hom"
  537.             "inf"
  538.             "ker"
  539.             "lg"
  540.             "lim"
  541.             "liminf"
  542.             "limsup"
  543.             "ln"
  544.             "log"
  545.             "max"
  546.             "min"
  547.             "Pr"
  548.             "sec"
  549.             "sin"
  550.             "sinh"
  551.             "sup"
  552.             "tan"
  553.             "tanh"
  554.             "(-"
  555.             "bmod"
  556.             "pmod"
  557.             }
  558.         }
  559.     
  560.         {menu -M TeX -n {Large Operators} -m -p interpretMenuItem {
  561.             "<B<O/Ssum"
  562.             "<B<O/Pprod"
  563.             "coprod"
  564.             "<B<O/Iint"
  565.             "oint"
  566.             "(-"
  567.             "bigcup"
  568.             "bigcap"
  569.             "bigsqcup"
  570.             "bigvee"
  571.             "bigwedge"
  572.             "bigodot"
  573.             "bigotimes"
  574.             "bigoplus"
  575.             "biguplus"
  576.             }
  577.         }
  578.         
  579.         {menu -M TeX -n Delimiters -m -p interpretMenuItem {
  580.             "parentheses"
  581.             "brackets"
  582.             "braces"
  583.             {vertical bars}
  584.             {other delims╔}
  585.             "(-"
  586.             {half-open interval}
  587.             {half-closed interval}
  588.             "(-"
  589.             {big parentheses}
  590.             {big brackets}
  591.             {big braces}
  592.             {big vertical bars}
  593.             {other big delims╔}
  594.             "(-"
  595.             {big left brace}
  596.             {other mixed big delims╔}
  597.             }
  598.         }
  599.             
  600.         {menu -M TeX -n {Math Accents} -m -p interpretMenuItem {
  601.             "<B<O/Aacute"
  602.             "<B<O/Bbar"
  603.             "breve"
  604.             "<B<O/Ccheck"
  605.             "<B<O/Ddot"
  606.             "ddot"
  607.             "<B<O/Ggrave"
  608.             "<B<O/Hhat"
  609.             "<B<O/Ttilde"
  610.             "<B<O/Vvec"
  611.             "(-"
  612.             "widehat"
  613.             "widetilde"
  614.             "(-"
  615.             "imath"
  616.             "jmath"
  617.             }
  618.         }
  619.         
  620.         {menu -M TeX -n Grouping -m -p interpretMenuItem {
  621.             "<B<O/Uunderline"
  622.             "<B<O/Ooverline"
  623.             "underbrace"
  624.             "overbrace"
  625.             "(-"
  626.             "stackrel"
  627.             }
  628.         }
  629.         
  630.         {menu -M TeX -n Spacing -m -p interpretMenuItem {
  631.             {neg thin}
  632.             "thin"
  633.             "medium"
  634.             "thick"
  635.             "(-"
  636.             "quad"
  637.             "qquad"
  638.             "(-"
  639.             "hspace"
  640.             "vspace"
  641.             "(-"
  642.             "hfill"
  643.             "vfill"
  644.             "(-"
  645.             "smallskip"
  646.             "medskip"
  647.             "bigskip"
  648.             }
  649.         }
  650.     }
  651. }
  652.  
  653.  
  654. proc buildLaTeXMenu {} {
  655.     global latexMenu TeXmodeVars
  656.  
  657.     menu -M TeX -n $latexMenu -m -p interpretMenuItem  [getTeXMenu]
  658.     
  659.     if {$TeXmodeVars(useDollarSigns)} then {
  660.         menu -M TeX -n {Math Modes} -m -p interpretMenuItem {
  661.             {<B<O/4TeX math}
  662.             {<B<I<O/4TeX displaymath}
  663.             "(-"
  664.             {LaTeX math}
  665.             {LaTeX displaymath}
  666.         }
  667.     } else {
  668.         menu -M TeX -n {Math Modes} -m -p interpretMenuItem {
  669.             {TeX math}
  670.             {TeX displaymath}
  671.             "(-"
  672.             {<B<O/4LaTeX math}
  673.             {<B<I<O/4LaTeX displaymath}
  674.         }
  675.     }
  676.  
  677. }
  678.  
  679. proc interpretMenuItem {menu item} {
  680.     switch $item {
  681.         "Typeset"  {set func "typeset"}
  682.         "LaTeX"  {set func "latex"}
  683.         "BibTeX"  {set func "bibtex"}
  684.         "MakeIndex"  {set func "makeindex"}
  685.         {Next Tab Stop}  {set func "nextTabStop"}
  686.         {Prev Tab Stop}  {set func "prevTabStop"}
  687.         {nth Tab Stop}  {set func nthTabStop}
  688.         {Next Command}  {set func "nextCommand"}
  689.         {Prev Command}  {set func "prevCommand"}
  690.         {Next Command Select}  {set func "nextCommandSelect"}
  691.         {Prev Command Select}  {set func "prevCommandSelect"}
  692.         {Next Command Select With Args}  {set func "nextCommandSelectWithArgs"}
  693.         {Prev Command Select With Args}  {set func "prevCommandSelectWithArgs"}
  694.         {Next Environment}  {set func "nextEnvironment"}
  695.         {Prev Environment}  {set func "prevEnvironment"}
  696.         {Next Environment Select}  {set func "nextEnvironmentSelect"}
  697.         {Prev Environment Select}  {set func "prevEnvironmentSelect"}
  698.         {Next Section}  {set func "nextSection"}
  699.         {Prev Section}  {set func "prevSection"}
  700.         {Next Section Select}  {set func "nextSectionSelect"}
  701.         {Prev Section Select}  {set func "prevSectionSelect"}
  702.         {Next Subsection}  {set func "nextSubsection"}
  703.         {Prev Subsection}  {set func "prevSubsection"}
  704.         {Next Subsection Select}  {set func "nextSubsectionSelect"}
  705.         {Prev Subsection Select}  {set func "prevSubsectionSelect"}
  706.         {Choose Command}  {set func "chooseCommand"}
  707.         {Insert Literal Tab}  {set func "insertLiteralTab"}
  708.         {Insert Tab Stop}  {set func "insertTabStop"}
  709.         {Insert Reference}  {set func "insertReference"}
  710.         {Delete Tab Stops}  {set func "deleteTabStops"}
  711.         {Delete Comments}  {set func "deleteComments"}
  712.         {Convert Quotes}  {set func "convertQuotes"}
  713.         {Convert Dollar Signs}  {set func "convertDollarSigns"}
  714.         {Remove Auxiliary Files}  {set func "removeAuxiliaryFiles"}
  715.         "array"  {set func "myArray"}
  716.         "eqnarray\*"  {set func "eqnarrayStar"}
  717.         "ellipsis"  {set func "ldots"}
  718.         {TeX logo}  {set func "texLogo"}
  719.         {LaTeX logo}  {set func "latexLogo"}
  720.         {LaTeX2e logo}  {set func "latex2eLogo"}
  721.         "date" {set func "today"}
  722.         {section mark}  {set func "sectionMark"}
  723.         {paragraph mark}  {set func "paragraphMark"}
  724.         {double quotes}  {set func "dblQuotes"}
  725.         {marginal note}  {set func "marginalNote"}
  726.         "item" {set func "insertItem"}
  727.         {TeX math}  {set func "texMath"}
  728.         {TeX displaymath}  {set func "texDisplaymath"}
  729.         {LaTeX math}  {set func "latexMath"}
  730.         {LaTeX displaymath}  {set func "latexDisplaymath"}
  731.         {blackboard bold}  {set func "blackboardBold"}
  732.         {frac}  {set func "fraction"}
  733.         {sqrt}  {set func "squareRoot"}
  734.         {nth root}  {set func "nthRoot"}
  735.         {one parameter}  {set func "oneParameter"}
  736.         {two parameters}  {set func "twoParameters"}
  737.         {join}  {set func "myJoin"}
  738.         {vertical bars}  {set func "absoluteValue"}
  739.         {other delims}  {set func "otherDelims"}
  740.         {half-open interval}  {set func "half-openInterval"}
  741.         {half-closed interval}  {set func "half-closedInterval"}
  742.         {big parentheses}  {set func "bigParentheses"}
  743.         {big brackets}  {set func "bigBrackets"}
  744.         {big braces}  {set func "bigBraces"}
  745.         {big vertical bars}  {set func "bigAbsoluteValue"}
  746.         {other big delims}  {set func "otherBigDelims"}
  747.         {big left brace}  {set func "bigLeftBrace"}
  748.         {other mixed big delims}  {set func "otherMixedBigDelims"}
  749.         {neg thin}  {set func "negThin"}
  750.         default {set func $item}
  751.     }
  752.     eval $func
  753. }
  754.