equal
deleted
inserted
replaced
5 Simple LaTeX presentation primitives (based on outer lexical syntax). |
5 Simple LaTeX presentation primitives (based on outer lexical syntax). |
6 *) |
6 *) |
7 |
7 |
8 signature LATEX = |
8 signature LATEX = |
9 sig |
9 sig |
10 datatype token = Basic of OuterLex.token | Markup of string * string |
10 datatype token = Basic of OuterLex.token | Markup of string * string | Verbatim of string |
11 val token_source: token list -> string |
11 val token_source: token list -> string |
12 val theory_entry: string -> string |
12 val theory_entry: string -> string |
13 end; |
13 end; |
14 |
14 |
15 structure Latex: LATEX = |
15 structure Latex: LATEX = |
49 |
49 |
50 (* token output *) |
50 (* token output *) |
51 |
51 |
52 structure T = OuterLex; |
52 structure T = OuterLex; |
53 |
53 |
54 datatype token = Basic of T.token | Markup of string * string; |
54 datatype token = Basic of T.token | Markup of string * string | Verbatim of string; |
55 |
55 |
56 |
56 |
57 val invisible_token = T.keyword_with (equal ";") orf T.is_kind T.Comment; |
57 val invisible_token = T.keyword_with (equal ";") orf T.is_kind T.Comment; |
58 |
58 |
59 fun strip_blanks s = |
59 fun strip_blanks s = |
67 else if T.is_kind T.Keyword tok then "\\isakeyword{" ^ output_sym' s ^ "}" |
67 else if T.is_kind T.Keyword tok then "\\isakeyword{" ^ output_sym' s ^ "}" |
68 else if T.is_kind T.String tok then output_sym (quote s) |
68 else if T.is_kind T.String tok then output_sym (quote s) |
69 else if T.is_kind T.Verbatim tok then output_sym (enclose "{*" "*}" s) |
69 else if T.is_kind T.Verbatim tok then output_sym (enclose "{*" "*}" s) |
70 else output_sym s |
70 else output_sym s |
71 end |
71 end |
72 | output_tok (Markup (cmd, arg)) = "\n\\isamarkup" ^ cmd ^ "{" ^ strip_blanks arg ^ "}\n"; |
72 | output_tok (Markup (cmd, arg)) = "\n\\isamarkup" ^ cmd ^ "{" ^ strip_blanks arg ^ "}\n" |
|
73 | output_tok (Verbatim txt) = "\n" ^ txt ^ "\n"; |
73 |
74 |
74 |
75 |
75 val output_tokens = implode o map output_tok; |
76 val output_tokens = implode o map output_tok; |
76 |
77 |
77 |
78 |