================================================================================ display math ================================================================================ foo$$bar$$quux -------------------------------------------------------------------------------- (document (text) (tex_display_math (display_math_shift) (math) (display_math_shift)) (text)) ================================================================================ empty display math ================================================================================ foo$$$$quux -------------------------------------------------------------------------------- (document (text) (tex_display_math (display_math_shift) (display_math_shift)) (text)) ================================================================================ inline math ================================================================================ foo$bar$quux -------------------------------------------------------------------------------- (document (text) (tex_inline_math (math_shift) (math) (math_shift)) (text)) ================================================================================ consecutive inline math ================================================================================ foo$bar$$wibble$quux -------------------------------------------------------------------------------- (document (text) (tex_inline_math (math_shift) (math) (math_shift)) (tex_inline_math (math_shift) (math) (math_shift)) (text)) ================================================================================ Error Recovery - inline math - unterminated inside group #1 ================================================================================ {foo$bar} {foo$bar{quux}wibble} -------------------------------------------------------------------------------- (document (group (l) (text) (tex_inline_math (math_shift) (math) (exit)) (r)) (group (l) (text) (tex_inline_math (math_shift) (math) (group (l) (math) (r)) (math) (exit)) (r))) ================================================================================ Error Recovery - inline math - unterminated by EOF ================================================================================ foo$bar -------------------------------------------------------------------------------- (document (text) (tex_inline_math (math_shift) (math) (exit))) ================================================================================ Error Recovery - display math - unterminated inside group ================================================================================ {foo$$bar} {foo$$bar{quux}wibble} {foo$$bar$} {foo$$bar{quux}wibble$} -------------------------------------------------------------------------------- (document (group (l) (text) (tex_display_math (display_math_shift) (math) (exit)) (r)) (group (l) (text) (tex_display_math (display_math_shift) (math) (group (l) (math) (r)) (math) (exit)) (r)) (group (l) (text) (tex_display_math (display_math_shift) (math) (math_shift) (exit)) (r)) (group (l) (text) (tex_display_math (display_math_shift) (math) (group (l) (math) (r)) (math) (math_shift) (exit)) (r))) ================================================================================ Error Recovery - display math - unterminated by EOF ================================================================================ foo$$bar -------------------------------------------------------------------------------- (document (text) (tex_display_math (display_math_shift) (math) (exit))) ================================================================================ Error Recovery - display math - unterminated by EOF with single math shift ================================================================================ foo$$bar$ -------------------------------------------------------------------------------- (document (text) (tex_display_math (display_math_shift) (math) (math_shift) (exit))) ================================================================================ Error Recovery - inline math - unterminated inside group #2 ================================================================================ {foo$bar} {foo$bar{quux}wibble} -------------------------------------------------------------------------------- (document (group (l) (text) (tex_inline_math (math_shift) (math) (exit)) (r)) (group (l) (text) (tex_inline_math (math_shift) (math) (group (l) (math) (r)) (math) (exit)) (r))) ================================================================================ Plain text ================================================================================ fubar -------------------------------------------------------------------------------- (document (text)) ================================================================================ Single command ================================================================================ fubar\quux wibble -------------------------------------------------------------------------------- (document (text) (cs) (text)) ================================================================================ Single command with arguments ================================================================================ fubar\quux{bar} wibble -------------------------------------------------------------------------------- (document (text) (cs) (group (l) (text) (r)) (text)) ================================================================================ Single command with spaces ================================================================================ fubar\quux {bar} wibble -------------------------------------------------------------------------------- (document (text) (cs) (group (l) (text) (r)) (text)) ================================================================================ Single command with arguments and spaces (TODO: Resolve design choice) ================================================================================ fubar\quux {bar} wibble -------------------------------------------------------------------------------- (document (text) (cs) (group (l) (text) (r)) (text)) ================================================================================ Active char ================================================================================ foo~bar -------------------------------------------------------------------------------- (document (text) (active_char) (text)) ================================================================================ Alignment tab ================================================================================ foo&bar -------------------------------------------------------------------------------- (document (text) (alignment_tab) (text)) ================================================================================ Parameter ================================================================================ foo#1bar foo##1bar -------------------------------------------------------------------------------- (document (text) (parameter_ref) (text) (parameter_ref) (text)) ================================================================================ Subscript ================================================================================ foo_bar -------------------------------------------------------------------------------- (document (text) (text) (text)) ================================================================================ Escaped ================================================================================ foo\^bar -------------------------------------------------------------------------------- (document (text) (cs) (text)) ================================================================================ Text group ================================================================================ foo{bar}wibble -------------------------------------------------------------------------------- (document (text) (group (l) (text) (r)) (text)) ================================================================================ comment ================================================================================ foo % bar -------------------------------------------------------------------------------- (document (text) (comment)) ================================================================================ comment via char ref ================================================================================ foo ^^e bar -------------------------------------------------------------------------------- (document (text) (comment)) ================================================================================ comment eats EOL ================================================================================ \wibble%foo {bar} -------------------------------------------------------------------------------- (document (cs) (comment) (group (l) (text) (r))) ================================================================================ empty comment eats EOL ================================================================================ \wibble% {bar} -------------------------------------------------------------------------------- (document (cs) (comment) (group (l) (text) (r))) ================================================================================ arara comment ================================================================================ foo % arara: pdflatex -------------------------------------------------------------------------------- (document (text) (comment_arara)) ================================================================================ bib comment ================================================================================ foo %!Bib bar=wibble -------------------------------------------------------------------------------- (document (text) (comment_bib)) ================================================================================ magic comment ================================================================================ foo %!TeX bar=wibble -------------------------------------------------------------------------------- (document (text) (comment_tex)) ================================================================================ tag comment ================================================================================ foo %:wibble -------------------------------------------------------------------------------- (document (text) (comment_tag)) ================================================================================ Square brackets do not trigger brack_group ================================================================================ foo[bar]wibble -------------------------------------------------------------------------------- (document (text)) ================================================================================ Allow unmatch square brackets ================================================================================ foo[bar -------------------------------------------------------------------------------- (document (text)) ================================================================================ Escaped space ================================================================================ \ f -------------------------------------------------------------------------------- (document (cs) (text)) ================================================================================ Escaped comment ================================================================================ \%f -------------------------------------------------------------------------------- (document (cs) (text)) ================================================================================ usepacakgel ================================================================================ \usepacakgel -------------------------------------------------------------------------------- (document (cs)) ================================================================================ catcode with decimal number ================================================================================ \catcode70=3 -------------------------------------------------------------------------------- (document (code (cs) (decimal) (equals) (decimal))) ================================================================================ catcode without equals ================================================================================ \catcode70 3 -------------------------------------------------------------------------------- (document (code (cs) (decimal) (decimal))) ================================================================================ catcode with octal number ================================================================================ \catcode'10=3 -------------------------------------------------------------------------------- (document (code (cs) (octal) (equals) (decimal))) ================================================================================ catcode with hexadecimal number ================================================================================ \catcode"A0=3 -------------------------------------------------------------------------------- (document (code (cs) (hexadecimal) (equals) (decimal))) ================================================================================ catcode with char code by letter ================================================================================ \catcode`A=3 -------------------------------------------------------------------------------- (document (code (cs) (charcode (backtick) (text)) (equals) (decimal))) ================================================================================ catcode with char code by escaped character ================================================================================ \catcode`\\=3 -------------------------------------------------------------------------------- (document (code (cs) (charcode (backtick) (cs)) (equals) (decimal))) ================================================================================ catcode with control sequence ================================================================================ \catcode`@=\active -------------------------------------------------------------------------------- (document (code (cs) (charcode (backtick) (text)) (equals) (cs))) ================================================================================ mathcode ================================================================================ \mathcode`\+="202B -------------------------------------------------------------------------------- (document (code (cs) (charcode (backtick) (cs)) (equals) (hexadecimal))) ================================================================================ input ================================================================================ \input{foo} -------------------------------------------------------------------------------- (document (input (cs) (group (l) (text) (r)))) ================================================================================ expandafter ================================================================================ \expandafter\def\expandafter{foo}\bar{wibble} -------------------------------------------------------------------------------- (document (expandafter (cs) (cs) (expandafter (cs) (group (l) (text) (r)) (cs))) (group (l) (text) (r))) ================================================================================ expandafter im math mode ================================================================================ \[\expandafter\def\expandafter{foo}\baz{wibble}\] -------------------------------------------------------------------------------- (document (latex_display_math (cs) (expandafter (cs) (cs) (expandafter (cs) (group (l) (math) (r)) (cs))) (group (l) (math) (r)) (cs))) ================================================================================ expandafter - error recovery with exit ================================================================================ {\expandafter\def} -------------------------------------------------------------------------------- (document (group (l) (expandafter (cs) (cs) (exit)) (r))) ================================================================================ expandafter - error recovery with par ================================================================================ \expandafter\def \foo -------------------------------------------------------------------------------- (document (expandafter (cs) (cs) (par (eol))) (cs)) ================================================================================ expandafter - error recovery with par via control sequence ================================================================================ \expandafter\def\par\foo -------------------------------------------------------------------------------- (document (expandafter (cs) (cs) (par (cs))) (cs)) ================================================================================ string with control sequence parameter ================================================================================ \string\foo -------------------------------------------------------------------------------- (document (string (cs) (cs))) ================================================================================ string with control sequence parameter known to be defined ================================================================================ \string\usepackage -------------------------------------------------------------------------------- (document (string (cs) (cs))) ================================================================================ string with left brace ================================================================================ \string{ -------------------------------------------------------------------------------- (document (string (cs) (text))) ================================================================================ string with active character ================================================================================ \string~ -------------------------------------------------------------------------------- (document (string (cs) (text))) ================================================================================ token char ref via single char ================================================================================ \string^^< \string^^ -------------------------------------------------------------------------------- (document (active_char)) ================================================================================ parameter ref via char ref ================================================================================ ^^c^^23^^^^0023^^^^^^000023^^q -------------------------------------------------------------------------------- (document (parameter_ref)) ================================================================================ alignment tab via char ref ================================================================================ ^^f -------------------------------------------------------------------------------- (document (alignment_tab)) ================================================================================ group via char ref ================================================================================ ^^;foo^^7d -------------------------------------------------------------------------------- (document (group (l) (text) (r))) ================================================================================ TeX inline math via char ref ================================================================================ ^^dquux^^24 -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (math) (math_shift))) ================================================================================ TeX display math via char ref ================================================================================ ^^d^^^^0024quux^^24^^^^^^000024 -------------------------------------------------------------------------------- (document (tex_display_math (display_math_shift) (math) (display_math_shift))) ================================================================================ single superscript does not trigger char ref ================================================================================ $^$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (superscript) (math_shift))) ================================================================================ invalid 5 superscript char ref ================================================================================ ^^^^^ -------------------------------------------------------------------------------- (document (char_ref_invalid)) ================================================================================ invalid 4 digit char ref with non hexadecimal digit ================================================================================ ^^^^^023g -------------------------------------------------------------------------------- (document (char_ref_invalid) (text)) ================================================================================ invalid 4 digit char ref with missing digit ================================================================================ ^^^^^023 -------------------------------------------------------------------------------- (document (char_ref_invalid) (text)) ================================================================================ delimiter group ================================================================================ $foo\left(bar\right)wibble$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (math) (delimiter_group (left (cs) (math)) (math) (right (cs) (math))) (math) (math_shift))) ================================================================================ delimiter group with missing right ================================================================================ $foo\left(bar$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (math) (delimiter_group (left (cs) (math)) (math) (exit)) (math_shift))) ================================================================================ delimiter group with missing right delimiter ================================================================================ $foo\left(bar\right$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (math) (delimiter_group (left (cs) (math)) (math) (right (cs) (exit))) (math_shift))) ================================================================================ delimiter group with missing right inside group ================================================================================ $foo{\left(bar}$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (math) (group (l) (delimiter_group (left (cs) (math)) (math) (exit)) (r)) (math_shift))) ================================================================================ delimiter group with missing right delimiter inside group ================================================================================ $foo{\left(bar\right}$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (math) (group (l) (delimiter_group (left (cs) (math)) (math) (right (cs) (exit))) (r)) (math_shift))) ================================================================================ csname ================================================================================ foo\csname the#1\wibble\endcsname -------------------------------------------------------------------------------- (document (text) (csname_group (csname (cs)) (text) (parameter_ref) (cs) (endcsname (cs)))) ================================================================================ phantom ================================================================================ $\phantom{foo}$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (phantom_smash (cs) (group (l) (math) (r))) (math_shift))) ================================================================================ hphantom ================================================================================ $\hphantom{foo}$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (phantom_smash (cs) (group (l) (math) (r))) (math_shift))) ================================================================================ vphantom ================================================================================ $\vphantom{foo}$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (phantom_smash (cs) (group (l) (math) (r))) (math_shift))) ================================================================================ smash ================================================================================ $\smash{foo}$ -------------------------------------------------------------------------------- (document (tex_inline_math (math_shift) (phantom_smash (cs) (group (l) (math) (r))) (math_shift)))