Warning, Note and Info Boxes

If you need to include info, note and warning boxes for your document, you define them in the stylesheet. Then with a simple command, you insert them into a location in the document.

Framed boxes use a form of a table, specifically the tikz package. So, add these packages before adding the packages for framed boxes. This also includes a set of packages for making supertabular tables.

1
2
3
4
5
6
7
8
9
10
11
\usepackage{supertabular} % Adds the supertabular type of table

\usepackage{xcolor} % Adds the xcolor package

\usepackage{tikz} % This package modifies the framed boxes

\usepackage{longtable} % Adds the longtable type of table which breaks across pages

\usepackage{tabulary} % Adds the tabulary type of table

\usepackage{colortbl} % Use for table colouring

Package for framed boxes

Before you define the specific boxes, you need to add some packages and define some colours.

Add the following to your stylesheet and change the rgb values to what you need.

1
2
3
4
5
6
7
8
9
10
11
\usepackage{framed, multicol, color} % Packages for creating a framed multicolumn box

\definecolor{shadecolor}{RGB}{216,228,241} % First shading colour

\definecolor{shadecolor1}{RGB}{216,228,241} % Second shading colour

\usepackage[framemethod=tikz]{mdframed} % Allows for tikz options for the frame

\usetikzlibrary{calc} % Adds the calculation library

\usetikzlibrary{shadows} % Adds the shadows library

With these settings, each type of box can now be defined in the stylesheet.

Defining Warning boxes

A Warning Box is information that you must be aware of before you perform a specific task.

This long bit of LaTeX defines the rules, spacing, icon and background colour of a warning box. You can just copy and adjust these settings as needed. This give the name of this rule {warnbox} which you find at the end of this definition.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Redefine the environment for the Warning framed box
\newmdenv[
  roundcorner=10pt,
  skipabove=10pt
  skipbelow=10pt
  leftmargin=20pt,
  rightmargin=20pt,
  backgroundcolor=warning,
  innertopmargin=30pt,
  innerbottommargin=10pt,
  innerleftmargin=70pt,
  middlelinewidth=0pt,
  everyline=true,
  linecolor=warnline,
  font=\normalfont\normalsize,
  shadow=false,
  frametitlefont=\normalfont\normalsize\bfseries,
  frametitleaboveskip=1em,
  singleextra={
    \node[inner sep=0pt,anchor=north west,xshift=10pt,yshift=-30pt] at (P-|O)
    {\includegraphics[scale=0.40]{sharedimages/alerticon}};
    \node[inner sep=0pt,anchor=north west,yshift=-.8\baselineskip,font=\bfseries,xshift=10pt]
     at (P-|O)
     {Warning};    
  },
  firstextra={
    \node[inner sep=0pt,anchor=north west,xshift=10pt,yshift=-30pt] at (P-|O)
    {\includegraphics[scale=0.40]{sharedimages/alerticon}};
    \node[inner sep=0pt,anchor=north west,yshift=-.8\baselineskip,font=\bfseries,xshift=10pt]
     at (P-|O)
     {Warning};    
  }
]
% Define the name of the framed box  
{warnbox}

Inserting a Warning box in document

You insert a warning box into the document flow using the following commands.

1
2
3
\begin{warnbox}
Warning text placeholder
\end{warnbox}

Defining Note boxes

Note Boxes are additional information that is important but outside the procedure described in the current text flow.

This long bit of LaTeX is essentially the same as defined for the Warning Box, with the exception of the background colour and the icon used in the box. This gives the name of the Note box as notice.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
% Redefine the environment for Note boxes                     
\newmdenv[
  roundcorner=10pt,
  skipabove=10pt
  skipbelow=10pt
  leftmargin=20pt,
  rightmargin=20pt,
  backgroundcolor=note,
  innertopmargin=30pt,
  innerbottommargin=10pt,
  innerleftmargin=70pt,
  middlelinewidth=0pt,
  everyline=true,
  linecolor=warnline,
  font=\normalfont\normalsize,
  shadow=false,
  frametitlefont=\normalfont\normalsize\bfseries,
  frametitleaboveskip=1em,
  singleextra={
    \node[inner sep=0pt,anchor=north west,xshift=10pt,yshift=-30pt] at (P-|O)
    {\includegraphics[scale=0.40]{sharedimages/tipsicon}};
    \node[inner sep=0pt,anchor=north west,yshift=-.8\baselineskip,font=\bfseries,xshift=10pt] at (P-|O)
    {Note};    
  },
  firstextra={
    \node[inner sep=0pt,anchor=north west,xshift=10pt,yshift=-30pt] at (P-|O)
    {\includegraphics[scale=0.40]{sharedimages/tipsicon}};
    \node[inner sep=0pt,anchor=north west,yshift=-.8\baselineskip,font=\bfseries,xshift=10pt] at (P-|O)
    {Note};    
  }
]
% Define the name of the framed box  
{notice}                     

Inserting a Note box in document

Use the following commands to insert a Note Box into the document flow.

1
2
3
\begin{notice}
Note text placeholder
\end{notice}

Definition for Info boxes

An Info Box would normally be used to provide additional information that may be available outside the current document, such as a website or another user manual.

Like the Warning and Note Box definitions above, you can adjust the settings as required. This gives the name of the box infobox.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
% Redefine the environment for Info boxes                     
\newmdenv[
  roundcorner=10pt,
  skipabove=10pt
  skipbelow=10pt
  leftmargin=20pt,
  rightmargin=20pt,
  backgroundcolor=info,
  innertopmargin=30pt,
  innerbottommargin=10pt,
  innerleftmargin=70pt,
  middlelinewidth=0pt,
  everyline=true,
  linecolor=warnline,
  font=\normalfont\normalsize,
  shadow=false,
  frametitlefont=\normalfont\normalsize\bfseries,
  frametitleaboveskip=1em,
  singleextra={
    \node[inner sep=0pt,anchor=north west,xshift=10pt,yshift=-30pt] at (P-|O)
    {\includegraphics[scale=0.40]{sharedimages/noticeicon}};
    \node[inner sep=0pt,anchor=north west,yshift=-.8\baselineskip,font=\bfseries,xshift=10pt] at (P-|O)
    {Information};    
  },
  firstextra={
    \node[inner sep=0pt,anchor=north west,xshift=10pt,yshift=-30pt] at (P-|O)
    {\includegraphics[scale=0.40]{sharedimages/noticeicon}};
    \node[inner sep=0pt,anchor=north west,yshift=-.8\baselineskip,font=\bfseries,xshift=10pt] at (P-|O)
    {Information};    
  }
]
% Define the name of the framed box
{infobox}                     

Inserting a Info box in document

Use the following commands to insert an Info box into the document flow.

1
2
3
\begin{infobox}
Info text placeholder
\end{infobox}

Defining a basic boxes

You can define a general purpose box for use as required.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% Redefine the environment for a Basic box
\newmdenv[
  roundcorner=10pt,
  skipabove=10pt
  skipbelow=10pt
  leftmargin=10pt,
  rightmargin=10pt,
  backgroundcolor=codeBackground,
  innertopmargin=20pt,
  innerbottommargin=20pt,
  innerleftmargin=20pt,
  innerrightmargin=20pt,
  middlelinewidth=0pt,
  everyline=true,
  linecolor=warnline,
  font=\normalfont\normalsize,
  shadow=false,
  frametitlefont=\normalfont\normalsize\bfseries,
  frametitleaboveskip=1em,
  singleextra={
%    \node[inner sep=0pt,anchor=north west,xshift=10pt,yshift=-30pt] at (P-|O);
    \node[inner sep=0pt,anchor=north west,yshift=-.8\baselineskip,font=\bfseries,xshift=10pt] at (P-|O) { };    
  },
  firstextra={
%    \node[inner sep=0pt,anchor=north west,xshift=10pt,yshift=-30pt] at (P-|O);
    \node[inner sep=0pt,anchor=north west,yshift=-.8\baselineskip,font=\bfseries,xshift=10pt] at (P-|O) { };    
  }
]
% Define the name of the framed box
{basic}                     

Inserting a basic box in a document

Use the following command to inser a basic box into the document flow.

1
2
3
\begin{basic}
Basic text placeholder
\end{basic}