From b8e710da0bbc3e7d1ff992b1ceff4cb1c67149c8 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 30 Jan 2005 16:48:14 +0000 Subject: why bother? --- src/cmd/delatex.lx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/cmd/delatex.lx') diff --git a/src/cmd/delatex.lx b/src/cmd/delatex.lx index 063aa7dc..04f2480c 100644 --- a/src/cmd/delatex.lx +++ b/src/cmd/delatex.lx @@ -1,9 +1,10 @@ /* Make this with: lex delatex.lex; cc lex.yy.c -ll -o delatex */ L [A-Za-z] -%Start Display Math Normal Tag +%Start Display Math Normal Tag VerbPlus Bracket %% \' {yyleng--; yymore(); /* ignore apostrophes */} {L}+\\- {yyleng-=2; yymore(); /* ignore hyphens */} +[a-zA-Z0-9_]+@[a-zA-Z0-9_.]+ ; /* ignore email addresses */ [a-z]/[^A-Za-z] ; /* ignore single letter "words" */ [A-Z]+ ; /* ignore words all in uppercase */ {L}+('{L}*)*{L} {printf("%s\n",yytext); /* any other letter seq is a word */} @@ -21,8 +22,19 @@ L [A-Za-z] "\\label{" BEGIN Tag; "\\pageref{" BEGIN Tag; "\\ref{" BEGIN Tag; +"\\verb+" BEGIN VerbPlus; +"\\documentclass[" BEGIN Bracket; +"\\documentclass{" BEGIN Tag; +"\\usepackage[" BEGIN Bracket; +"\\usepackage{" BEGIN Tag; +[^\]] ; +"][" ; +"]{" BEGIN Tag; +"]" BEGIN Normal; [^}] ; /* ignore things up to next "}" */ "}" BEGIN Normal; +[^+] ; /* ignore thing up to next "+" */ +"+" BEGIN Normal; [0-9]+ ; /* ignore numbers */ "\\(" BEGIN Math; /* begin latex math mode */ "\\)" BEGIN Normal; /* end latex math mode */ -- cgit v1.2.3