author | nipkow |
Wed, 10 Jan 2018 15:25:09 +0100 | |
changeset 67399 | eab6ce8368fa |
parent 67386 | 998e01d6f8fd |
child 67406 | 23307fd33906 |
permissions | -rw-r--r-- |
47269 | 1 |
(* Title: HOL/Library/LaTeXsugar.thy |
55116 | 2 |
Author: Gerwin Klein, Tobias Nipkow, Norbert Schirmer |
47269 | 3 |
Copyright 2005 NICTA and TUM |
4 |
*) |
|
5 |
||
6 |
(*<*) |
|
7 |
theory LaTeXsugar |
|
8 |
imports Main |
|
9 |
begin |
|
10 |
||
11 |
(* DUMMY *) |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
12 |
consts DUMMY :: 'a ("\<^latex>\<open>\\_\<close>") |
47269 | 13 |
|
14 |
(* THEOREMS *) |
|
15 |
notation (Rule output) |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
16 |
Pure.imp ("\<^latex>\<open>\\mbox{}\\inferrule{\\mbox{\<close>_\<^latex>\<open>}}\<close>\<^latex>\<open>{\\mbox{\<close>_\<^latex>\<open>}}\<close>") |
47269 | 17 |
|
18 |
syntax (Rule output) |
|
19 |
"_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop" |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
20 |
("\<^latex>\<open>\\mbox{}\\inferrule{\<close>_\<^latex>\<open>}\<close>\<^latex>\<open>{\\mbox{\<close>_\<^latex>\<open>}}\<close>") |
47269 | 21 |
|
22 |
"_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
23 |
("\<^latex>\<open>\\mbox{\<close>_\<^latex>\<open>}\\\\\<close>/ _") |
47269 | 24 |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
25 |
"_asm" :: "prop \<Rightarrow> asms" ("\<^latex>\<open>\\mbox{\<close>_\<^latex>\<open>}\<close>") |
47269 | 26 |
|
27 |
notation (Axiom output) |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
28 |
"Trueprop" ("\<^latex>\<open>\\mbox{}\\inferrule{\\mbox{}}{\\mbox{\<close>_\<^latex>\<open>}}\<close>") |
47269 | 29 |
|
30 |
notation (IfThen output) |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
31 |
Pure.imp ("\<^latex>\<open>{\\normalsize{}\<close>If\<^latex>\<open>\\,}\<close> _/ \<^latex>\<open>{\\normalsize \\,\<close>then\<^latex>\<open>\\,}\<close>/ _.") |
47269 | 32 |
syntax (IfThen output) |
33 |
"_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop" |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
34 |
("\<^latex>\<open>{\\normalsize{}\<close>If\<^latex>\<open>\\,}\<close> _ /\<^latex>\<open>{\\normalsize \\,\<close>then\<^latex>\<open>\\,}\<close>/ _.") |
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
35 |
"_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("\<^latex>\<open>\\mbox{\<close>_\<^latex>\<open>}\<close> /\<^latex>\<open>{\\normalsize \\,\<close>and\<^latex>\<open>\\,}\<close>/ _") |
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
36 |
"_asm" :: "prop \<Rightarrow> asms" ("\<^latex>\<open>\\mbox{\<close>_\<^latex>\<open>}\<close>") |
47269 | 37 |
|
38 |
notation (IfThenNoBox output) |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
39 |
Pure.imp ("\<^latex>\<open>{\\normalsize{}\<close>If\<^latex>\<open>\\,}\<close> _/ \<^latex>\<open>{\\normalsize \\,\<close>then\<^latex>\<open>\\,}\<close>/ _.") |
47269 | 40 |
syntax (IfThenNoBox output) |
41 |
"_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop" |
|
63935
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
42 |
("\<^latex>\<open>{\\normalsize{}\<close>If\<^latex>\<open>\\,}\<close> _ /\<^latex>\<open>{\\normalsize \\,\<close>then\<^latex>\<open>\\,}\<close>/ _.") |
aa1fe1103ab8
raw control symbols are superseded by Latex.embed_raw;
wenzelm
parents:
63120
diff
changeset
|
43 |
"_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("_ /\<^latex>\<open>{\\normalsize \\,\<close>and\<^latex>\<open>\\,}\<close>/ _") |
47269 | 44 |
"_asm" :: "prop \<Rightarrow> asms" ("_") |
45 |
||
49629 | 46 |
setup{* |
47 |
let |
|
48 |
fun pretty ctxt c = |
|
56002 | 49 |
let val tc = Proof_Context.read_const {proper = true, strict = false} ctxt c |
49629 | 50 |
in Pretty.block [Thy_Output.pretty_term ctxt tc, Pretty.str " ::", |
51 |
Pretty.brk 1, Syntax.pretty_typ ctxt (fastype_of tc)] |
|
52 |
end |
|
53 |
in |
|
67386 | 54 |
Document_Antiquotation.setup @{binding "const_typ"} |
63120
629a4c5e953e
embedded content may be delimited via cartouches;
wenzelm
parents:
56451
diff
changeset
|
55 |
(Scan.lift Args.embedded_inner_syntax) |
49629 | 56 |
(fn {source = src, context = ctxt, ...} => fn arg => |
57 |
Thy_Output.output ctxt |
|
58 |
(Thy_Output.maybe_pretty_source pretty ctxt src [arg])) |
|
59 |
end; |
|
60 |
*} |
|
61 |
||
47269 | 62 |
end |
67399 | 63 |
(*>*) |