%xsldoc.ent; ]> $Id: admonition.mod.xsl,v 1.14 2004/01/03 09:48:34 j-devenish Exp $ &ramon; &james; 2000200120022003 Ramon Casellas &rev_2003_05; Admonitions <filename>admonition.mod.xsl</filename> &DocBook; includes admonitions (warning, tip, important, caution, note), which are set off from the main text. &DB2LaTeX; places these in the normal text flow but surrounds them with a box border. Declares a new environment to be used for admonitions This &LaTeX; environment is emitted during the preamble. That environment has two mandatory parameters. Instances of the environment are customised for each admonition via those parameters. Instances will be typeset as boxed areas in the document flow. The first argument is the filename for graphics (e.g. $admon.graphics.path/warning). The second argument is the admonition title or the associated generic text. Processing the <doc:db>warning</doc:db> admonition When processing the admonition, the following code is generated: The environment uses graphics by default. This may generate errors or warnings if &LaTeX; cannot find the graphics. If necessary, graphics may be disabled via . % ---------------------------------------------- % Define a new LaTeX environment (adminipage) % ---------------------------------------------- \newenvironment{admminipage}% { % this code corresponds to the \begin{adminipage} command \begin{Sbox}% \begin{minipage}% } %done { % this code corresponds to the \end{adminipage} command \end{minipage} \end{Sbox} \fbox{\TheSbox} } %done % ---------------------------------------------- % Define a new LaTeX length (admlength) % ---------------------------------------------- \newlength{\admlength} % ---------------------------------------------- % Define a new LaTeX environment (admonition) % With 2 parameters: % #1 The file (e.g. note.pdf) % #2 The caption % ---------------------------------------------- \newenvironment{admonition}[2] { % this code corresponds to the \begin{admonition} command \hspace{0mm}\newline\hspace*\fill\newline \noindent \setlength{\fboxsep}{5pt} \setlength{\admlength}{\linewidth} \addtolength{\admlength}{-10\fboxsep} \addtolength{\admlength}{-10\fboxrule} \admminipage{\admlength} {\bfseries \sc\large{#2}} \newline \\[1mm] \sffamily % \includegraphics[ ]{#1} \addtolength{\admlength}{-1cm} \addtolength{\admlength}{-20pt} \begin{minipage}[lt]{\admlength} \parskip=0.5\baselineskip \advance\parskip by 0pt plus 2pt } %done { % this code corresponds to the \end{admonition} command \vspace{5mm} \end{minipage} \endadmminipage \vspace{.5em} \par } Choose an admonition graphic For each admonition element (warning, tip, important, caution, note), this template chooses the graphics filename. If the admonition element is not known, the note graphic is used. name The name of the adminition. &DB2LaTeX; includes different graphics for different adminitions. By default, name defaults to the XSLT local-name of the current node. note warning caution tip important note Process admonitions Invokes the environment provided by and applies templates. An admonition will look something like this note. There can be excessive whitespace between the bottom of the admonition area and a subsequent paragraph. &test_adm; &test_bind; &test_book; &mapping; admonition { / }{ } admonition