src/Doc/Isar_Ref/Document_Preparation.thy
changeset 61458 987533262fc2
parent 61439 2bf52eec4e8a
child 61463 8e46cea6a45a
equal deleted inserted replaced
61457:3e21699bb83b 61458:987533262fc2
    47       @@{command subsubsection} | @@{command text} | @@{command txt}) @{syntax text}
    47       @@{command subsubsection} | @@{command text} | @@{command txt}) @{syntax text}
    48     ;
    48     ;
    49     @@{command text_raw} @{syntax text}
    49     @@{command text_raw} @{syntax text}
    50   \<close>}
    50   \<close>}
    51 
    51 
    52   \begin{description}
       
    53 
       
    54   \<^descr> @{command chapter}, @{command section}, @{command subsection}, and
    52   \<^descr> @{command chapter}, @{command section}, @{command subsection}, and
    55   @{command subsubsection} mark chapter and section headings within the
    53   @{command subsubsection} mark chapter and section headings within the
    56   theory source; this works in any context, even before the initial
    54   theory source; this works in any context, even before the initial
    57   @{command theory} command. The corresponding {\LaTeX} macros are
    55   @{command theory} command. The corresponding {\LaTeX} macros are
    58   @{verbatim \<open>\isamarkupchapter\<close>}, @{verbatim \<open>\isamarkupsection\<close>},
    56   @{verbatim \<open>\isamarkupchapter\<close>}, @{verbatim \<open>\isamarkupsection\<close>},
    66   \<^descr> @{command text_raw} inserts {\LaTeX} source directly into the
    64   \<^descr> @{command text_raw} inserts {\LaTeX} source directly into the
    67   output, without additional markup. Thus the full range of document
    65   output, without additional markup. Thus the full range of document
    68   manipulations becomes available, at the risk of messing up document
    66   manipulations becomes available, at the risk of messing up document
    69   output.
    67   output.
    70 
    68 
    71   \end{description}
       
    72 
    69 
    73   Except for @{command "text_raw"}, the text passed to any of the above
    70   Except for @{command "text_raw"}, the text passed to any of the above
    74   markup commands may refer to formal entities via \emph{document
    71   markup commands may refer to formal entities via \emph{document
    75   antiquotations}, see also \secref{sec:antiq}. These are interpreted in the
    72   antiquotations}, see also \secref{sec:antiq}. These are interpreted in the
    76   present theory or proof context.
    73   present theory or proof context.
   185 
   182 
   186   Note that the syntax of antiquotations may \emph{not} include source
   183   Note that the syntax of antiquotations may \emph{not} include source
   187   comments @{verbatim "(*"}~@{text "\<dots>"}~@{verbatim "*)"} nor verbatim
   184   comments @{verbatim "(*"}~@{text "\<dots>"}~@{verbatim "*)"} nor verbatim
   188   text @{verbatim "{*"}~@{text "\<dots>"}~@{verbatim "*}"}.
   185   text @{verbatim "{*"}~@{text "\<dots>"}~@{verbatim "*}"}.
   189 
   186 
   190   \begin{description}
       
   191 
       
   192   \<^descr> @{command "print_antiquotations"} prints all document antiquotations
   187   \<^descr> @{command "print_antiquotations"} prints all document antiquotations
   193   that are defined in the current context; the ``@{text "!"}'' option
   188   that are defined in the current context; the ``@{text "!"}'' option
   194   indicates extra verbosity.
   189   indicates extra verbosity.
   195 
   190 
   196   \<^descr> @{text "@{theory A}"} prints the name @{text "A"}, which is
   191   \<^descr> @{text "@{theory A}"} prints the name @{text "A"}, which is
   288 
   283 
   289   The {\LaTeX} macro name is determined by the antiquotation option
   284   The {\LaTeX} macro name is determined by the antiquotation option
   290   @{antiquotation_option_def cite_macro}, or the configuration option
   285   @{antiquotation_option_def cite_macro}, or the configuration option
   291   @{attribute cite_macro} in the context. For example, @{text "@{cite
   286   @{attribute cite_macro} in the context. For example, @{text "@{cite
   292   [cite_macro = nocite] foobar}"} produces @{verbatim \<open>\nocite{foobar}\<close>}.
   287   [cite_macro = nocite] foobar}"} produces @{verbatim \<open>\nocite{foobar}\<close>}.
   293 
       
   294   \end{description}
       
   295 \<close>
   288 \<close>
   296 
   289 
   297 
   290 
   298 subsection \<open>Styled antiquotations\<close>
   291 subsection \<open>Styled antiquotations\<close>
   299 
   292 
   301   term} admit an extra \emph{style} specification to modify the
   294   term} admit an extra \emph{style} specification to modify the
   302   printed result.  A style is specified by a name with a possibly
   295   printed result.  A style is specified by a name with a possibly
   303   empty number of arguments;  multiple styles can be sequenced with
   296   empty number of arguments;  multiple styles can be sequenced with
   304   commas.  The following standard styles are available:
   297   commas.  The following standard styles are available:
   305 
   298 
   306   \begin{description}
       
   307   
       
   308   \<^descr> @{text lhs} extracts the first argument of any application
   299   \<^descr> @{text lhs} extracts the first argument of any application
   309   form with at least two arguments --- typically meta-level or
   300   form with at least two arguments --- typically meta-level or
   310   object-level equality, or any other binary relation.
   301   object-level equality, or any other binary relation.
   311   
   302   
   312   \<^descr> @{text rhs} is like @{text lhs}, but extracts the second
   303   \<^descr> @{text rhs} is like @{text lhs}, but extracts the second
   316   in Horn-clause normal form @{text "A\<^sub>1 \<Longrightarrow> \<dots> A\<^sub>n \<Longrightarrow> C"}.
   307   in Horn-clause normal form @{text "A\<^sub>1 \<Longrightarrow> \<dots> A\<^sub>n \<Longrightarrow> C"}.
   317   
   308   
   318   \<^descr> @{text "prem"} @{text n} extract premise number
   309   \<^descr> @{text "prem"} @{text n} extract premise number
   319   @{text "n"} from from a rule in Horn-clause
   310   @{text "n"} from from a rule in Horn-clause
   320   normal form @{text "A\<^sub>1 \<Longrightarrow> \<dots> A\<^sub>n \<Longrightarrow> C"}
   311   normal form @{text "A\<^sub>1 \<Longrightarrow> \<dots> A\<^sub>n \<Longrightarrow> C"}
   321 
       
   322   \end{description}
       
   323 \<close>
   312 \<close>
   324 
   313 
   325 
   314 
   326 subsection \<open>General options\<close>
   315 subsection \<open>General options\<close>
   327 
   316 
   328 text \<open>The following options are available to tune the printed output
   317 text \<open>The following options are available to tune the printed output
   329   of antiquotations.  Note that many of these coincide with system and
   318   of antiquotations.  Note that many of these coincide with system and
   330   configuration options of the same names.
   319   configuration options of the same names.
   331 
       
   332   \begin{description}
       
   333 
   320 
   334   \<^descr> @{antiquotation_option_def show_types}~@{text "= bool"} and
   321   \<^descr> @{antiquotation_option_def show_types}~@{text "= bool"} and
   335   @{antiquotation_option_def show_sorts}~@{text "= bool"} control
   322   @{antiquotation_option_def show_sorts}~@{text "= bool"} control
   336   printing of explicit type and sort constraints.
   323   printing of explicit type and sort constraints.
   337 
   324 
   402   In contrast, @{antiquotation_option source}~@{text "= true"}
   389   In contrast, @{antiquotation_option source}~@{text "= true"}
   403   admits direct printing of the given source text, with the desirable
   390   admits direct printing of the given source text, with the desirable
   404   well-formedness check in the background, but without modification of
   391   well-formedness check in the background, but without modification of
   405   the printed text.
   392   the printed text.
   406 
   393 
   407   \end{description}
       
   408 
   394 
   409   For Boolean flags, ``@{text "name = true"}'' may be abbreviated as
   395   For Boolean flags, ``@{text "name = true"}'' may be abbreviated as
   410   ``@{text name}''.  All of the above flags are disabled by default,
   396   ``@{text name}''.  All of the above flags are disabled by default,
   411   unless changed specifically for a logic session in the corresponding
   397   unless changed specifically for a logic session in the corresponding
   412   @{verbatim "ROOT"} file.\<close>
   398   @{verbatim "ROOT"} file.
       
   399 \<close>
   413 
   400 
   414 
   401 
   415 section \<open>Markup via command tags \label{sec:tags}\<close>
   402 section \<open>Markup via command tags \label{sec:tags}\<close>
   416 
   403 
   417 text \<open>Each Isabelle/Isar command may be decorated by additional
   404 text \<open>Each Isabelle/Isar command may be decorated by additional
   512   Each @{text rule} defines a formal language (with optional name),
   499   Each @{text rule} defines a formal language (with optional name),
   513   using a notation that is similar to EBNF or regular expressions with
   500   using a notation that is similar to EBNF or regular expressions with
   514   recursion.  The meaning and visual appearance of these rail language
   501   recursion.  The meaning and visual appearance of these rail language
   515   elements is illustrated by the following representative examples.
   502   elements is illustrated by the following representative examples.
   516 
   503 
   517   \begin{itemize}
       
   518 
       
   519   \<^item> Empty @{verbatim "()"}
   504   \<^item> Empty @{verbatim "()"}
   520 
   505 
   521   @{rail \<open>()\<close>}
   506   @{rail \<open>()\<close>}
   522 
   507 
   523   \<^item> Nonterminal @{verbatim "A"}
   508   \<^item> Nonterminal @{verbatim "A"}
   572   @{rail \<open>A +\<close>}
   557   @{rail \<open>A +\<close>}
   573 
   558 
   574   \<^item> Strict repetition with separator @{verbatim "A + sep"}
   559   \<^item> Strict repetition with separator @{verbatim "A + sep"}
   575 
   560 
   576   @{rail \<open>A + sep\<close>}
   561   @{rail \<open>A + sep\<close>}
   577 
       
   578   \end{itemize}
       
   579 \<close>
   562 \<close>
   580 
   563 
   581 
   564 
   582 section \<open>Draft presentation\<close>
   565 section \<open>Draft presentation\<close>
   583 
   566 
   588 
   571 
   589   @{rail \<open>
   572   @{rail \<open>
   590     @@{command display_drafts} (@{syntax name} +)
   573     @@{command display_drafts} (@{syntax name} +)
   591   \<close>}
   574   \<close>}
   592 
   575 
   593   \begin{description}
       
   594 
       
   595   \<^descr> @{command "display_drafts"}~@{text paths} performs simple output of a
   576   \<^descr> @{command "display_drafts"}~@{text paths} performs simple output of a
   596   given list of raw source files. Only those symbols that do not require
   577   given list of raw source files. Only those symbols that do not require
   597   additional {\LaTeX} packages are displayed properly, everything else is left
   578   additional {\LaTeX} packages are displayed properly, everything else is left
   598   verbatim.
   579   verbatim.
   599 
       
   600   \end{description}
       
   601 \<close>
   580 \<close>
   602 
   581 
   603 end
   582 end