From 9697d2f0dc4d223df13a339c08cdd619a2821908 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Mon, 19 Sep 2011 11:53:55 +0000 Subject: Clean up a little bit, adding extra syntax to make buffer process fully. --- etc/isar/TokensAcid.thy | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'etc/isar') diff --git a/etc/isar/TokensAcid.thy b/etc/isar/TokensAcid.thy index 69af8d87..9b0e38af 100644 --- a/etc/isar/TokensAcid.thy +++ b/etc/isar/TokensAcid.thy @@ -89,12 +89,13 @@ begin consts longsub :: "['a,'a]\'a" ("_\<^bsub>_\<^esub>") consts longsup :: "['a,'a]\'a" ("_\<^bsup>_\<^esup>") -consts bold :: "['a,'a]\'a" ("\<^bbold>_ _\<^ebold>") -consts italic :: "['a,'a,'a,'a]\'a" ("\<^bitalic>_ _ _ _\<^eitalic>") -consts sans :: "['a,'a]\'a" ("\<^bsans>_ _\<^esans>") -consts script :: "['a,'a]\'a" ("\<^bscript>_ _\<^escript>") -consts frakt :: "['a,'a]\'a" ("\<^bfrakt>_ _\<^efrakt>") -consts serif :: "['a,'a]\'a" ("\<^bserif>_ _\<^eserif>") + +consts bold :: "'a\'a" ("\<^bbold>_\<^ebold>") +consts italic :: "'a\'a" ("\<^bitalic>_\<^eitalic>") +consts sans :: "'a\'a" ("\<^bsans>_\<^esans>") +consts script :: "'a\'a" ("\<^bscript>_\<^escript>") +consts frakt :: "'a\'a" ("\<^bfrakt>_\<^efrakt>") +consts serif :: "'a\'a" ("\<^bserif>_\<^eserif>") term "a\<^bsub>longsub\<^esub>" term "b\<^bsup>longsuper\<^esup>" @@ -102,13 +103,11 @@ term "\<^bbold>Bold text\<^ebold>" term "\<^bitalic>Italic text \ \Sans \\<^esans>" term "\<^bscript>Script text\<^escript>" term "\<^bfrakt>Frakt stuff\<^efrakt>" term "\<^bserif>Roman stuff\<^eserif>" -lemma "\ \<^bbold>Bold text\<^ebold>; Q \ \ Q" +lemma "\ \<^bbold>(Bold text)\<^ebold>; Q \ \ Q" by auto (* Tokens controlling layout and fonts: next character. - These are tokens that affect the following character/identifier only. - Similar to previous case. See Tokens -> Format Char -> ... @@ -164,7 +163,7 @@ term "\ {\ x. True, \ y. False}" (* Note: of course, copy and paste using Unicode to another application (Tokens \ Copy As Unicode) and then re-reading in - Isabelle using another interface will probably produce wrong + Isabelle using another interface will probably produce the wrong result. But copy-pasting within Proof General Emacs is fine since the underlying token text is copied, not the presentation. What happens is that the text properties are "sticky" and @@ -173,21 +172,23 @@ term "\ {\ x. True, \ y. False}" *) -(* NB: below here cannot be processed: just in terms to check with - string font for terms. *) - - -(* Spanning identifier supers/subs: to be added to Isabelle lexer/latex *) +(* More esoteric non-standard stuff: unlikely in other interfaces *) -term "a\<^bisup>bcd\<^eisup>" -term "a\<^bisub>bcd\<^eisub>" - -(* More esoteric stuff *) +consts + shout :: "'a \ 'a" + whisper :: "'a \ 'a" + underline :: "'a \ 'a" + overline :: "'a \ 'a" +notation (xsymbols) + shout ("\<^bbig>_\<^ebig>") and + whisper ("\<^bsmall>_\<^esmall>") and + underline ("\<^bunderline>_\<^eunderline>") and + overline ("\<^boverline>_\<^eoverline>") term "\<^bbig>large text \ \ \\<^ebig>" -term "\<^bsmall>small text \ \ \ \ \ \<^esmall>" +term "\<^bsmall>smaller text ((\ \ \) \ \) \<^esmall>" term "\<^bunderline>underlined\<^eunderline>" @@ -195,7 +196,7 @@ term "\<^boverline>overlined\<^eoverline>" (* Bold and italic combinations for regions *) -term "\<^bbold>Bold and \<^bitalic>italic\<^eitalic>\<^ebold>" +term "\<^bbold>Bold and (\<^bitalic>italic\<^eitalic>)\<^ebold>" term "\<^bitalic>Italic and \<^bbold>bold\<^ebold>\<^eitalic>" (* Font and weight/shape changes for regions *) @@ -203,4 +204,9 @@ term "\<^bbold>Bold and \<^bscript>script\<^escript>\<^ebold>" term "\<^bserif>Roman and \<^bitalic>italic\<^eitalic> and \<^bbold>bold\<^ebold> \<^eserif>" term "\<^bfrakt>Frakt and \<^bitalic>italic\<^eitalic> and \<^bbold>bold\<^ebold> \<^efrakt>" +(* Spanning identifier supers/subs: not included in standard Isabelle lexer/latex *) + +(* term "a\<^bisup>bcd\<^eisup>" + term "a\<^bisub>bcd\<^eisub>" *) + end -- cgit v1.2.3