$Id: admonition.mod.xsl,v 1.1.2.1 2003/05/01 14:06:14 jelmer Exp $ Ramon Casellas James Devenish 2000200120022003 Ramon Casellas Admonition XSL Variables and Templates <filename>admonition.mod.xsl</filename>
Introduction DocBook includes admonitions, which are set off from the main text.
Pertinent Variables
Declares a new environment to be used for admonitions (warning, tip, important, caution, note). A LaTeX environment is emitted. 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 $latex.admonition.path/warning). The second argument is the admonition title or the associated generic text. It requires the LaTeX fancybox package. It also uses graphics, by default. Processing the <sgmltag class="element">warning</sgmltag> admonition When processing the admonition, the following code is generated: % ---------------------------------------------- % 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 (note, warning, caution, top, important), this template chooses the graphics filename. If the admonition element is not known, the note graphic is used. note warning caution tip important note XSL Template for admonitions Uses the . An admonition will look something like this. Remarks and Bugs There can be excessive whitespace between the bottom of the admonition area and a subsequent paragraph. admonition { / }{ } admonition