1956 isabelle.preview}, but shows a plain-text document draft. |
1956 isabelle.preview}, but shows a plain-text document draft. |
1957 |
1957 |
1958 Both actions show document sources in a regular Web browser, which may be |
1958 Both actions show document sources in a regular Web browser, which may be |
1959 also used to print the result in a more portable manner than the Java |
1959 also used to print the result in a more portable manner than the Java |
1960 printer dialog of the jEdit @{action_ref print} action. |
1960 printer dialog of the jEdit @{action_ref print} action. |
|
1961 \<close> |
|
1962 |
|
1963 |
|
1964 section \<open>Build and view documents interactively\<close> |
|
1965 |
|
1966 text \<open> |
|
1967 The \<^emph>\<open>Document\<close> panel (\figref{fig:document}) allows to manage the build |
|
1968 process of formal documents. Theory sources are taken from the running PIDE |
|
1969 editor session, as specified in the \<^emph>\<open>session selector\<close> and the \<^emph>\<open>Input\<close> |
|
1970 tab. {\LaTeX} tools are run in various stages, as shown in the \<^emph>\<open>Output\<close> |
|
1971 tab. The resulting PDF document may be viewed by an external browser. |
|
1972 |
|
1973 \begin{figure}[!htb] |
|
1974 \begin{center} |
|
1975 \includegraphics[scale=0.333]{document-panel} |
|
1976 \end{center} |
|
1977 \caption{Document panel with separate instances for \<^emph>\<open>Input\<close> and \<^emph>\<open>Output\<close>} |
|
1978 \label{fig:document} |
|
1979 \end{figure} |
|
1980 |
|
1981 The traditional batch-build works on the command-line, e.g.\ via |
|
1982 \<^verbatim>\<open>isabelle build -o document\<close>~\<open>SESSION\<close> (see also \<^cite>\<open>\<open>\S3\<close> in |
|
1983 "isabelle-system"\<close>). The corresponding session \<^verbatim>\<open>ROOT\<close> entry determines |
|
1984 \isakeyword{theories} and \isakeyword{document\_files} for the overall |
|
1985 {\LaTeX} job. The latter is run as a monolithic process, using all theories |
|
1986 and taking contents from the file-system. |
|
1987 |
|
1988 In contrast, an interactive build within Isabelle/jEdit allows to select a |
|
1989 subset of theory sources, with contents taken from the PIDE editor model. |
|
1990 Beware that \isakeyword{document\_files} and the overall session |
|
1991 specification are still taken from the \<^verbatim>\<open>ROOT\<close> entry: that information is |
|
1992 only processed on startup of Isabelle/jEdit, so changes to \<^verbatim>\<open>ROOT\<close> require a |
|
1993 restart. |
|
1994 |
|
1995 \<^medskip> The GUI elements of the \<^emph>\<open>Document\<close> panel (\figref{fig:document}), and its |
|
1996 sub-panels for \<^emph>\<open>Input\<close> and \<^emph>\<open>Output\<close> are described below (from left to |
|
1997 right). The screenshot of has two instances of the panel, to illustrate both |
|
1998 \<^emph>\<open>Input\<close> and \<^emph>\<open>Output\<close> for this explanation. |
|
1999 |
|
2000 \<^item> The \<^emph>\<open>session selector\<close> tells, which session should be the basis of the |
|
2001 document build job. This determines, which theories may be selected in the |
|
2002 \<^emph>\<open>Input\<close> tab (dynamically), and which \isakeyword{document\_files} should |
|
2003 be used (statically). |
|
2004 |
|
2005 \<^item> The \<^emph>\<open>progress indicator\<close> provides some visual feedback on the document |
|
2006 build process. The ``spinning wheel'' is either active while waiting for |
|
2007 selected document theories to be processed in the Prover IDE, or while |
|
2008 {\LaTeX} tools are running. |
|
2009 |
|
2010 \<^item> The \<^emph>\<open>Auto\<close> checkbox may be selected to say that the {\LaTeX} job should |
|
2011 be started automatically (after a timeout). This happens, whenever the |
|
2012 selected theories have been fully processed in the Prover IDE (see also |
|
2013 the \<^emph>\<open>Build\<close> botton). If successful, the resulting PDF will be shown |
|
2014 by an external browser (see also the \<^emph>\<open>View\<close> button). |
|
2015 |
|
2016 \<^item> The \<^emph>\<open>Build\<close> button invokes the {\LaTeX} job manually, when \<^emph>\<open>Input\<close> |
|
2017 theories have been fully processed. The \<^emph>\<open>Output\<close> tab follows the stages |
|
2018 of the build job, with information about sources, log output, error |
|
2019 messages. |
|
2020 |
|
2021 \<^item> The \<^emph>\<open>View\<close> button invokes an external browser application on the |
|
2022 resulting PDF file: its location is always the same, given within the |
|
2023 \<^verbatim>\<open>$ISABELLE_HOME_USER\<close> directory. Multiple invocations should normally |
|
2024 refresh the viewer application, at the same document position as last |
|
2025 time. Beware that window focus handling depends on the application (and |
|
2026 the operating system): there may be conflicts with with the editor |
|
2027 window focus. |
|
2028 |
|
2029 \<^item> The \<^emph>\<open>Input\<close> sub-panel is similar to the regular \<^emph>\<open>Theories\<close> panel |
|
2030 (\secref{sec:theories}). The selection is limited to the theories of the |
|
2031 underlying document session (see also the \<^emph>\<open>session selector\<close>). Each |
|
2032 theory may be selected or de-selected separately, using the checkbox next |
|
2033 to its name. Alternatively, there are buttons \<^emph>\<open>All\<close> and \<^emph>\<open>None\<close> to change |
|
2034 this state for the whole session. The document selection state is also |
|
2035 displayed in the regular \<^emph>\<open>Theories\<close> panel as a ``document'' icon attached |
|
2036 to the theory name: that is only shown when at least one \<^emph>\<open>Document\<close> panel |
|
2037 is active. The \<^emph>\<open>Purge\<close> button is a clone of the same button on a regular |
|
2038 \<^emph>\<open>Theories\<close> panel: it allows to remove unused theories from the PIDE |
|
2039 document model (that affects everything, not just document theories). |
|
2040 |
|
2041 Non-selected theories are turned into an (almost) empty {\LaTeX} source |
|
2042 file: formal \<open>\<^cite>\<close> antiquotations (\<^cite>\<open>"isabelle-isar-ref"\<close>) are |
|
2043 included, everything else is left blank. Thus the {\LaTeX} and Bib{\TeX} |
|
2044 document setup should normally work, independently on the selected subset |
|
2045 of theories. References to sections or pages might be missing, though. |
|
2046 |
|
2047 \<^item> The \<^emph>\<open>Output\<close> sub-panel provides a structured view and the running build |
|
2048 process. Its \<^emph>\<open>progress\<close> output consists of a two-level hierarchy of |
|
2049 messages. The outer level displays overall programs with timing |
|
2050 information. Hovering over the program name reveals the inner level with |
|
2051 program log information or error messages. |
|
2052 |
|
2053 The initial stage of \<^verbatim>\<open>Creating directory\<close> shows a directory listing of |
|
2054 the {\LaTeX} job that has been generated from all document sources. This |
|
2055 may help to explore structural failures of the {\LaTeX} job. |
1961 \<close> |
2056 \<close> |
1962 |
2057 |
1963 |
2058 |
1964 chapter \<open>ML debugging within the Prover IDE\<close> |
2059 chapter \<open>ML debugging within the Prover IDE\<close> |
1965 |
2060 |