doc-src/System/Thy/Presentation.thy
changeset 48602 342ca8f3197b
parent 48590 80ba76b46247
child 48616 be8002ee43d8
equal deleted inserted replaced
48601:655b08c2cd89 48602:342ca8f3197b
    11   \emph{logic sessions}.  The global session structure is that of a
    11   \emph{logic sessions}.  The global session structure is that of a
    12   tree, with Isabelle Pure at its root, further object-logics derived
    12   tree, with Isabelle Pure at its root, further object-logics derived
    13   (e.g.\ HOLCF from HOL, and HOL from Pure), and application sessions
    13   (e.g.\ HOLCF from HOL, and HOL from Pure), and application sessions
    14   in leaf positions (usually without a separate image).
    14   in leaf positions (usually without a separate image).
    15 
    15 
    16   The Isabelle tools @{tool_ref mkdir} and @{tool_ref make} provide
    16   The tools @{tool_ref mkdir} and @{tool_ref make} provide the primary
    17   the primary means for managing Isabelle sessions, including proper
    17   means for managing Isabelle sessions, including proper setup for
    18   setup for presentation.  Here the @{tool_ref usedir} tool takes care
    18   presentation.  Here @{tool_ref usedir} takes care to let
    19   to let @{executable_ref "isabelle-process"} process run any
    19   @{executable_ref "isabelle-process"} process run any additional
    20   additional stages required for document preparation, notably the
    20   stages required for document preparation, notably the tools
    21   tools @{tool_ref document} and @{tool_ref latex}.  The complete tool
    21   @{tool_ref document} and @{tool_ref latex}.  The complete tool chain
    22   chain for managing batch-mode Isabelle sessions is illustrated in
    22   for managing batch-mode Isabelle sessions is illustrated in
    23   \figref{fig:session-tools}.
    23   \figref{fig:session-tools}.
    24 
    24 
    25   \begin{figure}[htbp]
    25   \begin{figure}[htbp]
    26   \begin{center}
    26   \begin{center}
    27   \begin{tabular}{lp{0.6\textwidth}}
    27   \begin{tabular}{lp{0.6\textwidth}}
    28 
    28 
    29       @{verbatim isabelle} @{tool_ref mkdir} & invoked once by the user
    29       @{tool_ref mkdir} & invoked once by the user to create the
    30       to create the initial source setup (common @{verbatim
    30       initial source setup (common @{verbatim IsaMakefile} plus a
    31       IsaMakefile} plus a single session directory); \\
    31       single session directory); \\
    32 
    32 
    33       @{verbatim isabelle} @{tool make} & invoked repeatedly by the
    33       @{tool make} & invoked repeatedly by the user to keep session
    34       user to keep session output up-to-date (HTML, documents etc.); \\
    34       output up-to-date (HTML, documents etc.); \\
    35 
    35 
    36       @{verbatim isabelle} @{tool usedir} & part of the standard
    36       @{tool usedir} & part of the standard @{verbatim IsaMakefile}
    37       @{verbatim IsaMakefile} entry of a session; \\
    37       entry of a session; \\
    38 
    38 
    39       @{executable "isabelle-process"} & run through @{verbatim
    39       @{executable "isabelle-process"} & run through @{tool_ref
    40       isabelle} @{tool_ref usedir}; \\
    40       usedir}; \\
    41 
    41 
    42       @{verbatim isabelle} @{tool_ref document} & run by the Isabelle
    42       @{tool_ref document} & run by the Isabelle process if document
    43       process if document preparation is enabled; \\
    43       preparation is enabled; \\
    44 
    44 
    45       @{verbatim isabelle} @{tool_ref latex} & universal {\LaTeX} tool
    45       @{tool_ref latex} & universal {\LaTeX} tool wrapper invoked
    46       wrapper invoked multiple times by @{verbatim isabelle} @{tool_ref
    46       multiple times by @{tool_ref document}; also useful for manual
    47       document}; also useful for manual experiments; \\
    47       experiments; \\
    48 
    48 
    49   \end{tabular}
    49   \end{tabular}
    50   \caption{The tool chain of Isabelle session presentation} \label{fig:session-tools}
    50   \caption{The tool chain of Isabelle session presentation} \label{fig:session-tools}
    51   \end{center}
    51   \end{center}
    52   \end{figure}
    52   \end{figure}
    77 
    77 
    78   \medskip
    78   \medskip
    79 
    79 
    80   The easiest way to let Isabelle generate theory browsing information
    80   The easiest way to let Isabelle generate theory browsing information
    81   for existing sessions is to append ``@{verbatim "-i true"}'' to the
    81   for existing sessions is to append ``@{verbatim "-i true"}'' to the
    82   @{setting_ref ISABELLE_USEDIR_OPTIONS} before invoking @{verbatim
    82   @{setting_ref ISABELLE_USEDIR_OPTIONS} before invoking @{tool make}.
    83   isabelle} @{tool make}.  For example, add something like this to
    83   For example, add something like this to your Isabelle settings file
    84   your Isabelle settings file
       
    85 
    84 
    86 \begin{ttbox}
    85 \begin{ttbox}
    87 ISABELLE_USEDIR_OPTIONS="-i true"
    86 ISABELLE_USEDIR_OPTIONS="-i true"
    88 \end{ttbox}
    87 \end{ttbox}
    89 
    88 
    90   and then change into the @{file "~~/src/FOL"} directory and run
    89   and then change into the @{file "~~/src/FOL"} directory and run
    91   @{verbatim isabelle} @{tool make}, or even @{verbatim isabelle}
    90   @{tool make}, or even @{tool make}~@{verbatim all}.  The
    92   @{tool make}~@{verbatim all}.  The presentation output will appear
    91   presentation output will appear in @{verbatim
    93   in @{verbatim "ISABELLE_BROWSER_INFO/FOL"}, which usually refers to
    92   "ISABELLE_BROWSER_INFO/FOL"}, which usually refers to something like
    94   something like @{verbatim
    93   @{verbatim "~/.isabelle/IsabelleXXXX/browser_info/FOL"}.  Note that
    95   "~/.isabelle/IsabelleXXXX/browser_info/FOL"}.  Note that option
    94   option @{verbatim "-v true"} will make the internal runs of @{tool
    96   @{verbatim "-v true"} will make the internal runs of @{tool usedir}
    95   usedir} more explicit about such details.
    97   more explicit about such details.
       
    98 
    96 
    99   Many standard Isabelle sessions (such as @{file "~~/src/HOL/ex"})
    97   Many standard Isabelle sessions (such as @{file "~~/src/HOL/ex"})
   100   also provide actual printable documents.  These are prepared
    98   also provide actual printable documents.  These are prepared
   101   automatically as well if enabled like this, using the @{verbatim
    99   automatically as well if enabled like this, using the @{verbatim
   102   "-d"} option
   100   "-d"} option
   132 isabelle usedir -i true HOL Foo
   130 isabelle usedir -i true HOL Foo
   133 \end{ttbox}
   131 \end{ttbox}
   134 
   132 
   135   This assumes that directory @{verbatim Foo} contains some @{verbatim
   133   This assumes that directory @{verbatim Foo} contains some @{verbatim
   136   ROOT.ML} file to load all your theories, and HOL is your parent
   134   ROOT.ML} file to load all your theories, and HOL is your parent
   137   logic image (@{verbatim isabelle} @{tool_ref mkdir} assists in
   135   logic image (@{tool_ref mkdir} assists in setting up Isabelle
   138   setting up Isabelle session directories.  Theory browser information
   136   session directories.  Theory browser information for HOL should have
   139   for HOL should have been generated already beforehand.
   137   been generated already beforehand.  Alternatively, one may specify
   140   Alternatively, one may specify an external link to an existing body
   138   an external link to an existing body of HTML data by giving @{tool
   141   of HTML data by giving @{tool usedir} a @{verbatim "-P"} option like
   139   usedir} a @{verbatim "-P"} option like this:
   142   this:
       
   143 \begin{ttbox}
   140 \begin{ttbox}
   144 isabelle usedir -i true -P http://isabelle.in.tum.de/library/ HOL Foo
   141 isabelle usedir -i true -P http://isabelle.in.tum.de/library/ HOL Foo
   145 \end{ttbox}
   142 \end{ttbox}
   146 
   143 
   147   \medskip For production use, the @{tool usedir} tool is usually
   144   \medskip For production use, @{tool usedir} is usually invoked in an
   148   invoked in an appropriate @{verbatim IsaMakefile}, via the Isabelle
   145   appropriate @{verbatim IsaMakefile}, via @{tool make}.  There is a
   149   @{tool make} tool.  There is a separate @{tool mkdir} tool to
   146   separate @{tool mkdir} tool to provide easy setup of all this, with
   150   provide easy setup of all this, with only minimal manual editing
   147   only minimal manual editing required.
   151   required.
       
   152 \begin{ttbox}
   148 \begin{ttbox}
   153 isabelle mkdir HOL Foo && isabelle make
   149 isabelle mkdir HOL Foo && isabelle make
   154 \end{ttbox}
   150 \end{ttbox}
   155   See \secref{sec:tool-mkdir} for more information on preparing
   151   See \secref{sec:tool-mkdir} for more information on preparing
   156   Isabelle session directories, including the setup for documents.
   152   Isabelle session directories, including the setup for documents.
   158 
   154 
   159 
   155 
   160 section {* Creating Isabelle session directories
   156 section {* Creating Isabelle session directories
   161   \label{sec:tool-mkdir} *}
   157   \label{sec:tool-mkdir} *}
   162 
   158 
   163 text {*
   159 text {* The @{tool_def mkdir} tool prepares Isabelle session source
   164   The @{tool_def mkdir} utility prepares Isabelle session source
       
   165   directories, including a sensible default setup of @{verbatim
   160   directories, including a sensible default setup of @{verbatim
   166   IsaMakefile}, @{verbatim ROOT.ML}, and a @{verbatim document}
   161   IsaMakefile}, @{verbatim ROOT.ML}, and a @{verbatim document}
   167   directory with a minimal @{verbatim root.tex} that is sufficient to
   162   directory with a minimal @{verbatim root.tex} that is sufficient to
   168   print all theories of the session (in the order of appearance); see
   163   print all theories of the session (in the order of appearance); see
   169   \secref{sec:tool-document} for further information on Isabelle
   164   \secref{sec:tool-document} for further information on Isabelle
   170   document preparation.  The usage of @{verbatim isabelle} @{tool
   165   document preparation.  The usage of @{tool mkdir} is:
   171   mkdir} is:
   166 
   172 
   167 \begin{ttbox}
   173 \begin{ttbox}
   168 Usage: isabelle mkdir [OPTIONS] [LOGIC] NAME
   174 Usage: mkdir [OPTIONS] [LOGIC] NAME
       
   175 
   169 
   176   Options are:
   170   Options are:
   177     -I FILE      alternative IsaMakefile output
   171     -I FILE      alternative IsaMakefile output
   178     -P           include parent logic target
   172     -P           include parent logic target
   179     -b           setup build mode (session outputs heap image)
   173     -b           setup build mode (session outputs heap image)
   215   as opposed to one that only runs several theories based on an
   209   as opposed to one that only runs several theories based on an
   216   existing image.  Note that in the latter case, everything except
   210   existing image.  Note that in the latter case, everything except
   217   @{verbatim IsaMakefile} would be placed into a separate directory
   211   @{verbatim IsaMakefile} would be placed into a separate directory
   218   @{verbatim NAME}, rather than the current one.  See
   212   @{verbatim NAME}, rather than the current one.  See
   219   \secref{sec:tool-usedir} for further information on \emph{build
   213   \secref{sec:tool-usedir} for further information on \emph{build
   220   mode} vs.\ \emph{example mode} of the @{tool usedir} utility.
   214   mode} vs.\ \emph{example mode} of @{tool usedir}.
   221 
   215 
   222   \medskip The @{verbatim "-q"} option enables quiet mode, suppressing
   216   \medskip The @{verbatim "-q"} option enables quiet mode, suppressing
   223   further notes on how to proceed.
   217   further notes on how to proceed.
   224 *}
   218 *}
   225 
   219 
   234 isabelle mkdir Foo && isabelle make
   228 isabelle mkdir Foo && isabelle make
   235 \end{ttbox}
   229 \end{ttbox}
   236 
   230 
   237   \noindent The theory sources should be put into the @{verbatim Foo}
   231   \noindent The theory sources should be put into the @{verbatim Foo}
   238   directory, and its @{verbatim ROOT.ML} should be edited to load all
   232   directory, and its @{verbatim ROOT.ML} should be edited to load all
   239   required theories.  Invoking @{verbatim isabelle} @{tool make} again
   233   required theories.  Invoking @{tool make} again would run the whole
   240   would run the whole session, generating browser information and the
   234   session, generating browser information and the document
   241   document automatically.  The @{verbatim IsaMakefile} is typically
   235   automatically.  The @{verbatim IsaMakefile} is typically tuned
   242   tuned manually later, e.g.\ adding source dependencies, or changing
   236   manually later, e.g.\ adding source dependencies, or changing the
   243   the options passed to @{tool usedir}.
   237   options passed to @{tool usedir}.
   244 
   238 
   245   \medskip Large projects may demand further sessions, potentially
   239   \medskip Large projects may demand further sessions, potentially
   246   with separate logic images being created.  This usually requires
   240   with separate logic images being created.  This usually requires
   247   manual editing of the generated @{verbatim IsaMakefile}, which is
   241   manual editing of the generated @{verbatim IsaMakefile}, which is
   248   meant to cover all of the sub-session directories at the same time
   242   meant to cover all of the sub-session directories at the same time
   249   (this is the deeper reasong why @{verbatim IsaMakefile} is not made
   243   (this is the deeper reasong why @{verbatim IsaMakefile} is not made
   250   part of the initial session directory created by @{verbatim
   244   part of the initial session directory created by @{tool mkdir}).
   251   isabelle} @{tool mkdir}).  See @{file "~~/src/HOL/IsaMakefile"} for
   245   See @{file "~~/src/HOL/IsaMakefile"} for a full-blown example.  *}
   252   a full-blown example.
       
   253 *}
       
   254 
   246 
   255 
   247 
   256 section {* Running Isabelle sessions \label{sec:tool-usedir} *}
   248 section {* Running Isabelle sessions \label{sec:tool-usedir} *}
   257 
   249 
   258 text {*
   250 text {* The @{tool_def usedir} tool builds object-logic images, or
   259   The @{tool_def usedir} utility builds object-logic images, or runs
   251   runs example sessions based on existing logics. Its usage is:
   260   example sessions based on existing logics. Its usage is:
   252 \begin{ttbox}
   261 \begin{ttbox}
   253 Usage: isabelle usedir [OPTIONS] LOGIC NAME
   262 Usage: usedir [OPTIONS] LOGIC NAME
       
   263 
   254 
   264   Options are:
   255   Options are:
   265     -C BOOL      copy existing document directory to -D PATH (default true)
   256     -C BOOL      copy existing document directory to -D PATH (default true)
   266     -D PATH      dump generated document sources into PATH
   257     -D PATH      dump generated document sources into PATH
   267     -M MAX       multithreading: maximum number of worker threads (default 1)
   258     -M MAX       multithreading: maximum number of worker threads (default 1)
   342   directory.  See \secref{sec:tool-document} and
   333   directory.  See \secref{sec:tool-document} and
   343   \secref{sec:tool-latex} for more details.
   334   \secref{sec:tool-latex} for more details.
   344 
   335 
   345   \medskip The @{verbatim "-V"} option declares alternative document
   336   \medskip The @{verbatim "-V"} option declares alternative document
   346   variants, consisting of name/tags pairs (cf.\ options @{verbatim
   337   variants, consisting of name/tags pairs (cf.\ options @{verbatim
   347   "-n"} and @{verbatim "-t"} of the @{tool_ref document} tool).  The
   338   "-n"} and @{verbatim "-t"} of @{tool_ref document}).  The standard
   348   standard document is equivalent to ``@{verbatim
   339   document is equivalent to ``@{verbatim
   349   "document=theory,proof,ML"}'', which means that all theory begin/end
   340   "document=theory,proof,ML"}'', which means that all theory begin/end
   350   commands, proof body texts, and ML code will be presented
   341   commands, proof body texts, and ML code will be presented
   351   faithfully.  An alternative variant ``@{verbatim
   342   faithfully.  An alternative variant ``@{verbatim
   352   "outline=/proof/ML"}'' would fold proof and ML parts, replacing the
   343   "outline=/proof/ML"}'' would fold proof and ML parts, replacing the
   353   original text by a short place-holder.  The form ``@{text
   344   original text by a short place-holder.  The form ``@{text
   368 
   359 
   369   \medskip The @{verbatim "-D"} option causes the generated document
   360   \medskip The @{verbatim "-D"} option causes the generated document
   370   sources to be dumped at location @{verbatim PATH}; this path is
   361   sources to be dumped at location @{verbatim PATH}; this path is
   371   relative to the session's main directory.  If the @{verbatim "-C"}
   362   relative to the session's main directory.  If the @{verbatim "-C"}
   372   option is true, this will include a copy of an existing @{verbatim
   363   option is true, this will include a copy of an existing @{verbatim
   373   document} directory as provided by the user.  For example,
   364   document} directory as provided by the user.  For example, @{tool
   374   @{verbatim isabelle} @{tool usedir}~@{verbatim "-D generated HOL
   365   usedir}~@{verbatim "-D generated HOL Foo"} produces a complete set
   375   Foo"} produces a complete set of document sources at @{verbatim
   366   of document sources at @{verbatim "Foo/generated"}.  Subsequent
   376   "Foo/generated"}.  Subsequent invocation of @{verbatim
   367   invocation of @{tool document}~@{verbatim "Foo/generated"} (see also
   377   isabelle} @{tool document}~@{verbatim "Foo/generated"} (see also
       
   378   \secref{sec:tool-document}) will process the final result
   368   \secref{sec:tool-document}) will process the final result
   379   independently of an Isabelle job.  This decoupled mode of operation
   369   independently of an Isabelle job.  This decoupled mode of operation
   380   facilitates debugging of serious {\LaTeX} errors, for example.
   370   facilitates debugging of serious {\LaTeX} errors, for example.
   381 
   371 
   382   \medskip The @{verbatim "-p"} option determines the level of detail
   372   \medskip The @{verbatim "-p"} option determines the level of detail
   423 *}
   413 *}
   424 
   414 
   425 
   415 
   426 subsubsection {* Examples *}
   416 subsubsection {* Examples *}
   427 
   417 
   428 text {*
   418 text {* Refer to the @{verbatim IsaMakefile}s of the Isabelle
   429   Refer to the @{verbatim IsaMakefile}s of the Isabelle distribution's
   419   distribution's object-logics as a model for your own developments.
   430   object-logics as a model for your own developments.  For example,
   420   For example, see @{file "~~/src/FOL/IsaMakefile"}.  The @{tool_ref
   431   see @{file "~~/src/FOL/IsaMakefile"}.  The Isabelle @{tool_ref
       
   432   mkdir} tool creates @{verbatim IsaMakefile}s with proper invocation
   421   mkdir} tool creates @{verbatim IsaMakefile}s with proper invocation
   433   of @{tool usedir} as well.
   422   of @{tool usedir} as well.  *}
   434 *}
       
   435 
   423 
   436 
   424 
   437 section {* Preparing Isabelle session documents
   425 section {* Preparing Isabelle session documents
   438   \label{sec:tool-document} *}
   426   \label{sec:tool-document} *}
   439 
   427 
   440 text {*
   428 text {* The @{tool_def document} tool prepares logic session
   441   The @{tool_def document} utility prepares logic session documents,
   429   documents, processing the sources both as provided by the user and
   442   processing the sources both as provided by the user and generated by
   430   generated by Isabelle.  Its usage is:
   443   Isabelle.  Its usage is:
   431 \begin{ttbox}
   444 \begin{ttbox}
   432 Usage: isabelle document [OPTIONS] [DIR]
   445 Usage: document [OPTIONS] [DIR]
       
   446 
   433 
   447   Options are:
   434   Options are:
   448     -c           cleanup -- be aggressive in removing old stuff
   435     -c           cleanup -- be aggressive in removing old stuff
   449     -n NAME      specify document name (default 'document')
   436     -n NAME      specify document name (default 'document')
   450     -o FORMAT    specify output format: dvi (default), dvi.gz, ps,
   437     -o FORMAT    specify output format: dvi (default), dvi.gz, ps,
   454   Prepare the theory session document in DIR (default 'document')
   441   Prepare the theory session document in DIR (default 'document')
   455   producing the specified output format.
   442   producing the specified output format.
   456 \end{ttbox}
   443 \end{ttbox}
   457   This tool is usually run automatically as part of the corresponding
   444   This tool is usually run automatically as part of the corresponding
   458   Isabelle batch process, provided document preparation has been
   445   Isabelle batch process, provided document preparation has been
   459   enabled (cf.\ the @{verbatim "-d"} option of the @{tool_ref usedir}
   446   enabled (cf.\ the @{verbatim "-d"} option of @{tool_ref usedir}).
   460   tool).  It may be manually invoked on the generated browser
   447   It may be manually invoked on the generated browser information
   461   information document output as well, e.g.\ in case of errors
   448   document output as well, e.g.\ in case of errors encountered in the
   462   encountered in the batch run.
   449   batch run.
   463 
   450 
   464   \medskip The @{verbatim "-c"} option tells the @{tool document} tool
   451   \medskip The @{verbatim "-c"} option tells @{tool document} to
   465   to dispose the document sources after successful operation.  This is
   452   dispose the document sources after successful operation.  This is
   466   the right thing to do for sources generated by an Isabelle process,
   453   the right thing to do for sources generated by an Isabelle process,
   467   but take care of your files in manual document preparation!
   454   but take care of your files in manual document preparation!
   468 
   455 
   469   \medskip The @{verbatim "-n"} and @{verbatim "-o"} option specify
   456   \medskip The @{verbatim "-n"} and @{verbatim "-o"} option specify
   470   the final output file name and format, the default is ``@{verbatim
   457   the final output file name and format, the default is ``@{verbatim
   487   document}'' directory within the logic session sources.  This
   474   document}'' directory within the logic session sources.  This
   488   directory is supposed to contain all the files needed to produce the
   475   directory is supposed to contain all the files needed to produce the
   489   final document --- apart from the actual theories which are
   476   final document --- apart from the actual theories which are
   490   generated by Isabelle.
   477   generated by Isabelle.
   491 
   478 
   492   \medskip For most practical purposes, the @{tool document} tool is
   479   \medskip For most practical purposes, @{tool document} is smart
   493   smart enough to create any of the specified output formats, taking
   480   enough to create any of the specified output formats, taking
   494   @{verbatim root.tex} supplied by the user as a starting point.  This
   481   @{verbatim root.tex} supplied by the user as a starting point.  This
   495   even includes multiple runs of {\LaTeX} to accommodate references
   482   even includes multiple runs of {\LaTeX} to accommodate references
   496   and bibliographies (the latter assumes @{verbatim root.bib} within
   483   and bibliographies (the latter assumes @{verbatim root.bib} within
   497   the same directory).
   484   the same directory).
   498 
   485 
   513   session.tex} to get a document containing all the theories.
   500   session.tex} to get a document containing all the theories.
   514 
   501 
   515   The {\LaTeX} versions of the theories require some macros defined in
   502   The {\LaTeX} versions of the theories require some macros defined in
   516   @{file "~~/lib/texinputs/isabelle.sty"}.  Doing @{verbatim
   503   @{file "~~/lib/texinputs/isabelle.sty"}.  Doing @{verbatim
   517   "\\usepackage{isabelle}"} in @{verbatim root.tex} should be fine;
   504   "\\usepackage{isabelle}"} in @{verbatim root.tex} should be fine;
   518   the underlying Isabelle @{tool latex} tool already includes an
   505   the underlying @{tool latex} already includes an appropriate path
   519   appropriate path specification for {\TeX} inputs.
   506   specification for {\TeX} inputs.
   520 
   507 
   521   If the text contains any references to Isabelle symbols (such as
   508   If the text contains any references to Isabelle symbols (such as
   522   @{verbatim "\\"}@{verbatim "<forall>"}) then @{verbatim
   509   @{verbatim "\\"}@{verbatim "<forall>"}) then @{verbatim
   523   "isabellesym.sty"} should be included as well.  This package
   510   "isabellesym.sty"} should be included as well.  This package
   524   contains a standard set of {\LaTeX} macro definitions @{verbatim
   511   contains a standard set of {\LaTeX} macro definitions @{verbatim
   532   For proper setup of DVI and PDF documents (with hyperlinks and
   519   For proper setup of DVI and PDF documents (with hyperlinks and
   533   bookmarks), we recommend to include @{file
   520   bookmarks), we recommend to include @{file
   534   "~~/lib/texinputs/pdfsetup.sty"} as well.
   521   "~~/lib/texinputs/pdfsetup.sty"} as well.
   535 
   522 
   536   \medskip As a final step of document preparation within Isabelle,
   523   \medskip As a final step of document preparation within Isabelle,
   537   @{verbatim isabelle} @{tool document}~@{verbatim "-c"} is run on the
   524   @{tool document}~@{verbatim "-c"} is run on the resulting @{verbatim
   538   resulting @{verbatim document} directory.  Thus the actual output
   525   document} directory.  Thus the actual output document is built and
   539   document is built and installed in its proper place (as linked by
   526   installed in its proper place (as linked by the session's @{verbatim
   540   the session's @{verbatim index.html} if option @{verbatim "-i"} of
   527   index.html} if option @{verbatim "-i"} of @{tool_ref usedir} has
   541   @{tool_ref usedir} has been enabled, cf.\ \secref{sec:info}).  The
   528   been enabled, cf.\ \secref{sec:info}).  The generated sources are
   542   generated sources are deleted after successful run of {\LaTeX} and
   529   deleted after successful run of {\LaTeX} and friends.  Note that a
   543   friends.  Note that a separate copy of the sources may be retained
   530   separate copy of the sources may be retained by passing an option
   544   by passing an option @{verbatim "-D"} to the @{tool usedir} utility
   531   @{verbatim "-D"} to @{tool usedir} when running the session.  *}
   545   when running the session.
       
   546 *}
       
   547 
   532 
   548 
   533 
   549 section {* Running {\LaTeX} within the Isabelle environment
   534 section {* Running {\LaTeX} within the Isabelle environment
   550   \label{sec:tool-latex} *}
   535   \label{sec:tool-latex} *}
   551 
   536 
   552 text {*
   537 text {* The @{tool_def latex} tool provides the basic interface for
   553   The @{tool_def latex} utility provides the basic interface for
       
   554   Isabelle document preparation.  Its usage is:
   538   Isabelle document preparation.  Its usage is:
   555 \begin{ttbox}
   539 \begin{ttbox}
   556 Usage: latex [OPTIONS] [FILE]
   540 Usage: isabelle latex [OPTIONS] [FILE]
   557 
   541 
   558   Options are:
   542   Options are:
   559     -o FORMAT    specify output format: dvi (default), dvi.gz, ps,
   543     -o FORMAT    specify output format: dvi (default), dvi.gz, ps,
   560                  ps.gz, pdf, bbl, idx, sty, syms
   544                  ps.gz, pdf, bbl, idx, sty, syms
   561 
   545 
   571   environment (@{setting ISABELLE_LATEX} etc.).
   555   environment (@{setting ISABELLE_LATEX} etc.).
   572 
   556 
   573   The @{verbatim sty} output format causes the Isabelle style files to
   557   The @{verbatim sty} output format causes the Isabelle style files to
   574   be updated from the distribution.  This is useful in special
   558   be updated from the distribution.  This is useful in special
   575   situations where the document sources are to be processed another
   559   situations where the document sources are to be processed another
   576   time by separate tools (cf.\ option @{verbatim "-D"} of the @{tool
   560   time by separate tools (cf.\ option @{verbatim "-D"} of @{tool
   577   usedir} utility).
   561   usedir}).
   578 
   562 
   579   The @{verbatim syms} output is for internal use; it generates lists
   563   The @{verbatim syms} output is for internal use; it generates lists
   580   of symbols that are available without loading additional {\LaTeX}
   564   of symbols that are available without loading additional {\LaTeX}
   581   packages.
   565   packages.
   582 *}
   566 *}
   583 
   567 
   584 
   568 
   585 subsubsection {* Examples *}
   569 subsubsection {* Examples *}
   586 
   570 
   587 text {*
   571 text {* Invoking @{tool latex} by hand may be occasionally useful when
   588   Invoking @{verbatim isabelle} @{tool latex} by hand may be
   572   debugging failed attempts of the automatic document preparation
   589   occasionally useful when debugging failed attempts of the automatic
   573   stage of batch-mode Isabelle.  The abortive process leaves the
   590   document preparation stage of batch-mode Isabelle.  The abortive
   574   sources at a certain place within @{setting ISABELLE_BROWSER_INFO},
   591   process leaves the sources at a certain place within @{setting
   575   see the runtime error message for details.  This enables users to
   592   ISABELLE_BROWSER_INFO}, see the runtime error message for details.
   576   inspect {\LaTeX} runs in further detail, e.g.\ like this:
   593   This enables users to inspect {\LaTeX} runs in further detail, e.g.\
   577 
   594   like this:
       
   595 \begin{ttbox}
   578 \begin{ttbox}
   596   cd ~/.isabelle/IsabelleXXXX/browser_info/HOL/Test/document
   579   cd ~/.isabelle/IsabelleXXXX/browser_info/HOL/Test/document
   597   isabelle latex -o pdf
   580   isabelle latex -o pdf
   598 \end{ttbox}
   581 \end{ttbox}
   599 *}
   582 *}