--- a/src/Pure/Thy/html.ML Thu Jun 02 18:29:55 2005 +0200
+++ b/src/Pure/Thy/html.ML Thu Jun 02 18:29:57 2005 +0200
@@ -57,158 +57,161 @@
local
val escape = fn "<" => "<" | ">" => ">" | "&" => "&" | c => c;
- val output_sym =
- fn "\\<spacespace>" => (2.0, " ")
- | "\\<exclamdown>" => (1.0, "¡")
- | "\\<cent>" => (1.0, "¢")
- | "\\<pounds>" => (1.0, "£")
- | "\\<currency>" => (1.0, "¤")
- | "\\<yen>" => (1.0, "¥")
- | "\\<bar>" => (1.0, "¦")
- | "\\<section>" => (1.0, "§")
- | "\\<dieresis>" => (1.0, "¨")
- | "\\<copyright>" => (1.0, "©")
- | "\\<ordfeminine>" => (1.0, "ª")
- | "\\<guillemotleft>" => (1.0, "«")
- | "\\<not>" => (1.0, "¬")
- | "\\<hyphen>" => (1.0, "­")
- | "\\<registered>" => (1.0, "®")
- | "\\<inverse>" => (1.0, "¯")
- | "\\<degree>" => (1.0, "°")
- | "\\<plusminus>" => (1.0, "±")
- | "\\<twosuperior>" => (1.0, "²")
- | "\\<threesuperior>" => (1.0, "³")
- | "\\<acute>" => (1.0, "´")
- | "\\<paragraph>" => (1.0, "¶")
- | "\\<cdot>" => (1.0, "·")
- | "\\<cedilla>" => (1.0, "¸")
- | "\\<onesuperior>" => (1.0, "¹")
- | "\\<ordmasculine>" => (1.0, "º")
- | "\\<guillemotright>" => (1.0, "»")
- | "\\<onequarter>" => (1.0, "¼")
- | "\\<onehalf>" => (1.0, "½")
- | "\\<threequarters>" => (1.0, "¾")
- | "\\<questiondown>" => (1.0, "¿")
- | "\\<times>" => (1.0, "×")
- | "\\<div>" => (1.0, "÷")
- | "\\<circ>" => (1.0, "o")
- | "\\<Alpha>" => (1.0, "Α")
- | "\\<Beta>" => (1.0, "Β")
- | "\\<Gamma>" => (1.0, "Γ")
- | "\\<Delta>" => (1.0, "Δ")
- | "\\<Epsilon>" => (1.0, "Ε")
- | "\\<Zeta>" => (1.0, "Ζ")
- | "\\<Eta>" => (1.0, "Η")
- | "\\<Theta>" => (1.0, "Θ")
- | "\\<Iota>" => (1.0, "Ι")
- | "\\<Kappa>" => (1.0, "Κ")
- | "\\<Lambda>" => (1.0, "Λ")
- | "\\<Mu>" => (1.0, "Μ")
- | "\\<Nu>" => (1.0, "Ν")
- | "\\<Xi>" => (1.0, "Ξ")
- | "\\<Omicron>" => (1.0, "Ο")
- | "\\<Pi>" => (1.0, "Π")
- | "\\<Rho>" => (1.0, "Ρ")
- | "\\<Sigma>" => (1.0, "Σ")
- | "\\<Tau>" => (1.0, "Τ")
- | "\\<Upsilon>" => (1.0, "Υ")
- | "\\<Phi>" => (1.0, "Φ")
- | "\\<Chi>" => (1.0, "Χ")
- | "\\<Psi>" => (1.0, "Ψ")
- | "\\<Omega>" => (1.0, "Ω")
- | "\\<alpha>" => (1.0, "α")
- | "\\<beta>" => (1.0, "β")
- | "\\<gamma>" => (1.0, "γ")
- | "\\<delta>" => (1.0, "δ")
- | "\\<epsilon>" => (1.0, "ε")
- | "\\<zeta>" => (1.0, "ζ")
- | "\\<eta>" => (1.0, "η")
- | "\\<theta>" => (1.0, "ϑ")
- | "\\<iota>" => (1.0, "ι")
- | "\\<kappa>" => (1.0, "κ")
- | "\\<lambda>" => (1.0, "λ")
- | "\\<mu>" => (1.0, "μ")
- | "\\<nu>" => (1.0, "ν")
- | "\\<xi>" => (1.0, "ξ")
- | "\\<omicron>" => (1.0, "ο")
- | "\\<pi>" => (1.0, "π")
- | "\\<rho>" => (1.0, "ρ")
- | "\\<sigma>" => (1.0, "σ")
- | "\\<tau>" => (1.0, "τ")
- | "\\<upsilon>" => (1.0, "υ")
- | "\\<phi>" => (1.0, "φ")
- | "\\<chi>" => (1.0, "χ")
- | "\\<psi>" => (1.0, "ψ")
- | "\\<omega>" => (1.0, "ω")
- | "\\<buller>" => (1.0, "•")
- | "\\<dots>" => (1.0, "…")
- | "\\<Re>" => (1.0, "ℜ")
- | "\\<Im>" => (1.0, "ℑ")
- | "\\<wp>" => (1.0, "℘")
- | "\\<forall>" => (1.0, "∀")
- | "\\<partial>" => (1.0, "∂")
- | "\\<exists>" => (1.0, "∃")
- | "\\<emptyset>" => (1.0, "∅")
- | "\\<nabla>" => (1.0, "∇")
- | "\\<in>" => (1.0, "∈")
- | "\\<notin>" => (1.0, "∉")
- | "\\<Prod>" => (1.0, "∏")
- | "\\<Sum>" => (1.0, "∑")
- | "\\<star>" => (1.0, "∗")
- | "\\<propto>" => (1.0, "∝")
- | "\\<infinity>" => (1.0, "∞")
- | "\\<angle>" => (1.0, "∠")
- | "\\<and>" => (1.0, "∧")
- | "\\<or>" => (1.0, "∨")
- | "\\<inter>" => (1.0, "∩")
- | "\\<union>" => (1.0, "∪")
- | "\\<sim>" => (1.0, "∼")
- | "\\<cong>" => (1.0, "≅")
- | "\\<approx>" => (1.0, "≈")
- | "\\<noteq>" => (1.0, "≠")
- | "\\<equiv>" => (1.0, "≡")
- | "\\<le>" => (1.0, "≤")
- | "\\<ge>" => (1.0, "≥")
- | "\\<subset>" => (1.0, "⊂")
- | "\\<supset>" => (1.0, "⊃")
- | "\\<subseteq>" => (1.0, "⊆")
- | "\\<supseteq>" => (1.0, "⊇")
- | "\\<oplus>" => (1.0, "⊕")
- | "\\<otimes>" => (1.0, "⊗")
- | "\\<bottom>" => (1.0, "⊥")
- | "\\<lceil>" => (1.0, "⌈")
- | "\\<rceil>" => (1.0, "⌉")
- | "\\<lfloor>" => (1.0, "⌊")
- | "\\<rfloor>" => (1.0, "⌋")
- | "\\<langle>" => (1.0, "⟨")
- | "\\<rangle>" => (1.0, "⟩")
- | "\\<lozenge>" => (1.0, "◊")
- | "\\<spadesuit>" => (1.0, "♠")
- | "\\<clubsuit>" => (1.0, "♣")
- | "\\<heartsuit>" => (1.0, "♥")
- | "\\<diamondsuit>" => (1.0, "♦")
- | "\\<lbrakk>" => (2.0, "[|")
- | "\\<rbrakk>" => (2.0, "|]")
- | "\\<Longrightarrow>" => (3.0, "==>")
- | "\\<Rightarrow>" => (2.0, "=>")
- | "\\<And>" => (2.0, "!!")
- | "\\<Colon>" => (2.0, "::")
- | "\\<lparr>" => (2.0, "(|")
- | "\\<rparr>" => (2.0, "|)")
- | "\\<longleftrightarrow>" => (3.0, "<->")
- | "\\<longrightarrow>" => (3.0, "-->")
- | "\\<rightarrow>" => (2.0, "->")
- | "\\<^bsub>" => (0.0, "<sub>")
- | "\\<^esub>" => (0.0, "</sub>")
- | "\\<^bsup>" => (0.0, "<sup>")
- | "\\<^esup>" => (0.0, "</sup>")
- | "\\<^sub>" => (0.0, "\\<^sub>")
- | "\\<^sup>" => (0.0, "\\<^sup>")
- | "\\<^isub>" => (0.0, "\\<^isub>")
- | "\\<^isup>" => (0.0, "\\<^isup>")
- | s =>
- if Symbol.is_raw s then (1.0, Symbol.decode_raw s)
- else (real (size s), implode (map escape (explode s)));
+ val html_syms = Symtab.make
+ [("\\<spacespace>", (2.0, " ")),
+ ("\\<exclamdown>", (1.0, "¡")),
+ ("\\<cent>", (1.0, "¢")),
+ ("\\<pounds>", (1.0, "£")),
+ ("\\<currency>", (1.0, "¤")),
+ ("\\<yen>", (1.0, "¥")),
+ ("\\<bar>", (1.0, "¦")),
+ ("\\<section>", (1.0, "§")),
+ ("\\<dieresis>", (1.0, "¨")),
+ ("\\<copyright>", (1.0, "©")),
+ ("\\<ordfeminine>", (1.0, "ª")),
+ ("\\<guillemotleft>", (1.0, "«")),
+ ("\\<not>", (1.0, "¬")),
+ ("\\<hyphen>", (1.0, "­")),
+ ("\\<registered>", (1.0, "®")),
+ ("\\<inverse>", (1.0, "¯")),
+ ("\\<degree>", (1.0, "°")),
+ ("\\<plusminus>", (1.0, "±")),
+ ("\\<twosuperior>", (1.0, "²")),
+ ("\\<threesuperior>", (1.0, "³")),
+ ("\\<acute>", (1.0, "´")),
+ ("\\<paragraph>", (1.0, "¶")),
+ ("\\<cdot>", (1.0, "·")),
+ ("\\<cedilla>", (1.0, "¸")),
+ ("\\<onesuperior>", (1.0, "¹")),
+ ("\\<ordmasculine>", (1.0, "º")),
+ ("\\<guillemotright>", (1.0, "»")),
+ ("\\<onequarter>", (1.0, "¼")),
+ ("\\<onehalf>", (1.0, "½")),
+ ("\\<threequarters>", (1.0, "¾")),
+ ("\\<questiondown>", (1.0, "¿")),
+ ("\\<times>", (1.0, "×")),
+ ("\\<div>", (1.0, "÷")),
+ ("\\<circ>", (1.0, "o")),
+ ("\\<Alpha>", (1.0, "Α")),
+ ("\\<Beta>", (1.0, "Β")),
+ ("\\<Gamma>", (1.0, "Γ")),
+ ("\\<Delta>", (1.0, "Δ")),
+ ("\\<Epsilon>", (1.0, "Ε")),
+ ("\\<Zeta>", (1.0, "Ζ")),
+ ("\\<Eta>", (1.0, "Η")),
+ ("\\<Theta>", (1.0, "Θ")),
+ ("\\<Iota>", (1.0, "Ι")),
+ ("\\<Kappa>", (1.0, "Κ")),
+ ("\\<Lambda>", (1.0, "Λ")),
+ ("\\<Mu>", (1.0, "Μ")),
+ ("\\<Nu>", (1.0, "Ν")),
+ ("\\<Xi>", (1.0, "Ξ")),
+ ("\\<Omicron>", (1.0, "Ο")),
+ ("\\<Pi>", (1.0, "Π")),
+ ("\\<Rho>", (1.0, "Ρ")),
+ ("\\<Sigma>", (1.0, "Σ")),
+ ("\\<Tau>", (1.0, "Τ")),
+ ("\\<Upsilon>", (1.0, "Υ")),
+ ("\\<Phi>", (1.0, "Φ")),
+ ("\\<Chi>", (1.0, "Χ")),
+ ("\\<Psi>", (1.0, "Ψ")),
+ ("\\<Omega>", (1.0, "Ω")),
+ ("\\<alpha>", (1.0, "α")),
+ ("\\<beta>", (1.0, "β")),
+ ("\\<gamma>", (1.0, "γ")),
+ ("\\<delta>", (1.0, "δ")),
+ ("\\<epsilon>", (1.0, "ε")),
+ ("\\<zeta>", (1.0, "ζ")),
+ ("\\<eta>", (1.0, "η")),
+ ("\\<theta>", (1.0, "ϑ")),
+ ("\\<iota>", (1.0, "ι")),
+ ("\\<kappa>", (1.0, "κ")),
+ ("\\<lambda>", (1.0, "λ")),
+ ("\\<mu>", (1.0, "μ")),
+ ("\\<nu>", (1.0, "ν")),
+ ("\\<xi>", (1.0, "ξ")),
+ ("\\<omicron>", (1.0, "ο")),
+ ("\\<pi>", (1.0, "π")),
+ ("\\<rho>", (1.0, "ρ")),
+ ("\\<sigma>", (1.0, "σ")),
+ ("\\<tau>", (1.0, "τ")),
+ ("\\<upsilon>", (1.0, "υ")),
+ ("\\<phi>", (1.0, "φ")),
+ ("\\<chi>", (1.0, "χ")),
+ ("\\<psi>", (1.0, "ψ")),
+ ("\\<omega>", (1.0, "ω")),
+ ("\\<bullet>", (1.0, "•")),
+ ("\\<dots>", (1.0, "…")),
+ ("\\<Re>", (1.0, "ℜ")),
+ ("\\<Im>", (1.0, "ℑ")),
+ ("\\<wp>", (1.0, "℘")),
+ ("\\<forall>", (1.0, "∀")),
+ ("\\<partial>", (1.0, "∂")),
+ ("\\<exists>", (1.0, "∃")),
+ ("\\<emptyset>", (1.0, "∅")),
+ ("\\<nabla>", (1.0, "∇")),
+ ("\\<in>", (1.0, "∈")),
+ ("\\<notin>", (1.0, "∉")),
+ ("\\<Prod>", (1.0, "∏")),
+ ("\\<Sum>", (1.0, "∑")),
+ ("\\<star>", (1.0, "∗")),
+ ("\\<propto>", (1.0, "∝")),
+ ("\\<infinity>", (1.0, "∞")),
+ ("\\<angle>", (1.0, "∠")),
+ ("\\<and>", (1.0, "∧")),
+ ("\\<or>", (1.0, "∨")),
+ ("\\<inter>", (1.0, "∩")),
+ ("\\<union>", (1.0, "∪")),
+ ("\\<sim>", (1.0, "∼")),
+ ("\\<cong>", (1.0, "≅")),
+ ("\\<approx>", (1.0, "≈")),
+ ("\\<noteq>", (1.0, "≠")),
+ ("\\<equiv>", (1.0, "≡")),
+ ("\\<le>", (1.0, "≤")),
+ ("\\<ge>", (1.0, "≥")),
+ ("\\<subset>", (1.0, "⊂")),
+ ("\\<supset>", (1.0, "⊃")),
+ ("\\<subseteq>", (1.0, "⊆")),
+ ("\\<supseteq>", (1.0, "⊇")),
+ ("\\<oplus>", (1.0, "⊕")),
+ ("\\<otimes>", (1.0, "⊗")),
+ ("\\<bottom>", (1.0, "⊥")),
+ ("\\<lceil>", (1.0, "⌈")),
+ ("\\<rceil>", (1.0, "⌉")),
+ ("\\<lfloor>", (1.0, "⌊")),
+ ("\\<rfloor>", (1.0, "⌋")),
+ ("\\<langle>", (1.0, "⟨")),
+ ("\\<rangle>", (1.0, "⟩")),
+ ("\\<lozenge>", (1.0, "◊")),
+ ("\\<spadesuit>", (1.0, "♠")),
+ ("\\<clubsuit>", (1.0, "♣")),
+ ("\\<heartsuit>", (1.0, "♥")),
+ ("\\<diamondsuit>", (1.0, "♦")),
+ ("\\<lbrakk>", (2.0, "[|")),
+ ("\\<rbrakk>", (2.0, "|]")),
+ ("\\<Longrightarrow>", (3.0, "==>")),
+ ("\\<Rightarrow>", (2.0, "=>")),
+ ("\\<And>", (2.0, "!!")),
+ ("\\<Colon>", (2.0, "::")),
+ ("\\<lparr>", (2.0, "(|")),
+ ("\\<rparr>", (2.0, "|)),")),
+ ("\\<longleftrightarrow>", (3.0, "<->")),
+ ("\\<longrightarrow>", (3.0, "-->")),
+ ("\\<rightarrow>", (2.0, "->")),
+ ("\\<^bsub>", (0.0, "<sub>")),
+ ("\\<^esub>", (0.0, "</sub>")),
+ ("\\<^bsup>", (0.0, "<sup>")),
+ ("\\<^esup>", (0.0, "</sup>")),
+ ("\\<^sub>", (0.0, "\\<^sub>")),
+ ("\\<^sup>", (0.0, "\\<^sup>")),
+ ("\\<^isub>", (0.0, "\\<^isub>")),
+ ("\\<^isup>", (0.0, "\\<^isup>"))];
+
+ fun output_sym s =
+ if Symbol.is_raw s then (1.0, Symbol.decode_raw s)
+ else
+ (case Symtab.lookup (html_syms, s) of SOME x => x
+ | NONE => (real (size s), implode (map escape (explode s))));
fun add_sym (width, (w: real, s)) = (width + w, s);
@@ -241,8 +244,8 @@
(* token translations *)
-fun style stl =
- apfst (enclose ("<span class=" ^ Library.quote stl ^ ">") "</span>") o output_width;
+fun style s =
+ apfst (enclose ("<span class=" ^ Library.quote s ^ ">") "</span>") o output_width;
val html_trans =
[("class", style "tclass"),