1 theory Document_Preparation |
1 theory Document_Preparation |
2 imports Base Main |
2 imports Base Main |
3 begin |
3 begin |
4 |
4 |
5 chapter {* Document preparation \label{ch:document-prep} *} |
5 chapter \<open>Document preparation \label{ch:document-prep}\<close> |
6 |
6 |
7 text {* Isabelle/Isar provides a simple document preparation system |
7 text \<open>Isabelle/Isar provides a simple document preparation system |
8 based on {PDF-\LaTeX}, with support for hyperlinks and bookmarks |
8 based on {PDF-\LaTeX}, with support for hyperlinks and bookmarks |
9 within that format. This allows to produce papers, books, theses |
9 within that format. This allows to produce papers, books, theses |
10 etc.\ from Isabelle theory sources. |
10 etc.\ from Isabelle theory sources. |
11 |
11 |
12 {\LaTeX} output is generated while processing a \emph{session} in |
12 {\LaTeX} output is generated while processing a \emph{session} in |
13 batch mode, as explained in the \emph{The Isabelle System Manual} |
13 batch mode, as explained in the \emph{The Isabelle System Manual} |
14 @{cite "isabelle-sys"}. The main Isabelle tools to get started with |
14 @{cite "isabelle-sys"}. The main Isabelle tools to get started with |
15 document preparation are @{tool_ref mkroot} and @{tool_ref build}. |
15 document preparation are @{tool_ref mkroot} and @{tool_ref build}. |
16 |
16 |
17 The classic Isabelle/HOL tutorial @{cite "isabelle-hol-book"} also |
17 The classic Isabelle/HOL tutorial @{cite "isabelle-hol-book"} also |
18 explains some aspects of theory presentation. *} |
18 explains some aspects of theory presentation.\<close> |
19 |
19 |
20 |
20 |
21 section {* Markup commands \label{sec:markup} *} |
21 section \<open>Markup commands \label{sec:markup}\<close> |
22 |
22 |
23 text {* |
23 text \<open> |
24 \begin{matharray}{rcl} |
24 \begin{matharray}{rcl} |
25 @{command_def "header"} & : & @{text "toplevel \<rightarrow> toplevel"} \\[0.5ex] |
25 @{command_def "header"} & : & @{text "toplevel \<rightarrow> toplevel"} \\[0.5ex] |
26 @{command_def "chapter"} & : & @{text "local_theory \<rightarrow> local_theory"} \\ |
26 @{command_def "chapter"} & : & @{text "local_theory \<rightarrow> local_theory"} \\ |
27 @{command_def "section"} & : & @{text "local_theory \<rightarrow> local_theory"} \\ |
27 @{command_def "section"} & : & @{text "local_theory \<rightarrow> local_theory"} \\ |
28 @{command_def "subsection"} & : & @{text "local_theory \<rightarrow> local_theory"} \\ |
28 @{command_def "subsection"} & : & @{text "local_theory \<rightarrow> local_theory"} \\ |
94 |
94 |
95 \medskip The proof markup commands closely resemble those for theory |
95 \medskip The proof markup commands closely resemble those for theory |
96 specifications, but have a different formal status and produce |
96 specifications, but have a different formal status and produce |
97 different {\LaTeX} macros. The default definitions coincide for |
97 different {\LaTeX} macros. The default definitions coincide for |
98 analogous commands such as @{command section} and @{command sect}. |
98 analogous commands such as @{command section} and @{command sect}. |
99 *} |
99 \<close> |
100 |
100 |
101 |
101 |
102 section {* Document Antiquotations \label{sec:antiq} *} |
102 section \<open>Document Antiquotations \label{sec:antiq}\<close> |
103 |
103 |
104 text {* |
104 text \<open> |
105 \begin{matharray}{rcl} |
105 \begin{matharray}{rcl} |
106 @{antiquotation_def "theory"} & : & @{text antiquotation} \\ |
106 @{antiquotation_def "theory"} & : & @{text antiquotation} \\ |
107 @{antiquotation_def "thm"} & : & @{text antiquotation} \\ |
107 @{antiquotation_def "thm"} & : & @{text antiquotation} \\ |
108 @{antiquotation_def "lemma"} & : & @{text antiquotation} \\ |
108 @{antiquotation_def "lemma"} & : & @{text antiquotation} \\ |
109 @{antiquotation_def "prop"} & : & @{text antiquotation} \\ |
109 @{antiquotation_def "prop"} & : & @{text antiquotation} \\ |
294 @{antiquotation_option_def cite_macro}, or the configuration option |
294 @{antiquotation_option_def cite_macro}, or the configuration option |
295 @{attribute cite_macro} in the context. For example, @{text "@{cite |
295 @{attribute cite_macro} in the context. For example, @{text "@{cite |
296 [cite_macro = nocite] foobar}"} produces @{verbatim "\\nocite{foobar}"}. |
296 [cite_macro = nocite] foobar}"} produces @{verbatim "\\nocite{foobar}"}. |
297 |
297 |
298 \end{description} |
298 \end{description} |
299 *} |
299 \<close> |
300 |
300 |
301 |
301 |
302 subsection {* Styled antiquotations *} |
302 subsection \<open>Styled antiquotations\<close> |
303 |
303 |
304 text {* The antiquotations @{text thm}, @{text prop} and @{text |
304 text \<open>The antiquotations @{text thm}, @{text prop} and @{text |
305 term} admit an extra \emph{style} specification to modify the |
305 term} admit an extra \emph{style} specification to modify the |
306 printed result. A style is specified by a name with a possibly |
306 printed result. A style is specified by a name with a possibly |
307 empty number of arguments; multiple styles can be sequenced with |
307 empty number of arguments; multiple styles can be sequenced with |
308 commas. The following standard styles are available: |
308 commas. The following standard styles are available: |
309 |
309 |
322 \item @{text "prem"} @{text n} extract premise number |
322 \item @{text "prem"} @{text n} extract premise number |
323 @{text "n"} from from a rule in Horn-clause |
323 @{text "n"} from from a rule in Horn-clause |
324 normal form @{text "A\<^sub>1 \<Longrightarrow> \<dots> A\<^sub>n \<Longrightarrow> C"} |
324 normal form @{text "A\<^sub>1 \<Longrightarrow> \<dots> A\<^sub>n \<Longrightarrow> C"} |
325 |
325 |
326 \end{description} |
326 \end{description} |
327 *} |
327 \<close> |
328 |
328 |
329 |
329 |
330 subsection {* General options *} |
330 subsection \<open>General options\<close> |
331 |
331 |
332 text {* The following options are available to tune the printed output |
332 text \<open>The following options are available to tune the printed output |
333 of antiquotations. Note that many of these coincide with system and |
333 of antiquotations. Note that many of these coincide with system and |
334 configuration options of the same names. |
334 configuration options of the same names. |
335 |
335 |
336 \begin{description} |
336 \begin{description} |
337 |
337 |
411 \end{description} |
411 \end{description} |
412 |
412 |
413 For Boolean flags, ``@{text "name = true"}'' may be abbreviated as |
413 For Boolean flags, ``@{text "name = true"}'' may be abbreviated as |
414 ``@{text name}''. All of the above flags are disabled by default, |
414 ``@{text name}''. All of the above flags are disabled by default, |
415 unless changed specifically for a logic session in the corresponding |
415 unless changed specifically for a logic session in the corresponding |
416 @{verbatim "ROOT"} file. *} |
416 @{verbatim "ROOT"} file.\<close> |
417 |
417 |
418 |
418 |
419 section {* Markup via command tags \label{sec:tags} *} |
419 section \<open>Markup via command tags \label{sec:tags}\<close> |
420 |
420 |
421 text {* Each Isabelle/Isar command may be decorated by additional |
421 text \<open>Each Isabelle/Isar command may be decorated by additional |
422 presentation tags, to indicate some modification in the way it is |
422 presentation tags, to indicate some modification in the way it is |
423 printed in the document. |
423 printed in the document. |
424 |
424 |
425 @{rail \<open> |
425 @{rail \<open> |
426 @{syntax_def tags}: ( tag * ) |
426 @{syntax_def tags}: ( tag * ) |
463 also provide some high-level options to specify the meaning of |
463 also provide some high-level options to specify the meaning of |
464 arbitrary tags to ``keep'', ``drop'', or ``fold'' the corresponding |
464 arbitrary tags to ``keep'', ``drop'', or ``fold'' the corresponding |
465 parts of the text. Logic sessions may also specify ``document |
465 parts of the text. Logic sessions may also specify ``document |
466 versions'', where given tags are interpreted in some particular way. |
466 versions'', where given tags are interpreted in some particular way. |
467 Again see @{cite "isabelle-sys"} for further details. |
467 Again see @{cite "isabelle-sys"} for further details. |
468 *} |
468 \<close> |
469 |
469 |
470 |
470 |
471 section {* Railroad diagrams *} |
471 section \<open>Railroad diagrams\<close> |
472 |
472 |
473 text {* |
473 text \<open> |
474 \begin{matharray}{rcl} |
474 \begin{matharray}{rcl} |
475 @{antiquotation_def "rail"} & : & @{text antiquotation} \\ |
475 @{antiquotation_def "rail"} & : & @{text antiquotation} \\ |
476 \end{matharray} |
476 \end{matharray} |
477 |
477 |
478 @{rail \<open> |
478 @{rail \<open> |
576 \item Strict repetition with separator @{verbatim "A + sep"} |
576 \item Strict repetition with separator @{verbatim "A + sep"} |
577 |
577 |
578 @{rail \<open>A + sep\<close>} |
578 @{rail \<open>A + sep\<close>} |
579 |
579 |
580 \end{itemize} |
580 \end{itemize} |
581 *} |
581 \<close> |
582 |
582 |
583 |
583 |
584 section {* Draft presentation *} |
584 section \<open>Draft presentation\<close> |
585 |
585 |
586 text {* |
586 text \<open> |
587 \begin{matharray}{rcl} |
587 \begin{matharray}{rcl} |
588 @{command_def "display_drafts"}@{text "\<^sup>*"} & : & @{text "any \<rightarrow>"} \\ |
588 @{command_def "display_drafts"}@{text "\<^sup>*"} & : & @{text "any \<rightarrow>"} \\ |
589 \end{matharray} |
589 \end{matharray} |
590 |
590 |
591 @{rail \<open> |
591 @{rail \<open> |