1# tex/latex mode: tex primitives and plain tex macros 2# dani/8.1.2004 3# muzimuzhi/20 Aug 2019, 4 Nov 2019, 13 Nov 2019, 10 Aug 2020 4 5## 6## References 7## 8 9# - _texbook_: _The TeXbook_, Appx. B 10# - _teximpatient_: _TeX for the Impatient_, Chap. 13 11# (https://www.gnu.org/software/teximpatient/) 12# - _etex_: _The eTeX manual_ and _The e-TeX Short Reference Manual_ 13# (https://ctan.org/pkg/etex) 14 15 16## 17## Style Guide 18## 19 20# - The order of control sequences in this file is consistent with that 21# in _teximpatient_. 22# - Taking the conventions in _texbook_, use "o" as placeholder of text 23# accent (e.g., "\c{o}#n"), and use "a" as placeholder of math accent, # (e.g., "\dot{a}#m"). 24 25 26## 27## PART 1. control symbols, recorded in "latexparser.cpp" 28## 29 30## 1.1 tex primitives 31# - both math and text: "\ ", \-, \/ 32 33## 1.2 plain tex macros 34# TODO: handle arguments of control symbols used as accent command 35# - math only: \!, \*, "\,", \;, \>, \{, \|, \} 36# - text only: \", \', \., \=, \^, \`, \~ 37# - both math and text: \#, \$, \%, \&, \_ 38# - tabbing only: \+ 39 40 41## 42## PART 2. control words 43## 44 45## 2.1 tex primitives 46\above#*m 47\abovedisplayshortskip#* 48\abovedisplayskip#* 49\abovewithdelims#* 50\accent#* 51\adjdemerits#* 52\advance#* 53\afterassignment#* 54\aftergroup#* 55\atop#* 56\atopwithdelims#* 57\badness#* 58\baselineskip#* 59\batchmode#* 60\begingroup#* 61\belowdisplayshortskip#* 62\belowdisplayskip#* 63\binoppenalty#* 64\botmark#* 65\box#* 66\boxmaxdepth#* 67\brokenpenalty#* 68\catcode#* 69\char#* 70\chardef#* 71\cleaders#* 72\closein#* 73\closeout#* 74\clubpenalty#* 75\copy#* 76\count#* 77\countdef#* 78\cr#* 79\crcr#* 80\csname#* 81\day#* 82\deadcycles#* 83\def#* 84\defaulthyphenchar#* 85\defaultskewchar#* 86\delcode#* 87\delimiter#* 88\delimiterfactor#* 89\delimitershortfall#* 90\dimen#* 91\dimendef#* 92\discretionary#* 93\displayindent#* 94\displaylimits#* 95\displaystyle#* 96\displaywidowpenalty#* 97\displaywidth#* 98\divide#* 99\doublehyphendemerits#* 100\dp#* 101\dump#* 102\edef#* 103\else#* 104\emergencystretch#* 105\end#* 106\endcsname#* 107\endgroup#* 108\endinput#* 109\endlinechar#* 110\eqno{eqn num}#*m 111\errhelp#* 112\errmessage#* 113\errorcontextlines#* 114\errorstopmode#* 115\escapechar#* 116\everycr#* 117\everydisplay#* 118\everyhbox#* 119\everyjob#* 120\everymath#* 121\everypar#* 122\everyvbox#* 123\exhyphenpenalty#* 124\expandafter#* 125\fam#* 126\fi#* 127\finalhyphendemerits#* 128\firstmark#* 129\floatingpenalty#* 130\font#* 131\font{cmd}#dS 132\fontdimen#* 133\fontname#* 134\futurelet#* 135\gdef#* 136\global#* 137\globaldefs#* 138\halign#* 139\hangafter#* 140\hangindent#* 141\hbadness#* 142\hbox 143\hfil 144\hfill 145\hfilneg#* 146\hfuzz#* 147\hoffset#* 148\holdinginserts#* 149\hrule 150\hsize 151\hskip 152\hss#* 153\ht#* 154\hyphenation{space separated words} 155\hyphenchar#* 156\hyphenpenalty#* 157\if#* 158\ifcase#* 159\ifcat#* 160\ifdim#* 161\ifeof#* 162\iffalse#* 163\ifhbox#* 164\ifhmode#* 165\ifinner#* 166\ifmmode#* 167\ifnum#* 168\ifodd#* 169\iftrue#* 170\ifvbox#* 171\ifvmode#* 172\ifvoid#* 173\ifx#* 174\ignorespaces#* 175\immediate#* 176\indent#* 177\input %<file%>#*i 178\inputlineno#* 179\insert#* 180\insertpenalties#* 181\interlinepenalty#* 182\jobname#* 183\kern#* 184\language#* 185\lastbox#* 186\lastkern#* 187\lastpenalty#* 188\lastskip#* 189\lccode#* 190\leaders#* 191\left 192\lefthyphenmin#* 193\leftskip#* 194\leqno{eqn num}#* 195# for command interpretation 196\let 197\let{cmd}{def}#dS 198\limits#* 199\linepenalty#* 200\lineskip#* 201\lineskiplimit#* 202\long#* 203\looseness#* 204\lower#* 205\lowercase#* 206\mag#* 207\mark{mark text}#* 208\mathaccent#* 209\mathbin#* 210\mathchar#* 211\mathchardef#* 212\mathchoice#* 213\mathclose#* 214\mathcode#* 215\mathinner#* 216\mathop#* 217\mathopen#* 218\mathord#* 219\mathpunct#* 220\mathrel#* 221\mathsurround#* 222\maxdeadcycles#* 223\maxdepth#* 224\meaning#* 225\medmuskip#* 226\message#* 227\mkern#* 228\month#* 229\moveleft#* 230\moveright#* 231\mskip#* 232\multiply#* 233\muskip#* 234\muskipdef#* 235\newlinechar#* 236\noalign 237\noboundary#* 238\noexpand#* 239\noindent 240\nolimits#* 241\nonscript#* 242\nonstopmode#* 243\nulldelimiterspace#* 244\nullfont#* 245\number 246\omit#* 247\oalign#* 248\ooalign#* 249\openin#* 250\openout#* 251\or#* 252\outer#* 253\output#* 254\outputpenalty#* 255\over#* 256\overfullrule#* 257\overline{text}#m 258\overwithdelims#* 259\pagedepth#* 260\pagefilllstretch#* 261\pagefillstretch#* 262\pagefilstretch#* 263\pagegoal#* 264\pageshrink#* 265\pagestretch#* 266\pagetotal#* 267\par#* 268\parfillskip#* 269\parindent#* 270\parshape#* 271\parskip#* 272\pausing#* 273\penalty#* 274\postdisplaypenalty#* 275\predisplaypenalty#* 276\predisplaysize#* 277\pretolerance#* 278\prevdepth#* 279\prevgraf#* 280\radical#* 281\raise#* 282\read#* 283\relax 284\relpenalty#* 285\right 286\rightskip#* 287\righthyphenmin#* 288\scriptfont#* 289\scriptscriptfont#* 290\scriptscriptstyle#* 291\scriptspace#* 292\scriptstyle#* 293\scrollmode#* 294\setbox#* 295\setlanguage#* 296\sfcode#* 297\shipout#* 298\show#* 299\showbox#* 300\showboxbreadth#* 301\showboxdepth#* 302\showlists#* 303\showthe#* 304\skewchar#* 305\skip#* 306\skipdef#* 307\spacefactor#* 308\spaceskip#* 309\span#* 310\special#* 311\splitbotmark#* 312\splitfirstmark#* 313\splitmaxdepth#* 314\splittopskip#* 315\string#* 316\tabskip#* 317\textfont#* 318\textstyle#* 319\the#* 320\thickmuskip#* 321\thinmuskip#* 322\time#* 323\toks#* 324\toksdef#* 325\tolerance#* 326\topmark#* 327\topskip#* 328\tracingcommands#* 329\tracinglostchars#* 330\tracingmacros#* 331\tracingonline#* 332\tracingoutput#* 333\tracingpages#* 334\tracingparagraphs#* 335\tracingrestores#* 336\tracingstats#* 337\uccode#* 338\uchyph#* 339\underline{text}# 340\unhbox#* 341\unhcopy#* 342\unkern#* 343\unpenalty#* 344\unskip#* 345\unvbox#* 346\unvcopy#* 347\uppercase#* 348\vadjust#* 349\valign#* 350\vbadness#* 351\vbox 352\vcenter#* 353\vfil 354\vfill 355\vfilneg#* 356\vfuzz#* 357\voffset#* 358\vrule 359\vsize 360\vskip 361\vsplit#* 362\vss#* 363\vtop#* 364\wd#* 365\widowpenalty#* 366\write#* 367\xdef#* 368\xleaders#* 369\xspaceskip 370\year#* 371 372## 2.2 plain tex macros that are defined in latex 373\aa#n 374\AA#n 375\active#* 376\acute{a}#m 377\ae#n 378\AE#n 379\aleph#m 380\allowbreak#* 381\alpha#m 382\amalg#m 383\angle#m 384\approx#m 385\arccos#m 386\arcsin#m 387\arctan#m 388\arg#m 389\arrowvert#m 390\Arrowvert#m 391\ast#m 392\asymp#m 393\b{o}#n 394\backslash#m 395\bar{a}#m 396\beta#m 397\bf#* 398\bgroup#* 399\big#mK 400\Big#mK 401\bigbreak#* 402\bigcap#m 403\bigcirc#m 404\bigcup#m 405\bigg#mK 406\Bigg#mK 407\biggl#mK 408\Biggl#mK 409\biggm#mK 410\Biggm#mK 411\biggr#mK 412\Biggr#mK 413\bigl#mK 414\Bigl#mK 415\bigm#mK 416\Bigm#mK 417\bigodot#m 418\bigoplus#m 419\bigotimes#m 420\bigr#mK 421\Bigr#mK 422\bigskip#* 423\bigskipamount#* 424\bigsqcup#m 425\bigtriangledown#m 426\bigtriangleup#m 427\biguplus#m 428\bigvee#m 429\bigwedge#m 430\bmod#m 431\bordermatrix{%<line%> \cr %<line%> \cr}#*m 432\bot#m 433\bowtie#m 434\brace#*m 435\bracevert#*m 436\brack#*m 437\break#* 438\breve{a}#m 439\buildrel#* 440\bullet#m 441\c{o}#n 442\cal#* 443\cap#m 444\cases{contents}#* 445\cdot#m 446\cdotp#m 447\cdots#m 448# \centerline, in "latex-l2tabu.cwl" 449\check{a}#m 450\chi#m 451\choose#*m 452\circ#m 453\clap{text}#n 454\clubsuit#m 455\colon#m 456\cong#m 457\coprod#m 458\copyright#* 459\cos#m 460\cosh#m 461\cot#m 462\coth#m 463\csc#m 464\cup#m 465\d{o}#n 466\dag#* 467\dagger#m 468\dashv#m 469\ddag#* 470\ddagger#m 471\ddot{a}#m 472\ddots#m 473\deg#m 474\delta#m 475\Delta#m 476\det#m 477\diamond#m 478\diamondsuit#m 479\dim#m 480\displaylines#* 481\div#m 482\dot{a}#m 483\doteq#m 484\dotfill#* 485\dots 486\downarrow#m 487\Downarrow#m 488\downbracefill#*m 489\egroup#* 490\eject#* 491\ell#m 492\empty#* 493\emptyset#m 494\endgraf#* 495\endline#* 496\enskip#* 497\enspace#* 498\epsilon#m 499\equiv#m 500\eta#m 501\exists#m 502\exp#m 503\filbreak#* 504\flat#m 505\fmtname#* 506\fmtversion#* 507\footnote{text}# 508\forall#m 509\frenchspacing#* 510\frown#m 511\gamma#m 512\Gamma#m 513\gcd#m 514\ge#m 515\geq#m 516\gets#m 517\gg#m 518\goodbreak#* 519\grave{a}#m 520\H{o}#n 521\hat{a}#m 522\hbar#m 523\heartsuit#m 524\hglue#* 525\hidewidth#* 526\hom#m 527\hookleftarrow#m 528\hookrightarrow#m 529\hphantom{text} 530\hrulefill#* 531\i#n 532\ialign{align text}#* 533\iff#m 534\Im#m 535\imath#m 536\in#m 537\inf#m 538\infty#m 539\int#m 540\iota#m 541\it#* 542\item 543\j#n 544\jmath#m 545\jot#* 546\kappa#m 547\ker#m 548\l#n 549\L#n 550\lambda#m 551\Lambda#m 552\land#m 553\langle#m 554\lbrace#m 555\lbrack#m 556\lceil#m 557\ldotp#*m 558\ldots#m 559\le#m 560\leftarrow#m 561\Leftarrow#m 562\leftarrowfill#* 563\leftharpoondown#m 564\leftharpoonup#m 565\leftline{text}#* 566\leftrightarrow#m 567\Leftrightarrow#m 568\leq#m 569\lfloor#m 570\lg#m 571\lgroup#m 572\lim#m 573\liminf#m 574\limsup#m 575\line{text}#* 576\ll#m 577\llap{text}#n 578\lmoustache#*m 579\ln#m 580\lnot#m 581\log#m 582\longleftarrow#m 583\Longleftarrow#m 584\longleftrightarrow#m 585\Longleftrightarrow#m 586\longmapsto#m 587\longrightarrow#m 588\Longrightarrow#m 589\loop#* 590\lor#m 591\lq#*n 592\magstep#* 593\magstephalf#* 594\mapsto#m 595\mathpalette{arg1}{arg2}#*m 596\mathstrut#*m 597\matrix{%<line%> \cr %<line%> \cr}#*m 598\max#m 599\maxdimen#* 600\medbreak#* 601\medskip#* 602\medskipamount#* 603\mid#m 604\min#m 605\mit#*m 606\models#m 607\mp#m 608\mu#m 609\multispan%<number%>#* 610\nabla#m 611\narrower#* 612\natural#m 613\nearrow#m 614\ne#m 615\neg#m 616\negthinspace 617\neq#m 618\newbox#* 619\newbox{cmd}#dS 620\newcount#* 621\newcount{cmd}#dS 622\newdimen#* 623\newdimen{cmd}#dS 624\newfam#* 625\newfam{cmd}#dS 626\newhelp#* 627\newhelp{cmd}{help text}#*S 628\newif#* 629\newif{cmd}#dS 630\newinsert#* 631\newinsert{cmd}#dS 632\newlanguage#* 633\newlanguage{cmd}#dS 634\newmuskip#* 635\newmuskip{cmd}#dS 636\newread#* 637\newread{cmd}#dS 638\newskip#* 639\newskip{cmd}#dS 640\newtoks#* 641\newtoks{cmd}#dS 642\newwrite#* 643\newwrite{cmd}#dS 644\ni#m 645\nobreak#* 646\nointerlineskip#* 647\nonfrenchspacing#* 648\normalbaselines#* 649\normalbaselineskip#* 650\normallineskip#* 651\normallineskiplimit#* 652\not#m 653\notin#m 654\nu#m 655\null#* 656\nwarrow#m 657\o#n 658\O#n 659\obeylines#* 660\obeyspaces#* 661\odot#m 662\oe#n 663\OE#n 664\offinterlineskip#* 665\oint#m 666\omega#m 667\Omega#m 668\ominus#m 669\openup%<dimen%>#* 670\oplus#m 671\oslash#m 672\otimes#m 673\overbrace{text}#m 674\overleftarrow{text}#m 675\overrightarrow{text}#m 676\owns#m 677\P#n 678\parallel#m 679\partial#m 680\perp#m 681\phantom{text} 682\phi#m 683\Phi#m 684\pi#m 685\Pi#m 686\pm#m 687\pmatrix{%<line%> \cr %<line%> \cr}#*m 688\pmod#m 689\Pr#m 690\prec#m 691\preceq#m 692\prime#m 693\prod#m 694\propto#m 695\psi#m 696\Psi#m 697\qquad 698\quad 699\raggedbottom 700\raggedright 701\rangle#m 702\rbrace#m 703\rbrack#m 704\rceil#m 705\Re#m 706\repeat#* 707\rfloor#m 708\rgroup#m 709\rho#m 710\rightarrow#m 711\Rightarrow#m 712\rightarrowfill#*m 713\rightharpoondown#m 714\rightharpoonup#m 715\rightleftharpoons#m 716\rightline{text}#* 717\rlap{text}#n 718\rm#* 719\rmoustache#*m 720\romannumeral#* 721\root#*m 722\rq#*n 723\S#n 724\sb#*m 725\sb{subscript}#*m 726\searrow#m 727\sec#m 728\setminus#m 729\sharp#m 730\showhyphens{space separated words}#* 731\sigma#m 732\Sigma#m 733\sim#m 734\simeq#m 735\sin#m 736\sinh#m 737\skew{num}{math accent}{text}#* 738\sl#* 739\slash#*n 740\smallbreak#* 741\smallint#m 742\smallskip#* 743\smallskipamount#* 744\smash{text} 745\smile#m 746\sp#*m 747\sp{superscript}#*m 748\space 749\spadesuit#m 750\sqcap#m 751\sqcup#m 752\sqrt{arg}#m 753\sqsubseteq#m 754\sqsupseteq#m 755\ss#n 756\star#m 757\strut#*n 758\strutbox#* 759\subset#m 760\subseteq#m 761\succ#m 762\succeq#m 763\sum#m 764\sup#m 765\supset#m 766\supseteq#m 767\surd#m 768\swarrow#m 769\t{oo}#n 770\tan#m 771\tanh#m 772\tau#m 773\TeX#n 774\theta#m 775\Theta#m 776\thinspace 777\tilde{a}#m 778\times#m 779\to#m 780\top#m 781\tracingall#* 782\triangle#m 783\triangleleft#m 784\triangleright#m 785\tt#* 786\u{o}#n 787\underbar{text}#* 788\underbrace{text}#m 789\uparrow#m 790\Uparrow#m 791\upbracefill#* 792\updownarrow#m 793\Updownarrow#m 794\uplus#m 795\upsilon#m 796\Upsilon#m 797\v{o}#n 798\varepsilon#m 799\varphi#m 800\varpi#m 801\varrho#m 802\varsigma#m 803\vartheta#m 804\vdash#m 805\vec{a}#m 806\vee#m 807\vert#m 808\Vert#m 809\vglue#* 810\vphantom{text} 811\wedge#m 812\widehat{a}#m 813\widetilde{a}#m 814\wlog{token list}#* 815\wp#m 816\wr#m 817\xi#m 818\Xi#m 819\zeta#m 820 821 822## 823## PART 3. Miscellany, those missing in _impatient_ 824## 825\do#* 826\dospecials#* 827\centering 828\footins#* 829\footnoterule#* 830\interdisplaylinepenalty#* 831\interfootnotelinepenalty#* 832\joinrel#*m 833\leavevmode#* 834\patterns{patterns}#* 835\removelastskip#* 836 837 838## 839## PART 4. Combinations 840## 841 842# \bigxxx family 843\big(%|\big)#mM 844\big[%|\big]#mM 845\big|%|\big|#mM 846\Big(%|\Big)#mM 847\Big[%|\Big]#mM 848\Big|%|\Big|#mM 849 850\bigl(%|\bigr)#mM 851\bigl[%|\bigr]#mM 852\bigl\{%|\bigr\}#mM 853\Bigl(%|\Bigr)#mM 854\Bigl[%|\Bigr]#mM 855\Bigl\{%|\Bigr\}#mM 856 857\biggl(%|\biggr)#mM 858\biggl[%|\biggr]#mM 859\biggl\{%|\biggr\}#mM 860\Biggl(%|\Biggr)#mM 861\Biggl[%|\Biggr]#mM 862\Biggl\{%|\Biggr\}#mM 863 864# \ifxxx family 865\if%<..%>\fi#* 866\ifcase%<..%>\fi#* 867\ifcat%<..%>\fi#* 868\ifdim%<..%>\fi#* 869\ifeof%<..%>\fi#* 870\iffalse%<..%>\fi#* 871\ifhbox%<..%>\fi#* 872\ifhmode%<..%>\fi#* 873\ifinner%<..%>\fi#* 874\ifmmode%<..%>\fi#* 875\ifnum%<..%>\fi#* 876\ifodd%<..%>\fi#* 877\iftrue%<..%>\fi#* 878\ifvbox%<..%>\fi#* 879\ifvmode%<..%>\fi#* 880\ifvoid%<..%>\fi#* 881\ifx%<..%>\fi#* 882\ifcase%<..%>\or%<..%>\fi#* 883 884\if%<..%>\else%<..%>\fi#* 885\ifcase%<..%>\else%<..%>\fi#* 886\ifcat%<..%>\else%<..%>\fi#* 887\ifdim%<..%>\else%<..%>\fi#* 888\ifeof%<..%>\else%<..%>\fi#* 889\iffalse%<..%>\else%<..%>\fi#* 890\ifhbox%<..%>\else%<..%>\fi#* 891\ifhmode%<..%>\else%<..%>\fi#* 892\ifinner%<..%>\else%<..%>\fi#* 893\ifmmode%<..%>\else%<..%>\fi#* 894\ifnum%<..%>\else%<..%>\fi#* 895\ifodd%<..%>\else%<..%>\fi#* 896\iftrue%<..%>\else%<..%>\fi#* 897\ifvbox%<..%>\else%<..%>\fi#* 898\ifvmode%<..%>\else%<..%>\fi#* 899\ifvoid%<..%>\else%<..%>\fi#* 900\ifx%<..%>\else%<..%>\fi#* 901\ifcase%<..%>\or%<..%>\else%<..%>\fi#* 902 903# \left ... \right 904\left%<..%>\right#mM 905\left(%|\right)#mM 906\left[%|\right]#mM 907\left\{%|\right\}#mM 908\left|%|\right|#mM 909 910# math operators usually with super/sub-scripts 911\int_{min}^{max}#m 912\int\limits_{min}^{max}#*m 913\lim_{min}#m 914\lim\limits_{min}#m 915\prod_{min}^{max}#m 916\prod\limits_{min}^{max}#*m 917\sum_{min}^{max}#m 918\sum\limits_{min}^{max}#*m 919 920# others 921\begingroup%<..%>\endgroup#* 922\bgroup%<..%>\egroup#* 923\root %<arg1%> \of %<arg2%>#*m 924\settabs %<number%> \columns#* 925\settabs \+ %<sample line%> \cr#* 926 927 928## 929## PART 5. etex primitives 930## 931 932\beginL#* 933\beginR#* 934\botmarks#* 935\detokenize#* 936\endL#* 937\endR#* 938\eTeXrevision#* 939\eTeXversion#* 940\everyeof#* 941\firstmarks#* 942\fontcharht#* 943\fontcharwd#* 944\fontchardp#* 945\fontcharic#* 946\currentgrouplevel#* 947\currentgrouptype#* 948\currentiflevel#* 949\currentiftype#* 950\currentifbranch#* 951\ifcsname 952\ifdefined 953\interactionmode#* 954\lastlinefit#* 955\lastnodetype#* 956\marks#* 957\middle 958\numexpr 959\parshapedimen#* 960\parshapeindent#* 961\parshapelength#* 962\predisplaydirection#* 963\protected#* 964\readline%<number%> to %<control sequence%>#* 965\scantokens#* 966\showgroups#* 967\showtokens#* 968\splitfirstmarks#* 969\splitbotmarks#* 970\TeXXeTstate#* 971\topmarks#* 972\tracingassigns#* 973\tracinggroups#* 974\tracingifs#* 975\tracingscantokens#* 976\unexpanded#* 977\unless#* 978\dimexpr#* 979\glueexpr#* 980\muexpr#* 981\gluestretch#* 982\glueshrink#* 983\gluestretchorder#* 984\glueshrinkorder#* 985\gluetomu#* 986\mutoglue#* 987\interlinepenalties#* 988\clubpenalties#* 989\widowpenalties#* 990\displaywidowpenalties#* 991\tracingnesting#* 992\savingvdiscards#* 993\savinghyphcodes#* 994\showifs#* 995\pagediscards#* 996\splitdiscards#* 997\iffontchar#* 998