diff -r 760e21900b01 -r 28e788ca2c5d src/Doc/Isar_Ref/Document_Preparation.thy --- a/src/Doc/Isar_Ref/Document_Preparation.thy Thu Oct 22 21:16:27 2015 +0200 +++ b/src/Doc/Isar_Ref/Document_Preparation.thy Thu Oct 22 21:16:49 2015 +0200 @@ -53,13 +53,11 @@ \<^descr> @{command chapter}, @{command section}, @{command subsection} etc.\ mark section headings within the theory source. This works in any context, even before the initial @{command theory} command. The corresponding {\LaTeX} - macros are @{verbatim \\isamarkupchapter\}, @{verbatim - \\isamarkupsection\}, @{verbatim \\isamarkupsubsection\} etc.\ + macros are \<^verbatim>\\isamarkupchapter\, \<^verbatim>\\isamarkupsection\, \<^verbatim>\\isamarkupsubsection\ etc.\ \<^descr> @{command text} and @{command txt} specify paragraphs of plain text. - This corresponds to a {\LaTeX} environment @{verbatim - \\begin{isamarkuptext}\} \\\ @{verbatim \\end{isamarkuptext}\} - etc. + This corresponds to a {\LaTeX} environment \<^verbatim>\\begin{isamarkuptext}\ \\\ + \<^verbatim>\\end{isamarkuptext}\ etc. \<^descr> @{command text_raw} is similar to @{command text}, but without any surrounding markup environment. This allows to inject arbitrary @@ -120,7 +118,7 @@ in the resulting document, but may again refer to formal entities via \<^emph>\document antiquotations\. - For example, embedding @{verbatim \@{term [show_types] "f x = a + x"}\} + For example, embedding \<^verbatim>\@{term [show_types] "f x = a + x"}\ within a text block makes \isa{{\isacharparenleft}f{\isasymColon}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a{\isacharparenright}\ {\isacharparenleft}x{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}a{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isacharplus}\ x} appear in the final {\LaTeX} document. @@ -131,15 +129,14 @@ antiquotations are checked within the current theory or proof context. - \<^medskip> Antiquotations are in general written as @{verbatim "@{"}\name\~@{verbatim "["}\options\@{verbatim "]"}~\arguments\@{verbatim "}"}. The short form @{verbatim \\\}@{verbatim - "<^"}\name\@{verbatim ">"}\\argument_content\\ (without - surrounding @{verbatim "@{"}\\\@{verbatim "}"}) works for a single + \<^medskip> Antiquotations are in general written as \<^verbatim>\@{\\name\~\<^verbatim>\[\\options\\<^verbatim>\]\~\arguments\\<^verbatim>\}\. + The short form \<^verbatim>\\\\<^verbatim>\<^\\name\\<^verbatim>\>\\\argument_content\\ (without + surrounding \<^verbatim>\@{\\\\\<^verbatim>\}\) works for a single argument that is a cartouche. Omitting the control symbol is also possible: a cartouche without special - decoration is equivalent to @{verbatim \\\}@{verbatim - "<^cartouche>"}\\argument_content\\, which is equivalent to - @{verbatim "@{cartouche"}~\\argument_content\\@{verbatim "}"}. The + decoration is equivalent to \<^verbatim>\\\\<^verbatim>\<^cartouche>\\\argument_content\\, which + is equivalent to \<^verbatim>\@{cartouche\~\\argument_content\\\<^verbatim>\}\. The special name @{antiquotation_def cartouche} is defined in the context: Isabelle/Pure introduces that as an alias to @{antiquotation_ref text} (see below). Consequently, \\foo_bar + baz \ bazar\\ prints literal @@ -161,8 +158,7 @@ \endgroup Note that the syntax of antiquotations may \<^emph>\not\ include source - comments @{verbatim "(*"}~\\\~@{verbatim "*)"} nor verbatim - text @{verbatim "{*"}~\\\~@{verbatim "*}"}. + comments \<^verbatim>\(*\~\\\~\<^verbatim>\*)\ nor verbatim text \<^verbatim>\{*\~\\\~\<^verbatim>\*}\. %% FIXME less monolithic presentation, move to individual sections!? @{rail \ @@ -280,10 +276,10 @@ and functor respectively. The source is printed verbatim. \<^descr> \@{emph s}\ prints document source recursively, with {\LaTeX} - markup @{verbatim \\emph{\}\\\@{verbatim \}\}. + markup \<^verbatim>\\emph{\\\\\<^verbatim>\}\. \<^descr> \@{bold s}\ prints document source recursively, with {\LaTeX} - markup @{verbatim \\textbf{\}\\\@{verbatim \}\}. + markup \<^verbatim>\\textbf{\\\\\<^verbatim>\}\. \<^descr> \@{verbatim s}\ prints uninterpreted source text literally as ASCII characters, using some type-writer font style. @@ -298,19 +294,18 @@ \<^descr> \@{url name}\ produces markup for the given URL, which results in an active hyperlink within the text. - \<^descr> \@{cite name}\ produces a citation @{verbatim - \\cite{name}\} in {\LaTeX}, where the name refers to some Bib{\TeX} - database entry. + \<^descr> \@{cite name}\ produces a citation \<^verbatim>\\cite{name}\ in {\LaTeX}, + where the name refers to some Bib{\TeX} database entry. - The variant \@{cite \opt\ name}\ produces @{verbatim - \\cite[opt]{name}\} with some free-form optional argument. Multiple names + The variant \@{cite \opt\ name}\ produces \<^verbatim>\\cite[opt]{name}\ with + some free-form optional argument. Multiple names are output with commas, e.g. \@{cite foo \ bar}\ becomes - @{verbatim \\cite{foo,bar}\}. + \<^verbatim>\\cite{foo,bar}\. The {\LaTeX} macro name is determined by the antiquotation option @{antiquotation_option_def cite_macro}, or the configuration option @{attribute cite_macro} in the context. For example, \@{cite - [cite_macro = nocite] foobar}\ produces @{verbatim \\nocite{foobar}\}. + [cite_macro = nocite] foobar}\ produces \<^verbatim>\\nocite{foobar}\. \<^descr> @{command "print_antiquotations"} prints all document antiquotations that are defined in the current context; the ``\!\'' option @@ -422,7 +417,7 @@ For Boolean flags, ``\name = true\'' may be abbreviated as ``\name\''. All of the above flags are disabled by default, unless changed specifically for a logic session in the corresponding - @{verbatim "ROOT"} file. + \<^verbatim>\ROOT\ file. \ @@ -494,8 +489,7 @@ The @{antiquotation rail} antiquotation allows to include syntax diagrams into Isabelle documents. {\LaTeX} requires the style file @{file "~~/lib/texinputs/railsetup.sty"}, which can be used via - @{verbatim \\usepackage{railsetup}\} in @{verbatim "root.tex"}, for - example. + \<^verbatim>\\usepackage{railsetup}\ in \<^verbatim>\root.tex\, for example. The rail specification language is quoted here as Isabelle @{syntax string} or text @{syntax "cartouche"}; it has its own grammar given @@ -528,62 +522,59 @@ recursion. The meaning and visual appearance of these rail language elements is illustrated by the following representative examples. - \<^item> Empty @{verbatim "()"} + \<^item> Empty \<^verbatim>\()\ @{rail \()\} - \<^item> Nonterminal @{verbatim "A"} + \<^item> Nonterminal \<^verbatim>\A\ @{rail \A\} - \<^item> Nonterminal via Isabelle antiquotation - @{verbatim "@{syntax method}"} + \<^item> Nonterminal via Isabelle antiquotation \<^verbatim>\@{syntax method}\ @{rail \@{syntax method}\} - \<^item> Terminal @{verbatim "'xyz'"} + \<^item> Terminal \<^verbatim>\'xyz'\ @{rail \'xyz'\} - \<^item> Terminal in keyword style @{verbatim "@'xyz'"} + \<^item> Terminal in keyword style \<^verbatim>\@'xyz'\ @{rail \@'xyz'\} - \<^item> Terminal via Isabelle antiquotation - @{verbatim "@@{method rule}"} + \<^item> Terminal via Isabelle antiquotation \<^verbatim>\@@{method rule}\ @{rail \@@{method rule}\} - \<^item> Concatenation @{verbatim "A B C"} + \<^item> Concatenation \<^verbatim>\A B C\ @{rail \A B C\} - \<^item> Newline inside concatenation - @{verbatim "A B C \ D E F"} + \<^item> Newline inside concatenation \<^verbatim>\A B C \ D E F\ @{rail \A B C \ D E F\} - \<^item> Variants @{verbatim "A | B | C"} + \<^item> Variants \<^verbatim>\A | B | C\ @{rail \A | B | C\} - \<^item> Option @{verbatim "A ?"} + \<^item> Option \<^verbatim>\A ?\ @{rail \A ?\} - \<^item> Repetition @{verbatim "A *"} + \<^item> Repetition \<^verbatim>\A *\ @{rail \A *\} - \<^item> Repetition with separator @{verbatim "A * sep"} + \<^item> Repetition with separator \<^verbatim>\A * sep\ @{rail \A * sep\} - \<^item> Strict repetition @{verbatim "A +"} + \<^item> Strict repetition \<^verbatim>\A +\ @{rail \A +\} - \<^item> Strict repetition with separator @{verbatim "A + sep"} + \<^item> Strict repetition with separator \<^verbatim>\A + sep\ @{rail \A + sep\} \