================================================================================ newcommand ================================================================================ \newcommand\foo{$\bar} -------------------------------------------------------------------------------- (document (newcommand (cs) (cs) (group (l) (math_shift) (cs) (r)))) ================================================================================ newcommand with parameter count ================================================================================ \newcommand\foo[2]{$\bar} -------------------------------------------------------------------------------- (document (newcommand (cs) (cs) (brack_group (lbrack) (text) (rbrack)) (group (l) (math_shift) (cs) (r)))) ================================================================================ newcommand with parameter count and default value ================================================================================ \newcommand\foo[2][wibble]{$\bar} -------------------------------------------------------------------------------- (document (newcommand (cs) (cs) (brack_group (lbrack) (text) (rbrack)) (brack_group (lbrack) (text) (rbrack)) (group (l) (math_shift) (cs) (r)))) ================================================================================ [makeatletter] @ sign not letter ================================================================================ \bar@wibble -------------------------------------------------------------------------------- (document (cs) (text)) ================================================================================ [makeatletter] @ sign is letter ================================================================================ \makeatletter\bar@wibble\makeatother -------------------------------------------------------------------------------- (document (makeatletter (cs)) (cs) (makeatother (cs))) ================================================================================ [makeatletter] @ sign is letter in text group ================================================================================ \makeatletter{\bar@wibble}\makeatother -------------------------------------------------------------------------------- (document (makeatletter (cs)) (group (l) (cs) (r)) (makeatother (cs))) ================================================================================ [makeatletter] @ sign is letter in optional text group ================================================================================ \makeatletter\usepackage[foo\bar@wibble]{foo}\makeatother -------------------------------------------------------------------------------- (document (makeatletter (cs)) (use (cs) (brack_group (lbrack) (text) (cs) (rbrack)) (group (l) (name) (r))) (makeatother (cs))) ================================================================================ [makeatletter] @ sign is letter then other ================================================================================ \makeatletter\bar@wibble\makeatother\quux@gronk -------------------------------------------------------------------------------- (document (makeatletter (cs)) (cs) (makeatother (cs)) (cs) (text)) ================================================================================ Error Recovery - display math inside newenvironment ================================================================================ \newenvironment{mathluacode}{\[\luacode}{\endluacode\]} -------------------------------------------------------------------------------- (document (newenvironment (cs) (group (l) (name) (name) (r)) (group (l) (latex_display_math (cs) (cs) (exit)) (r)) (group (l) (cs) (cs) (r)))) ================================================================================ Error Recovery - display math inside newenvironment ================================================================================ \newenvironment{mathluacode}{\(\luacode}{\endluacode\)} -------------------------------------------------------------------------------- (document (newenvironment (cs) (group (l) (name) (r)) (group (l) (cs) (cs) (r)) (group (l) (cs) (cs) (r)))) ================================================================================ Error Recovery - newenvironment based on existing environment (the wrong way) ================================================================================ \newenvironment{foo}{\begin{bar}}{\end{bar}} -------------------------------------------------------------------------------- (document (newenvironment (cs) (group (l) (name) (r)) (group (l) (cs) (group (l) (text) (r)) (r)) (group (l) (cs) (group (l) (text) (r)) (r)))) ================================================================================ newtheorem ================================================================================ \newtheorem{foo}{bar} -------------------------------------------------------------------------------- (document (newtheorem (cs) (group (l) (text) (r)) (group (l) (text) (r)))) ================================================================================ newtheorem with within counter ================================================================================ \newtheorem{foo}[wibble]{bar} -------------------------------------------------------------------------------- (document (newtheorem (cs) (group (l) (text) (r)) (brack_group (lbrack) (text) (rbrack)) (group (l) (text) (r)))) ================================================================================ newtheorem with like counter ================================================================================ \newtheorem{foo}{bar}[wibble] -------------------------------------------------------------------------------- (document (newtheorem (cs) (group (l) (text) (r)) (group (l) (text) (r)) (brack_group (lbrack) (text) (rbrack)))) ================================================================================ newtheorem with within counter and dangling bracket group ================================================================================ \newtheorem{foo}[wibble]{bar}[quux] -------------------------------------------------------------------------------- (document (newtheorem (cs) (group (l) (text) (r)) (brack_group (lbrack) (text) (rbrack)) (group (l) (text) (r))) (text)) ================================================================================ newcounter ================================================================================ \newcounter{foo} -------------------------------------------------------------------------------- (document (newcounter (cs) (group (l) (text) (r)))) ================================================================================ newcounter with optional parameter ================================================================================ \newcounter{foo}[bar] -------------------------------------------------------------------------------- (document (newcounter (cs) (group (l) (text) (r)) (brack_group (lbrack) (text) (rbrack)))) ================================================================================ newlength ================================================================================ \newlength{\foo} -------------------------------------------------------------------------------- (document (newlength (cs) (group (l) (cs) (r)))) ================================================================================ newsavebox ================================================================================ \newsavebox{\foo} -------------------------------------------------------------------------------- (document (newsavebox (cs) (group (l) (cs) (r)))) ================================================================================ newfont ================================================================================ \newfont{\foo}{wibble} -------------------------------------------------------------------------------- (document (newfont (cs) (group (l) (cs) (r)) (group (l) (text) (r)))) ================================================================================ protect in text mode ================================================================================ \protect\cite{foo} -------------------------------------------------------------------------------- (document (protect (cs) (cite (cs) (group (l) (text) (r))))) ================================================================================ protect in math mode ================================================================================ \protect\(\sqrt[n]{foo}\) -------------------------------------------------------------------------------- (document (protect (cs) (latex_inline_math (cs) (sqrt (cs) (brack_group (lbrack) (math) (rbrack)) (group (l) (math) (r))) (cs))))