diff options
Diffstat (limited to 'macros/latex/contrib/stex/doc/packages/stex-document-structure.tex')
-rw-r--r-- | macros/latex/contrib/stex/doc/packages/stex-document-structure.tex | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/macros/latex/contrib/stex/doc/packages/stex-document-structure.tex b/macros/latex/contrib/stex/doc/packages/stex-document-structure.tex index f8d570ea5e..f2cabec6c0 100644 --- a/macros/latex/contrib/stex/doc/packages/stex-document-structure.tex +++ b/macros/latex/contrib/stex/doc/packages/stex-document-structure.tex @@ -1,3 +1,4 @@ +\begin{sfragment}[id=sec:ds:intro]{Introduction} The \pkg{document-structure} package supplies an infrastructure for writing {\omdoc} documents in {\LaTeX}. This includes a simple structure sharing mechanism for \sTeX that allows to to move from a copy-and-paste document development model to a copy-and-reference model, which @@ -17,7 +18,9 @@ after translation. DAG models of documents allow to replace the ``Copy and Paste'' in the source document with a label-and-reference model where document are shared in the document source and the formatter does the copying during document formatting/presentation. +\end{sfragment} +\begin{sfragment}{Package Options} The \pkg{document-structure} package accepts the following options: \begin{center} \begin{tabular}{|l|p{10cm}|}\hline @@ -26,7 +29,9 @@ The \pkg{document-structure} package accepts the following options: \meta{sect} is \texttt{section}\\\hline \end{tabular} \end{center} +\end{sfragment} +\begin{sfragment}{Document Fragments} \begin{environment}{sfragment} The structure of the document is given by nested |sfragment| environments. In the {\LaTeX} route, the |sfragment| environment is flexibly mapped to sectioning commands, @@ -36,8 +41,8 @@ The \pkg{document-structure} package accepts the following options: sfragment. The optional metadata argument has the keys |id| for an identifier, |creators| and |contributors| for the Dublin Core metadata~\cite{DCMI:dmt03}. The option |short| allows to give a short title for the generated section. If the title contains - semantic macros, they need to be protected by |\protect|\ednote{MK: still?}, and we need - to give the |loadmodules| key it needs no value. For instance we would have + semantic macros, we need to give the |loadmodules| key (it needs no value). For instance + we would have \begin{latexcode} \begin{smodule}{foo} \symdef{bar}{B^a_r} @@ -90,9 +95,8 @@ Here we use two levels of |blindfragment|: the introductory remarks become a ``chapter'' instead of a ``part''. \item The inner one groups the frontmatter\footnote{We shied away from redefining the |frontmatter| to induce a blindfragment, but this may be the ``right'' way to go in - the future.} and makes the preface of the book a section-level construct.\ednote{MK: - We need a substitute for the ``Note that here the |display=flow| on the |sfragment| - environment prevents numbering as is traditional for prefaces.''} + the future.} and makes the preface of the book a section-level construct. The + |frontmatter| environment also suppresses numbering as is traditional for prefaces. \end{itemize} \end{environment} @@ -110,11 +114,13 @@ Here we use two levels of |blindfragment|: will\ldots'' in an |sfragment| environment, where we do not know which sectioning level we will end up. \end{function} +\end{sfragment} +\begin{sfragment}{Ending Documents Prematurely} \begin{function}{\prematurestop,\afterprematurestop} For prematurely stopping the formatting of a document, \sTeX provides the |\prematurestop| macro. It can be used everywhere in a document and ignores all input - after that -- backing out of the |sfragment| environment as needed. After that -- and + after that -- backing out of the |sfragment| environments as needed. After that -- and before the implicit |\end{document}| it calls the internal |\afterprematurestop|, which can be customized to do additional cleanup or e.g. print the bibliography. @@ -132,7 +138,12 @@ instance, the admin section of a course can be made course-independent (and ther re-usable) by using variables (actually token registers) |courseAcronym| and |courseTitle| instead of the text itself. The variables can then be set in the \sTeX preamble of the course notes file. - +\end{sfragment} + +\begin{sfragment}{Global Document Variables} + To make document fragments more reusable, we sometimes want to make the content depend + on the context. We use \defemph{document variables} for that. + \begin{function}{\setSGvar,\useSGvar} |\setSGvar{|\meta{vname}|}{|\meta{text}|}| to set the global variable \meta{vname} to \meta{text} and |\useSGvar{|\meta{vname}|}| to reference it. @@ -144,6 +155,7 @@ course notes file. variable \meta{vname}, only if (after expansion) it is equal to \meta{val}, the conditional text \meta{ctext} is formatted. \end{function} +\end{sfragment} %%% Local Variables: %%% mode: latex |