author | wenzelm |
Mon, 12 Oct 2015 17:11:17 +0200 | |
changeset 61406 | eb2463fc4d7b |
parent 58618 | 782f0b662cae |
child 61407 | 7ba7b8103565 |
permissions | -rw-r--r-- |
28221 | 1 |
theory Presentation |
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42009
diff
changeset
|
2 |
imports Base |
28221 | 3 |
begin |
4 |
||
58618 | 5 |
chapter \<open>Presenting theories \label{ch:present}\<close> |
28221 | 6 |
|
58618 | 7 |
text \<open>Isabelle provides several ways to present the outcome of |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
8 |
formal developments, including WWW-based browsable libraries or |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
9 |
actual printable documents. Presentation is centered around the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
10 |
concept of \emph{sessions} (\chref{ch:session}). The global session |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
11 |
structure is that of a tree, with Isabelle Pure at its root, further |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
12 |
object-logics derived (e.g.\ HOLCF from HOL, and HOL from Pure), and |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
13 |
application sessions further on in the hierarchy. |
28221 | 14 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
15 |
The tools @{tool_ref mkroot} and @{tool_ref build} provide the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
16 |
primary means for managing Isabelle sessions, including proper setup |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
17 |
for presentation; @{tool build} takes care to have @{executable_ref |
56439
95e2656b3b23
renamed "isabelle-process" to "isabelle_process", with shell function to avoid dynamic path lookups;
wenzelm
parents:
54936
diff
changeset
|
18 |
"isabelle_process"} run any additional stages required for document |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
19 |
preparation, notably the @{tool_ref document} and @{tool_ref latex}. |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
20 |
The complete tool chain for managing batch-mode Isabelle sessions is |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
21 |
illustrated in \figref{fig:session-tools}. |
28221 | 22 |
|
23 |
\begin{figure}[htbp] |
|
24 |
\begin{center} |
|
25 |
\begin{tabular}{lp{0.6\textwidth}} |
|
26 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
27 |
@{tool_ref mkroot} & invoked once by the user to initialize the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
28 |
session @{verbatim ROOT} with optional @{verbatim document} |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
29 |
directory; \\ |
28221 | 30 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
31 |
@{tool_ref build} & invoked repeatedly by the user to keep |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
32 |
session output up-to-date (HTML, documents etc.); \\ |
28221 | 33 |
|
56439
95e2656b3b23
renamed "isabelle-process" to "isabelle_process", with shell function to avoid dynamic path lookups;
wenzelm
parents:
54936
diff
changeset
|
34 |
@{executable "isabelle_process"} & run through @{tool_ref |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
35 |
build}; \\ |
28221 | 36 |
|
48602 | 37 |
@{tool_ref document} & run by the Isabelle process if document |
38 |
preparation is enabled; \\ |
|
28221 | 39 |
|
48602 | 40 |
@{tool_ref latex} & universal {\LaTeX} tool wrapper invoked |
41 |
multiple times by @{tool_ref document}; also useful for manual |
|
42 |
experiments; \\ |
|
28221 | 43 |
|
44 |
\end{tabular} |
|
45 |
\caption{The tool chain of Isabelle session presentation} \label{fig:session-tools} |
|
46 |
\end{center} |
|
47 |
\end{figure} |
|
58618 | 48 |
\<close> |
28221 | 49 |
|
50 |
||
58618 | 51 |
section \<open>Generating theory browser information \label{sec:info}\<close> |
28221 | 52 |
|
58618 | 53 |
text \<open> |
28221 | 54 |
\index{theory browsing information|bold} |
55 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
56 |
As a side-effect of building sessions, Isabelle is able to generate |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
57 |
theory browsing information, including HTML documents that show the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
58 |
theory sources and the relationship with its ancestors and |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
59 |
descendants. Besides the HTML file that is generated for every |
51417 | 60 |
theory, Isabelle stores links to all theories of a session in an |
61 |
index file. As a second hierarchy, groups of sessions are organized |
|
62 |
as \emph{chapters}, with a separate index. Note that the implicit |
|
63 |
tree structure of the session build hierarchy is \emph{not} relevant |
|
64 |
for the presentation. |
|
28221 | 65 |
|
66 |
Isabelle also generates graph files that represent the theory |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
67 |
dependencies within a session. There is a graph browser Java applet |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
68 |
embedded in the generated HTML pages, and also a stand-alone |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
69 |
application that allows browsing theory graphs without having to |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
70 |
start a WWW client first. The latter version also includes features |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
71 |
such as generating Postscript files, which are not available in the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
72 |
applet version. See \secref{sec:browse} for further information. |
28221 | 73 |
|
61406 | 74 |
\<^medskip> |
28221 | 75 |
The easiest way to let Isabelle generate theory browsing information |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
76 |
for existing sessions is to invoke @{tool build} with suitable |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
77 |
options: |
28221 | 78 |
|
79 |
\begin{ttbox} |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
80 |
isabelle build -o browser_info -v -c FOL |
28221 | 81 |
\end{ttbox} |
82 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
83 |
The presentation output will appear in @{verbatim |
51417 | 84 |
"$ISABELLE_BROWSER_INFO/FOL/FOL"} as reported by the above verbose |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
85 |
invocation of the build process. |
28221 | 86 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
87 |
Many Isabelle sessions (such as @{verbatim "HOL-Library"} in @{file |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
88 |
"~~/src/HOL/Library"}) also provide actual printable documents. |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
89 |
These are prepared automatically as well if enabled like this: |
28221 | 90 |
\begin{ttbox} |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
91 |
isabelle build -o browser_info -o document=pdf -v -c HOL-Library |
28221 | 92 |
\end{ttbox} |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
93 |
|
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
94 |
Enabling both browser info and document preparation simultaneously |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
95 |
causes an appropriate ``document'' link to be included in the HTML |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
96 |
index. Documents may be generated independently of browser |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
97 |
information as well, see \secref{sec:tool-document} for further |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
98 |
details. |
28221 | 99 |
|
61406 | 100 |
\<^bigskip> |
101 |
The theory browsing information is stored in a |
|
28221 | 102 |
sub-directory directory determined by the @{setting_ref |
103 |
ISABELLE_BROWSER_INFO} setting plus a prefix corresponding to the |
|
51417 | 104 |
session chapter and identifier. In order to present Isabelle |
105 |
applications on the web, the corresponding subdirectory from |
|
58618 | 106 |
@{setting ISABELLE_BROWSER_INFO} can be put on a WWW server.\<close> |
28221 | 107 |
|
61406 | 108 |
|
58618 | 109 |
section \<open>Preparing session root directories \label{sec:tool-mkroot}\<close> |
28221 | 110 |
|
58618 | 111 |
text \<open>The @{tool_def mkroot} tool configures a given directory as |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
112 |
session root, with some @{verbatim ROOT} file and optional document |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
113 |
source directory. Its usage is: |
28221 | 114 |
\begin{ttbox} |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
115 |
Usage: isabelle mkroot [OPTIONS] [DIR] |
28221 | 116 |
|
117 |
Options are: |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
118 |
-d enable document preparation |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
119 |
-n NAME alternative session name (default: DIR base name) |
28221 | 120 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
121 |
Prepare session root DIR (default: current directory). |
28221 | 122 |
\end{ttbox} |
123 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
124 |
The results are placed in the given directory @{text dir}, which |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
125 |
refers to the current directory by default. The @{tool mkroot} tool |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
126 |
is conservative in the sense that it does not overwrite existing |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
127 |
files or directories. Earlier attempts to generate a session root |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
128 |
need to be deleted manually. |
28221 | 129 |
|
61406 | 130 |
\<^medskip> |
131 |
Option @{verbatim "-d"} indicates that the session shall be |
|
51054 | 132 |
accompanied by a formal document, with @{text DIR}@{verbatim |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
133 |
"/document/root.tex"} as its {\LaTeX} entry point (see also |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
134 |
\chref{ch:present}). |
28221 | 135 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
136 |
Option @{verbatim "-n"} allows to specify an alternative session |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
137 |
name; otherwise the base name of the given directory is used. |
28221 | 138 |
|
61406 | 139 |
\<^medskip> |
140 |
The implicit Isabelle settings variable @{setting |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
141 |
ISABELLE_LOGIC} specifies the parent session, and @{setting |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
142 |
ISABELLE_DOCUMENT_FORMAT} the document format to be filled filled |
58618 | 143 |
into the generated @{verbatim ROOT} file.\<close> |
28221 | 144 |
|
145 |
||
58618 | 146 |
subsubsection \<open>Examples\<close> |
28221 | 147 |
|
58618 | 148 |
text \<open>Produce session @{verbatim Test} (with document preparation) |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
149 |
within a separate directory of the same name: |
28221 | 150 |
\begin{ttbox} |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
151 |
isabelle mkroot -d Test && isabelle build -D Test |
28221 | 152 |
\end{ttbox} |
153 |
||
61406 | 154 |
\<^medskip> |
155 |
Upgrade the current directory into a session ROOT with |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
156 |
document preparation, and build it: |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
157 |
\begin{ttbox} |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
158 |
isabelle mkroot -d && isabelle build -D . |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
159 |
\end{ttbox} |
58618 | 160 |
\<close> |
28221 | 161 |
|
162 |
||
58618 | 163 |
section \<open>Preparing Isabelle session documents |
164 |
\label{sec:tool-document}\<close> |
|
28221 | 165 |
|
58618 | 166 |
text \<open>The @{tool_def document} tool prepares logic session |
51054 | 167 |
documents, processing the sources as provided by the user and |
48602 | 168 |
generated by Isabelle. Its usage is: |
28221 | 169 |
\begin{ttbox} |
48602 | 170 |
Usage: isabelle document [OPTIONS] [DIR] |
28221 | 171 |
|
172 |
Options are: |
|
173 |
-c cleanup -- be aggressive in removing old stuff |
|
174 |
-n NAME specify document name (default 'document') |
|
52746 | 175 |
-o FORMAT specify output format: pdf (default), dvi |
28221 | 176 |
-t TAGS specify tagged region markup |
177 |
||
178 |
Prepare the theory session document in DIR (default 'document') |
|
179 |
producing the specified output format. |
|
180 |
\end{ttbox} |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
181 |
This tool is usually run automatically as part of the Isabelle build |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
182 |
process, provided document preparation has been enabled via suitable |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
183 |
options. It may be manually invoked on the generated browser |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
184 |
information document output as well, e.g.\ in case of errors |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
185 |
encountered in the batch run. |
28221 | 186 |
|
61406 | 187 |
\<^medskip> |
188 |
The @{verbatim "-c"} option tells @{tool document} to |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
189 |
dispose the document sources after successful operation! This is |
28221 | 190 |
the right thing to do for sources generated by an Isabelle process, |
191 |
but take care of your files in manual document preparation! |
|
192 |
||
61406 | 193 |
\<^medskip> |
194 |
The @{verbatim "-n"} and @{verbatim "-o"} option specify |
|
28221 | 195 |
the final output file name and format, the default is ``@{verbatim |
196 |
document.dvi}''. Note that the result will appear in the parent of |
|
197 |
the target @{verbatim DIR}. |
|
198 |
||
61406 | 199 |
\<^medskip> |
200 |
The @{verbatim "-t"} option tells {\LaTeX} how to interpret |
|
28221 | 201 |
tagged Isabelle command regions. Tags are specified as a comma |
202 |
separated list of modifier/name pairs: ``@{verbatim "+"}@{text |
|
203 |
foo}'' (or just ``@{text foo}'') means to keep, ``@{verbatim |
|
204 |
"-"}@{text foo}'' to drop, and ``@{verbatim "/"}@{text foo}'' to |
|
205 |
fold text tagged as @{text foo}. The builtin default is equivalent |
|
206 |
to the tag specification ``@{verbatim |
|
30113
5ea17e90b08a
isabelle document: adapted (postulated) defaults for tags to actual isabelle.sty;
wenzelm
parents:
29435
diff
changeset
|
207 |
"+theory,+proof,+ML,+visible,-invisible"}''; see also the {\LaTeX} |
28221 | 208 |
macros @{verbatim "\\isakeeptag"}, @{verbatim "\\isadroptag"}, and |
40800
330eb65c9469
Parse.liberal_name for document antiquotations and attributes;
wenzelm
parents:
40387
diff
changeset
|
209 |
@{verbatim "\\isafoldtag"}, in @{file |
28238 | 210 |
"~~/lib/texinputs/isabelle.sty"}. |
28221 | 211 |
|
61406 | 212 |
\<^medskip> |
213 |
Document preparation requires a @{verbatim document} |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
214 |
directory within the session sources. This directory is supposed to |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
215 |
contain all the files needed to produce the final document --- apart |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
216 |
from the actual theories which are generated by Isabelle. |
28221 | 217 |
|
61406 | 218 |
\<^medskip> |
219 |
For most practical purposes, @{tool document} is smart |
|
48602 | 220 |
enough to create any of the specified output formats, taking |
28221 | 221 |
@{verbatim root.tex} supplied by the user as a starting point. This |
222 |
even includes multiple runs of {\LaTeX} to accommodate references |
|
223 |
and bibliographies (the latter assumes @{verbatim root.bib} within |
|
224 |
the same directory). |
|
225 |
||
48657
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
226 |
In more complex situations, a separate @{verbatim build} script for |
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
227 |
the document sources may be given. It is invoked with command-line |
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
228 |
arguments for the document format and the document variant name. |
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
229 |
The script needs to produce corresponding output files, e.g.\ |
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
230 |
@{verbatim root.pdf} for target format @{verbatim pdf} (and default |
51054 | 231 |
variants). The main work can be again delegated to @{tool latex}, |
232 |
but it is also possible to harvest generated {\LaTeX} sources and |
|
233 |
copy them elsewhere. |
|
28221 | 234 |
|
61406 | 235 |
\<^medskip> |
236 |
When running the session, Isabelle copies the content of |
|
42009
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
237 |
the original @{verbatim document} directory into its proper place |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
238 |
within @{setting ISABELLE_BROWSER_INFO}, according to the session |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
239 |
path and document variant. Then, for any processed theory @{text A} |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
240 |
some {\LaTeX} source is generated and put there as @{text |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
241 |
A}@{verbatim ".tex"}. Furthermore, a list of all generated theory |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
242 |
files is put into @{verbatim session.tex}. Typically, the root |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
243 |
{\LaTeX} file provided by the user would include @{verbatim |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
244 |
session.tex} to get a document containing all the theories. |
28221 | 245 |
|
246 |
The {\LaTeX} versions of the theories require some macros defined in |
|
40800
330eb65c9469
Parse.liberal_name for document antiquotations and attributes;
wenzelm
parents:
40387
diff
changeset
|
247 |
@{file "~~/lib/texinputs/isabelle.sty"}. Doing @{verbatim |
28238 | 248 |
"\\usepackage{isabelle}"} in @{verbatim root.tex} should be fine; |
48602 | 249 |
the underlying @{tool latex} already includes an appropriate path |
250 |
specification for {\TeX} inputs. |
|
28221 | 251 |
|
252 |
If the text contains any references to Isabelle symbols (such as |
|
253 |
@{verbatim "\\"}@{verbatim "<forall>"}) then @{verbatim |
|
28238 | 254 |
"isabellesym.sty"} should be included as well. This package |
255 |
contains a standard set of {\LaTeX} macro definitions @{verbatim |
|
28221 | 256 |
"\\isasym"}@{text foo} corresponding to @{verbatim "\\"}@{verbatim |
58553 | 257 |
"<"}@{text foo}@{verbatim ">"}, see @{cite "isabelle-implementation"} for a |
28838
d5db6dfcb34a
moved table of standard Isabelle symbols to isar-ref manual;
wenzelm
parents:
28504
diff
changeset
|
258 |
complete list of predefined Isabelle symbols. Users may invent |
28221 | 259 |
further symbols as well, just by providing {\LaTeX} macros in a |
40800
330eb65c9469
Parse.liberal_name for document antiquotations and attributes;
wenzelm
parents:
40387
diff
changeset
|
260 |
similar fashion as in @{file "~~/lib/texinputs/isabellesym.sty"} of |
51054 | 261 |
the Isabelle distribution. |
28221 | 262 |
|
263 |
For proper setup of DVI and PDF documents (with hyperlinks and |
|
40800
330eb65c9469
Parse.liberal_name for document antiquotations and attributes;
wenzelm
parents:
40387
diff
changeset
|
264 |
bookmarks), we recommend to include @{file |
28238 | 265 |
"~~/lib/texinputs/pdfsetup.sty"} as well. |
28221 | 266 |
|
61406 | 267 |
\<^medskip> |
268 |
As a final step of Isabelle document preparation, @{tool |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
269 |
document}~@{verbatim "-c"} is run on the resulting copy of the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
270 |
@{verbatim document} directory. Thus the actual output document is |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
271 |
built and installed in its proper place. The generated sources are |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
272 |
deleted after successful run of {\LaTeX} and friends. |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
273 |
|
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
274 |
Some care is needed if the document output location is configured |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
275 |
differently, say within a directory whose content is still required |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
276 |
afterwards! |
58618 | 277 |
\<close> |
28221 | 278 |
|
279 |
||
58618 | 280 |
section \<open>Running {\LaTeX} within the Isabelle environment |
281 |
\label{sec:tool-latex}\<close> |
|
28221 | 282 |
|
58618 | 283 |
text \<open>The @{tool_def latex} tool provides the basic interface for |
28221 | 284 |
Isabelle document preparation. Its usage is: |
285 |
\begin{ttbox} |
|
48602 | 286 |
Usage: isabelle latex [OPTIONS] [FILE] |
28221 | 287 |
|
288 |
Options are: |
|
52746 | 289 |
-o FORMAT specify output format: pdf (default), dvi, |
290 |
bbl, idx, sty, syms |
|
28221 | 291 |
|
292 |
Run LaTeX (and related tools) on FILE (default root.tex), |
|
293 |
producing the specified output format. |
|
294 |
\end{ttbox} |
|
295 |
||
296 |
Appropriate {\LaTeX}-related programs are run on the input file, |
|
297 |
according to the given output format: @{executable latex}, |
|
298 |
@{executable pdflatex}, @{executable dvips}, @{executable bibtex} |
|
299 |
(for @{verbatim bbl}), and @{executable makeindex} (for @{verbatim |
|
300 |
idx}). The actual commands are determined from the settings |
|
52744 | 301 |
environment (@{setting ISABELLE_PDFLATEX} etc.). |
28221 | 302 |
|
303 |
The @{verbatim sty} output format causes the Isabelle style files to |
|
304 |
be updated from the distribution. This is useful in special |
|
305 |
situations where the document sources are to be processed another |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
306 |
time by separate tools. |
28221 | 307 |
|
308 |
The @{verbatim syms} output is for internal use; it generates lists |
|
309 |
of symbols that are available without loading additional {\LaTeX} |
|
310 |
packages. |
|
58618 | 311 |
\<close> |
28221 | 312 |
|
313 |
||
58618 | 314 |
subsubsection \<open>Examples\<close> |
28221 | 315 |
|
58618 | 316 |
text \<open>Invoking @{tool latex} by hand may be occasionally useful when |
48602 | 317 |
debugging failed attempts of the automatic document preparation |
318 |
stage of batch-mode Isabelle. The abortive process leaves the |
|
319 |
sources at a certain place within @{setting ISABELLE_BROWSER_INFO}, |
|
320 |
see the runtime error message for details. This enables users to |
|
321 |
inspect {\LaTeX} runs in further detail, e.g.\ like this: |
|
322 |
||
28221 | 323 |
\begin{ttbox} |
54936 | 324 |
cd "$(isabelle getenv -b ISABELLE_BROWSER_INFO)/Unsorted/Test/document" |
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
28238
diff
changeset
|
325 |
isabelle latex -o pdf |
28221 | 326 |
\end{ttbox} |
58618 | 327 |
\<close> |
28221 | 328 |
|
329 |
end |