From 60d7a20328d9e3a2b34f3761f2b2a8e82dff9238 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Sun, 3 Aug 2008 20:45:48 +0000 Subject: Updated. --- etc/isar/TokensAcid.thy | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'etc') diff --git a/etc/isar/TokensAcid.thy b/etc/isar/TokensAcid.thy index a6f80cf7..21a0699a 100644 --- a/etc/isar/TokensAcid.thy +++ b/etc/isar/TokensAcid.thy @@ -41,5 +41,53 @@ begin \ \ \ \ \ \ *) +(* Demonstrating variants on token names: different token names, + same appearance. Simulated overloading. + Let's take back \ from the meta-level. +*) + +consts + andprops :: "bool set \ bool" + andpreds :: "('a \ bool) set \ bool" + +notation (xsymbols) + andprops ("\") and (* token , hover to see this *) + andpreds ("\") (* token , hover to see this *) + +term "\ {True, False}" +term "\ {\ x. True, \ y. False}" + +(* Note: of course, copy and paste will produce wrong result + for above: default token without variant is produced! *) + +(* Tokens for layout control: next char *) +(* NB: below here cannot be processed: just in terms to check with + string font for terms *) +term "a\<^sub>b" +term "a\<^sup>b" +term "a\<^isub>b" +term "a\<^isup>b" +term "\<^loc>a" +term "\<^bold>b" +term "\<^italic>b" + +(* Tokens for layout control: regions *) + +term "a\<^bsub>long\<^esub>" +term "b\<^bsup>long\<^esup>" +term "\<^bbold>Bold text \\\\ \ \\<^ebold>" +term "\<^bitalic>Italic text \\\\ \\\<^eitalic>" +term "\<^bscript>Script \\\\\\\<^escript>" +term "\<^bfrakt>Frakt \\\\ \\\<^efrakt>" +term "\<^bserif>Roman \\\\ \\\<^eserif>" + +(* Note: nesting regions not reliable; merging properties flaw? *) +term "\<^bbold>Bold and \<^bitalic>italic\<^eitalic>\<^ebold>" +term "\<^bitalic>Italic and \<^bbold>bold\<^ebold>\<^eitalic>" + +(* Font changes work, though *) +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>" end -- cgit v1.2.3