# HG changeset patch # User wenzelm # Date 1516113741 -3600 # Node ID dbb1f02e667d1082bddaeafc4568deecd0b67145 # Parent c98c6eb3dd4c0c6494e30ad9bf66e1917b3613b6 more documentation; diff -r c98c6eb3dd4c -r dbb1f02e667d NEWS --- a/NEWS Tue Jan 16 11:30:03 2018 +0100 +++ b/NEWS Tue Jan 16 15:42:21 2018 +0100 @@ -123,8 +123,14 @@ *** Document preparation *** -* \<^cancel>\text\ cancels unused text within inner syntax: it is ignored within -the formal language, but shown in the document with strike-out style. +* Formal comments work uniformly in outer syntax, inner syntax (term +language), Isabelle/ML and some other embedded languages of Isabelle. +See also "Document comments" in the isar-ref manual. The following forms +are supported: + + - marginal text comment: \ \\\ + - canceled source: \<^cancel>\\\ + - raw LaTeX: \<^latex>\\\ * Embedded languages such as inner syntax and ML may contain formal comments of the form "\ \text\". As in marginal comments of outer diff -r c98c6eb3dd4c -r dbb1f02e667d src/Doc/Isar_Ref/Inner_Syntax.thy --- a/src/Doc/Isar_Ref/Inner_Syntax.thy Tue Jan 16 11:30:03 2018 +0100 +++ b/src/Doc/Isar_Ref/Inner_Syntax.thy Tue Jan 16 15:42:21 2018 +0100 @@ -567,7 +567,6 @@ @{syntax_def (inner) str_token} & = & \<^verbatim>\''\ \\\ \<^verbatim>\''\ \\ @{syntax_def (inner) string_token} & = & \<^verbatim>\"\ \\\ \<^verbatim>\"\ \\ @{syntax_def (inner) cartouche} & = & @{verbatim "\"} \\\ @{verbatim "\"} \\ - @{syntax_def (inner) comment_cartouche} & = & @{verbatim "\ \"} \\\ @{verbatim "\"} \\ \end{supertabular} \end{center} @@ -582,10 +581,8 @@ (inner) float_const}, provide robust access to the respective tokens: the syntax tree holds a syntactic constant instead of a free variable. - A @{syntax (inner) comment_cartouche} resembles the outer syntax notation - for marginal @{syntax_ref comment} (\secref{sec:comments}), but is - syntactically more restrictive: only the symbol-form with \<^verbatim>\\\ and text - cartouche is supported. + Formal document comments (\secref{sec:comments}) may be also used within the + inner syntax. \ diff -r c98c6eb3dd4c -r dbb1f02e667d src/Doc/Isar_Ref/Outer_Syntax.thy --- a/src/Doc/Isar_Ref/Outer_Syntax.thy Tue Jan 16 11:30:03 2018 +0100 +++ b/src/Doc/Isar_Ref/Outer_Syntax.thy Tue Jan 16 15:42:21 2018 +0100 @@ -230,21 +230,48 @@ \ -subsection \Comments \label{sec:comments}\ +subsection \Document text\ text \ - Large chunks of plain @{syntax text} are usually given @{syntax verbatim}, - i.e.\ enclosed in \<^verbatim>\{*\~\\\~\<^verbatim>\*}\, or as @{syntax cartouche} \\\\\. For - convenience, any of the smaller text units conforming to @{syntax name} are - admitted as well. A marginal @{syntax comment} is of the form \<^verbatim>\--\~@{syntax - text} or \<^verbatim>\\\~@{syntax text}. Any number of these may occur within - Isabelle/Isar commands. + A chunk of document @{syntax text} is usually given as @{syntax cartouche} + \\\\\ or @{syntax verbatim}, i.e.\ enclosed in \<^verbatim>\{*\~\\\~\<^verbatim>\*}\. For + convenience, any of the smaller text unit that conforms to @{syntax name} is + admitted as well. @{rail \ @{syntax_def text}: @{syntax embedded} | @{syntax verbatim} - ; - @{syntax_def comment}: ('--' | @'\') @{syntax text} \} + + Typical uses are document markup commands, like \<^theory_text>\chapter\, \<^theory_text>\section\ etc. + (\secref{sec:markup}). +\ + + +subsection \Document comments \label{sec:comments}\ + +text \ + Formal comments are an integral part of the document, but are logically void + and removed from the resulting theory or term content. The output of + document preparation (\chref{ch:document-prep}) supports various styles, + according to the following kinds of comments. + + \<^item> Marginal comment of the form \<^verbatim>\\\~\\text\\ or \\ \text\\, usually with a + single space between the comment symbol and the argument cartouche. The + given argument is typeset as regular text, with formal antiquotations + (\secref{sec:antiq}). + + \<^item> Canceled text of the form \<^verbatim>\\<^cancel>\\\text\\ (no white space between the + control symbol and the argument cartouche). The argument is typeset as + formal Isabelle source and overlaid with a ``strike-through'' pattern, + e.g. \<^theory_text>\\<^cancel>\bad\\. + + \<^item> Raw {\LaTeX} source of the form \<^verbatim>\\<^latex>\\\argument\\ (no white space + between the control symbol and the argument cartouche). This allows to + augment the generated {\TeX} source arbitrarily, without any sanity + checks! + + These formal comments work uniformly in outer syntax, inner syntax (term + language), Isabelle/ML, and some other embedded languages of Isabelle. \