Skip to content
Stefano Zaghi edited this page Jun 17, 2015 · 4 revisions

One of the environments provided by MaTiSSe.py is a generic box.

It is designed to contains any contents you want to be rendered with a different theme with respect other paragraph. The syntax is the following:

$box
$style[style_options]
$caption(caption_type)[caption_options]{caption}
$content(content_type)[content_options]{content}
$endbox

where:

  • $box and $endbox are the tags defining the box environment;
  • $style[style_options] defines the style of the whole box (inherited by both caption and contents of the box); this is optional and can be omitted, but if defined the [] brackets must be present (even without options); the style_options are any valid css style definitions (see theming section); note that the box environment is converted to a div html element;
  • $caption(caption_type)[caption_options]{caption} defines the caption of the box that can be styled differently from the main box content and it is optional; the (caption_type) defines caption prefixing class (e.g. Fig. for figures) and it is itself optional: any sentences are valid; to disable the printing of the prefixing class use $caption(none)...; the [caption_options] defines the style options of the only caption: they are any valid css definitions; the {caption} defines the caption text (can contain anything, even multi-lines paragraph) and it must be present if $caption is defined; note that (caption_type) and [caption_options] are optional, thus the following statements are valid:
    • $caption[font-variant:small-caps;]{My caption without caption_type};
    • $caption{My caption without caption_type and caption_options};
  • $content(content_type)[content_options]{content} is not optional: it defines the box's content; the (content_type) defines defines the type of the content ('figure', 'table', 'note' and 'box' for generic environments, see the following subsections) and it is itself optional; the [content_options] defines the style options of the only content: they are any valid css definitions; the {content} defines the content data (can contain anything); note that (content_type) and [content_options] are optional, thus the following statements are valid:
    • $content[font-variant:small-caps;]{My content without content_type};
    • $content{My content without content_type and content_options}.

Consider the following code:

### Box environment example

$box
$style[background:rgb(100,100,100);]
$caption(Mybox)[font-size:90%;color:white;]{An example of a generic Box}
$content[font-size:120%;color:white;]{This box has a grey background with white colored text. The caption has a 90% (with respect the slide content font-size) font-size, whereas the box contents itself has a 120% font-size.}
$endbox

This example defines a box having a grey background with white colored text. The caption has a 90% (with respect the slide content font-size) font-size, whereas the box contents itself has a 120% font-size.

Note that the themes of box environments can be defined, as all other theme elements, once for all into the preamble in order to not have to repeat the styling options for each box. The syntax for defining the boxes styles is commented into the theming section in the following.

Caption positioning

The box environment offer the possibility to customize the position of the eventual caption. Two position are allowed:

  1. TOP: the caption is positioned before (above) the box contents;
  2. BOTTOM: the caption is positioned after (below) the box contents.

To specify position of the caption you must use the [caption_options] tag:

$box
$caption[...;position : TOP;...]{Your caption}
$content...
$endbox

The syntax is position any_number_of_spaces : any_number_of_spaces (TOP|BOTTOM) eventual_;. Note that the position value, top or bottom, is case sensitive and must be upper case: this is because such positioning syntax is not valid CSS syntax, thus the uppercase is used to pointing this out. After the position has been obtained, the positioning value is purged from the CSS caption options for non polluting the final HTML. It is also worth mentioning that the is wrong positioning value is inserted (or not set at all) the caption is positioned in the bottom position without any warning message.

The following is a complete example:

### Box environment example with caption in custom position

$box
$style[background:rgb(100,100,100);]
$caption(Mybox)[font-size:90%;color:white;position: TOP;]{An example of a generic Box with TOP caption}
$content[font-size:120%;color:white;]{This box has a grey background with white colored text. The caption has a 90% (with respect the slide content font-size) font-size, whereas the box contents itself has a 120% font-size.}
$endbox

Box Contents

The box contents can be any valid markdown sources. In particular:

  • lists (bullets items, enumerations...);
  • font styling (bold, emph...);
  • headings (from 4-th to 6-th, the first 3 are reserved for MaTiSSe.py).

Moreover, the contents fully support LaTeX equations.

This feature is propagated to also note environment, but it is inhibited for figure and tables ones.

Clone this wiki locally